Changeset 539 for CMT/HEAD/source


Ignore:
Timestamp:
Mar 30, 2010, 4:15:31 PM (14 years ago)
Author:
rybkin
Message:

See C.L. 426

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_vcs.cxx

    r535 r539  
    227227             const cmt_string& path = "");
    228228
     229  void exclude_current_project ();
     230  void restore_current_project ();
     231
    229232private:
    230233  Packages ();
    231   void exclude_current_project ();
    232   void restore_current_project ();
    233234
    234235  int m_i;
     
    653654  */
    654655
     656  /*
    655657  if (version.find ("*") != cmt_string::npos)
    656658    {
     
    665667  else
    666668    {
     669  */
    667670      Use use_obj (package, version, path);
    668671      Use* use = &use_obj;
     
    677680//                          module, version,
    678681//                          m_type);
    679     }
     682//    }
    680683
    681684}
     
    36863689  cerr << "   -l          Do not process used packages (default)." << endl;
    36873690  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;
    36893692  cerr << "   -C          Determine version tag and/or package container from context." << endl;
    36903693  cerr << "   -i          Do not check out, show package(s) information only." << endl;
     
    40924095      }
    40934096    } // end of for-loop over checkout.m_modules
    4094   if (checkout.m_context)
     4097
     4098  if (checkout.m_context
     4099      && !checkout.m_head)
    40954100    {
    40964101      resolve_uses (checkout, uses + modules.m_uses);
     
    41544159{
    41554160public:
    4156   VisitorForInfo ()
     4161  VisitorForInfo (const Vcs::Checkout& checkout)
     4162    : m_checkout (checkout)
    41574163  {
    41584164  }
     
    41604166  void in (Use* use)
    41614167  {
     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
    41624182    cmt_string p = use->real_path;
    41634183    if (use->path != "")
     
    41714191
    41724192    cout << use->get_package_name ()
    4173          << " " << use->version;
     4193         << " " << version; //use->version;
    41744194   
    41754195    if (CmtSystem::absolute_path (use->path))
     
    41924212    cout << endl;
    41934213  }
     4214
     4215private:
     4216  const Vcs::Checkout& m_checkout;
    41944217};
    41954218
     
    42094232  void in (Use* use)
    42104233  {
    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 () :
    42124250                       use->get_package_name ());
    42134251    Vcs::checkout_module (m_checkout,
     
    42154253                          //                      module, version,
    42164254                          module,
    4217                           use->version,
     4255                          version,
    42184256                          m_type);
    42194257  }
     
    42474285   * Checkout packages found in context
    42484286   */
    4249   if (checkout.m_context)
     4287  if (checkout.m_context
     4288      && !checkout.m_head)
    42504289    {
    42514290      Vcs::checkout_context (checkout, modules,
    42524291                             config, with_version_directory,
    42534292                             Vcs::Svn);
    4254       if (!checkout.m_head) return;
     4293      return;
    42554294    }
    42564295
     
    42584297   * Call checkout for each command line argument
    42594298   */
    4260   VisitorForInfo visitor_i;
     4299  VisitorForInfo visitor_i (checkout);
    42614300  VisitorForCheckout visitor_co (checkout,
    42624301                                 config, with_version_directory,
     
    42824321    }
    42834322  */
    4284 
    4285   if (checkout.m_context) return;
    42864323
    42874324  /**
     
    43554392    {
    43564393      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)
    43584397        //      if (checkout.m_recursive)
    43594398        {
     
    45174556                            Vcs::VcsType type)
    45184557{
    4519   VisitorForInfo visitor_i;
     4558  VisitorForInfo visitor_i (checkout);
    45204559  VisitorForCheckout visitor_co (checkout,
    45214560                                 config, with_version_directory,
     
    46584697  //int Vcs::resolve_uses (const Checkout& checkout, const Modules& modules)
    46594698{
    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/*
     4731int 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;
    46614735
    46624736  //  cerr << "Vcs::resolve_uses NEW+" << endl;
     
    47604834  return 0;
    47614835}
    4762 
     4836*/
    47634837//--------------------------------------------------------------------
    47644838void Vcs::checkout_from_requirements (const Vcs::Checkout& checkout,
     
    47804854  if (checkout.m_info)
    47814855    {
    4782       VisitorForInfo visitor_i;
     4856      VisitorForInfo visitor_i (checkout);
    47834857      Walkthru wth (visitor_i);
    47844858      wth.run (text, expression);
Note: See TracChangeset for help on using the changeset viewer.