Changeset 1246
- Timestamp:
- Oct 30, 2010, 4:41:51 AM (13 years ago)
- Location:
- branches/0.8-stable
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.8-stable/bin/Parameter.cc
r1119 r1246 97 97 check_existence(root_.value()); 98 98 check_readable(root_.value()); 99 100 // check that root is directory (or link pointing to directory) 101 struct stat stats; 102 stat(root_.value().c_str(), &stats); 103 if (!S_ISDIR(stats.st_mode)) { 104 std::stringstream ss; 105 ss << cmd_.program_name() << ": '" << root_.value() 106 << "': Not a directory"; 107 throw yat::utility::cmd_error(ss.str()); 108 } 99 109 chdir(root_.value()); 100 root_ .value(pwd());110 root_full_ = pwd(); 101 111 chdir(save_wd); 112 113 // take care of when root is a symlink (see ticket #477) 114 lstat(root_.value().c_str(), &stats); 115 if (S_ISLNK(stats.st_mode)) 116 root_basename_ = file_name(root_.value()); 117 else 118 root_basename_ = file_name(root_full_); 102 119 } 103 120 … … 181 198 std::string Parameter::root(void) const 182 199 { 183 return root_.value(); 184 } 200 return root_full_; 201 } 202 203 204 const std::string& Parameter::root_basename(void) const 205 { 206 assert(root_basename_.size()); 207 return root_basename_; 208 } 209 185 210 186 211 void Parameter::set_default(void) -
branches/0.8-stable/bin/Parameter.h
r1119 r1246 55 55 bool generate_config(void) const ; 56 56 bool ignore_cache(void) const; 57 /// @return absolute path to root directory 57 58 /** 59 @return Dereferenced absolute path to root directory 60 */ 58 61 std::string root(void) const; 62 63 /** 64 If --root argument is a link we return the file_name(argument). 65 Otherwise we return file_name(root()). See root(void). 66 67 \return basename of --root argument. 68 */ 69 const std::string& root_basename(void) const; 59 70 bool verbose(void) const; 60 71 … … 83 94 yat::utility::OptionSwitch ignore_cache_; 84 95 yat::utility::OptionArg<std::string> root_; 96 std::string root_basename_; 97 std::string root_full_; 85 98 yat::utility::OptionSwitch verbose_; 86 99 protected: -
branches/0.8-stable/bin/svncopyright.cc
r1119 r1246 65 65 if (option.verbose()) 66 66 std::cout << "Building directory tree" << std::endl; 67 Directory tree(0,option.root(),"" );67 Directory tree(0,option.root(),"",option.root_basename()); 68 68 69 69 if (option.verbose()) -
branches/0.8-stable/bin/svndigest.cc
r1180 r1246 109 109 if (option.verbose()) 110 110 std::cout << "Building directory tree" << std::endl; 111 Directory tree(0,option.root(),"" );111 Directory tree(0,option.root(),"", option.root_basename()); 112 112 113 113 if (option.verbose()) … … 227 227 if (option.verbose()) 228 228 std::cout << "Generating output" << std::endl; 229 mkdir( tree.name());230 chdir( tree.name().c_str());229 mkdir(option.root_basename()); 230 chdir(option.root_basename()); 231 231 print_css("svndigest.css"); 232 232 print_main_page(tree.name(), tree.log(), stats, tree.url()); -
branches/0.8-stable/bin/svndigestParameter.cc
r1119 r1246 91 91 check_existence(target_.value()); 92 92 check_readable(target_.value()); 93 std::string base_root = file_name(root()); 94 std::string path = concatenate_path(target_.value(),base_root); 93 std::string path = concatenate_path(target_.value(),root_basename()); 95 94 if (access_rights(target_.value().c_str(), "w")) { 96 95 std::stringstream ss; -
branches/0.8-stable/lib/Directory.cc
r1024 r1246 50 50 51 51 Directory::Directory(const unsigned int level, const std::string& path, 52 const std::string& output )53 : Node(level,path,output )52 const std::string& output, const std::string& project) 53 : Node(level,path,output,project) 54 54 { 55 55 output_dir_=local_path(); -
branches/0.8-stable/lib/Directory.h
r978 r1246 53 53 /// 54 54 Directory(const unsigned int level, const std::string& path, 55 const std::string& output="" );55 const std::string& output="", const std::string& project=""); 56 56 57 57 /// -
branches/0.8-stable/lib/Node.cc
r978 r1246 46 46 47 47 Node::Node(const unsigned int level, const std::string& path, 48 const std::string& local_path )48 const std::string& local_path, const std::string& project) 49 49 : level_(level), path_(path), stats_(path), log_(NULL), 50 50 svninfo_(path) … … 54 54 svndigest_ignore_=property.svndigest_ignore(); 55 55 if (Node::project_==std::string()) // no root directory in local path 56 Node::project_ = file_name(path);56 Node::project_ = project; 57 57 else if (local_path.empty()) 58 58 local_path_ = file_name(path); -
branches/0.8-stable/lib/Node.h
r1017 r1246 58 58 /// @brief Constructor 59 59 /// 60 Node(const unsigned int, const std::string&, const std::string&); 60 Node(const unsigned int, const std::string&, const std::string&, 61 const std::string& = ""); 61 62 62 63 /// -
branches/0.8-stable/test/Makefile.am
r1166 r1246 28 28 EXTRA_PROGRAMS = cache_partial_test color_test \ 29 29 config_test copyright_test date_test \ 30 graph_test htmlstream_test \30 graph_test htmlstream_test parameter_test \ 31 31 parser_test stats_test trac_test utility_test 32 32 33 33 CLEANFILES = $(EXTRA_PROGRAMS) 34 35 parameter_test_SOURCES = parameter_test.cc $(top_srcdir)/bin/Parameter.cc \ 36 $(top_srcdir)/bin/svndigestParameter.cc 34 37 35 38 distributed_TESTS = … … 38 41 distributed_TESTS += config3_test.sh 39 42 distributed_TESTS += copyright2_test.sh 43 distributed_TESTS += link_root_test.sh 40 44 distributed_TESTS += repo_status_test.sh 41 45 distributed_TESTS += repo_test.sh
Note: See TracChangeset
for help on using the changeset viewer.