? |
Reimplemented from Awk.
Definition at line 2014 of file cmt_cvs.cxx.
References cmt_string::find(), History::instance(), History::is_installed(), m_first, m_result, cmt_string::npos, cmt_vector< cmt_string >::size(), and CmtSystem::split().
02015 {
02016
02017
02018
02019 if (line.find ("use CMT") != cmt_string::npos) return;
02020 if (line.find ("use cmt") != cmt_string::npos) return;
02021
02022 History& h = History::instance ();
02023
02024 if (h.is_installed (line)) return;
02025
02026 CmtSystem::cmt_string_vector words;
02027
02028 CmtSystem::split (line, " \t", words);
02029
02030 enum
02031 {
02032 need_package,
02033 need_version,
02034 need_path,
02035 no_need
02036 } state = need_package;
02037
02038 cmt_string package;
02039 cmt_string version;
02040 cmt_string path;
02041
02042 for (int i = 1; i < words.size (); i++)
02043 {
02044 const cmt_string& s = words[i];
02045
02046 if (s[0] == '-') continue;
02047
02048 switch (state)
02049 {
02050 case need_package:
02051 package = s;
02052 state = need_version;
02053 break;
02054 case need_version:
02055 version = s;
02056 state = need_path;
02057 break;
02058 case need_path:
02059 path = s;
02060 state = no_need;
02061 break;
02062 }
02063 }
02064
02065 if (version.find ("*") != cmt_string::npos)
02066 {
02067
02068
02069
02070
02071
02072 return;
02073 }
02074
02080 m_result += line;
02081 m_result += "\n";
02082
02083 if (m_first)
02084 {
02085 m_first = false;
02086 cout << " # --> now propagate cmt checkout to :" << endl;
02087 }
02088
02089 cout << " # " << package << " " << version << " " << path << endl;
02090 }
|