Changeset 539 for CMT/HEAD/source
- Timestamp:
- Mar 30, 2010, 4:15:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/source/cmt_vcs.cxx
r535 r539 227 227 const cmt_string& path = ""); 228 228 229 void exclude_current_project (); 230 void restore_current_project (); 231 229 232 private: 230 233 Packages (); 231 void exclude_current_project ();232 void restore_current_project ();233 234 234 235 int m_i; … … 653 654 */ 654 655 656 /* 655 657 if (version.find ("*") != cmt_string::npos) 656 658 { … … 665 667 else 666 668 { 669 */ 667 670 Use use_obj (package, version, path); 668 671 Use* use = &use_obj; … … 677 680 // module, version, 678 681 // m_type); 679 }682 // } 680 683 681 684 } … … 3686 3689 cerr << " -l Do not process used packages (default)." << endl; 3687 3690 cerr << " -R Process used products recursively." << endl; 3688 cerr << " -r rev Check out version tag . (is sticky)" << endl;3691 cerr << " -r rev Check out version tag rev (may be HEAD)." << endl; 3689 3692 cerr << " -C Determine version tag and/or package container from context." << endl; 3690 3693 cerr << " -i Do not check out, show package(s) information only." << endl; … … 4092 4095 } 4093 4096 } // end of for-loop over checkout.m_modules 4094 if (checkout.m_context) 4097 4098 if (checkout.m_context 4099 && !checkout.m_head) 4095 4100 { 4096 4101 resolve_uses (checkout, uses + modules.m_uses); … … 4154 4159 { 4155 4160 public: 4156 VisitorForInfo () 4161 VisitorForInfo (const Vcs::Checkout& checkout) 4162 : m_checkout (checkout) 4157 4163 { 4158 4164 } … … 4160 4166 void in (Use* use) 4161 4167 { 4168 cmt_string version (use->version); 4169 if (m_checkout.m_head) 4170 { 4171 version = "HEAD"; 4172 } 4173 else if (version.find ("*") != cmt_string::npos 4174 && !m_checkout.m_context) 4175 { 4176 CmtMessage::warning (use->get_info () + 4177 ": Skipped due to wildcards in version." 4178 " Consider using -C option."); 4179 return; 4180 } 4181 4162 4182 cmt_string p = use->real_path; 4163 4183 if (use->path != "") … … 4171 4191 4172 4192 cout << use->get_package_name () 4173 << " " << use->version;4193 << " " << version; //use->version; 4174 4194 4175 4195 if (CmtSystem::absolute_path (use->path)) … … 4192 4212 cout << endl; 4193 4213 } 4214 4215 private: 4216 const Vcs::Checkout& m_checkout; 4194 4217 }; 4195 4218 … … 4209 4232 void in (Use* use) 4210 4233 { 4211 cmt_string module ((use->path != "") ? use->path + "/" + use->get_package_name () : 4234 cmt_string version (use->version); 4235 if (m_checkout.m_head) 4236 { 4237 version = "HEAD"; 4238 } 4239 else if (version.find ("*") != cmt_string::npos 4240 && !m_checkout.m_context) 4241 { 4242 CmtMessage::warning (use->get_info () + 4243 ": Skipped due to wildcards in version." 4244 " Consider using -C option."); 4245 return; 4246 } 4247 4248 cmt_string module ((use->path != "") ? 4249 use->path + "/" + use->get_package_name () : 4212 4250 use->get_package_name ()); 4213 4251 Vcs::checkout_module (m_checkout, … … 4215 4253 // module, version, 4216 4254 module, 4217 use->version,4255 version, 4218 4256 m_type); 4219 4257 } … … 4247 4285 * Checkout packages found in context 4248 4286 */ 4249 if (checkout.m_context) 4287 if (checkout.m_context 4288 && !checkout.m_head) 4250 4289 { 4251 4290 Vcs::checkout_context (checkout, modules, 4252 4291 config, with_version_directory, 4253 4292 Vcs::Svn); 4254 if (!checkout.m_head)return;4293 return; 4255 4294 } 4256 4295 … … 4258 4297 * Call checkout for each command line argument 4259 4298 */ 4260 VisitorForInfo visitor_i ;4299 VisitorForInfo visitor_i (checkout); 4261 4300 VisitorForCheckout visitor_co (checkout, 4262 4301 config, with_version_directory, … … 4282 4321 } 4283 4322 */ 4284 4285 if (checkout.m_context) return;4286 4323 4287 4324 /** … … 4355 4392 { 4356 4393 CmtMessage::info (module + " done."); 4357 if (checkout.m_recursive && !checkout.m_context) 4394 if (checkout.m_recursive 4395 && (!checkout.m_context || checkout.m_head)) 4396 // if (checkout.m_recursive && !checkout.m_context) 4358 4397 // if (checkout.m_recursive) 4359 4398 { … … 4517 4556 Vcs::VcsType type) 4518 4557 { 4519 VisitorForInfo visitor_i ;4558 VisitorForInfo visitor_i (checkout); 4520 4559 VisitorForCheckout visitor_co (checkout, 4521 4560 config, with_version_directory, … … 4658 4697 //int Vcs::resolve_uses (const Checkout& checkout, const Modules& modules) 4659 4698 { 4660 if (!checkout.m_context) return 0; 4699 Packages& pkgs = Packages::instance (); 4700 pkgs.exclude_current_project (); 4701 4702 bool cur_recursive (Cmt::get_recursive ()); 4703 CmtScopeFilteringMode 4704 cur_scope_filtering_mode (Cmt::get_scope_filtering_mode ()); 4705 4706 if (checkout.m_recursive) 4707 { 4708 Cmt::set_recursive (true); 4709 Cmt::set_scope_filtering_mode (reach_private_uses); 4710 } 4711 4712 SyntaxParser::parse_requirements_text (uses, "", &(Use::current())); 4713 4714 if (checkout.m_recursive) 4715 { 4716 Cmt::set_recursive (cur_recursive); 4717 Cmt::set_scope_filtering_mode (cur_scope_filtering_mode); 4718 } 4719 4720 pkgs.restore_current_project (); 4721 4722 if (CmtError::get_last_error_code () == CmtError::package_not_found) 4723 { 4724 CmtError::print (); 4725 return -1; 4726 } 4727 4728 return 0; 4729 } 4730 /* 4731 int Vcs::resolve_uses (const Checkout& checkout, const cmt_string& uses) 4732 //int Vcs::resolve_uses (const Checkout& checkout, const Modules& modules) 4733 { 4734 // if (!checkout.m_context) return 0; 4661 4735 4662 4736 // cerr << "Vcs::resolve_uses NEW+" << endl; … … 4760 4834 return 0; 4761 4835 } 4762 4836 */ 4763 4837 //-------------------------------------------------------------------- 4764 4838 void Vcs::checkout_from_requirements (const Vcs::Checkout& checkout, … … 4780 4854 if (checkout.m_info) 4781 4855 { 4782 VisitorForInfo visitor_i ;4856 VisitorForInfo visitor_i (checkout); 4783 4857 Walkthru wth (visitor_i); 4784 4858 wth.run (text, expression);
Note: See TracChangeset
for help on using the changeset viewer.