1 | //----------------------------------------------------------- |
---|
2 | // Copyright Christian Arnault LAL-Orsay CNRS |
---|
3 | // arnault@lal.in2p3.fr |
---|
4 | // See the complete license in cmt_license.txt "http://www.cecill.info". |
---|
5 | //----------------------------------------------------------- |
---|
6 | |
---|
7 | #ifndef __cmt_vcs_h__ |
---|
8 | #define __cmt_vcs_h__ |
---|
9 | |
---|
10 | #include "cmt_system.h" |
---|
11 | |
---|
12 | class Vcs |
---|
13 | { |
---|
14 | public: |
---|
15 | |
---|
16 | typedef enum |
---|
17 | { |
---|
18 | Cvs, |
---|
19 | Svn |
---|
20 | } VcsType; |
---|
21 | |
---|
22 | public: |
---|
23 | |
---|
24 | /* static void tags (const CmtSystem::cmt_string_vector& arguments); */ |
---|
25 | /* static void branches (const cmt_string& module); */ |
---|
26 | /* static void subpackages (const cmt_string& module); */ |
---|
27 | /* static void subprojects (const cmt_string& module); */ |
---|
28 | static void checkout (const CmtSystem::cmt_string_vector& arguments); |
---|
29 | |
---|
30 | class Checkout |
---|
31 | { |
---|
32 | public: |
---|
33 | Checkout () |
---|
34 | : m_recursive (false), m_context (false) |
---|
35 | { } |
---|
36 | cmt_string m_version_tag; |
---|
37 | cmt_string m_checkout_dir; |
---|
38 | cmt_string m_version_dir; |
---|
39 | cmt_string m_offset; |
---|
40 | CmtSystem::cmt_string_vector m_modules; |
---|
41 | cmt_string m_requirements; |
---|
42 | cmt_string m_command; |
---|
43 | bool m_recursive; |
---|
44 | bool m_context; |
---|
45 | void print () |
---|
46 | { |
---|
47 | cerr << "m_version_tag: " << m_version_tag << endl; |
---|
48 | cerr << "m_checkout_dir: " << m_checkout_dir << endl; |
---|
49 | cerr << "m_version_dir: " << m_version_dir << endl; |
---|
50 | cerr << "m_offset: " << m_offset << endl; |
---|
51 | for (int arg = 0; arg < m_modules.size (); arg++) |
---|
52 | { |
---|
53 | cerr << "m_modules[" << arg << "]: " << m_modules[arg] << endl; |
---|
54 | } |
---|
55 | cerr << "m_requirements: " << m_requirements << endl; |
---|
56 | cerr << "m_command: " << m_command << endl; |
---|
57 | cerr << "m_recursive: " << m_recursive << endl; |
---|
58 | cerr << "m_context: " << m_context << endl; |
---|
59 | } |
---|
60 | }; |
---|
61 | |
---|
62 | static void checkout_module (const Checkout& checkout, |
---|
63 | bool config, bool with_version_directory, |
---|
64 | const cmt_string& module, cmt_string version_tag, |
---|
65 | VcsType type); |
---|
66 | static void checkout_from_requirements (const Checkout& checkout, |
---|
67 | bool config, bool with_version_directory, |
---|
68 | const cmt_string& requirements, |
---|
69 | VcsType type); |
---|
70 | |
---|
71 | private: |
---|
72 | |
---|
73 | static void help (); |
---|
74 | static void add_cmtpath (const cmt_string& dir); |
---|
75 | static bool need_version_directory (); |
---|
76 | static int parse_checkout (const CmtSystem::cmt_string_vector& arguments, |
---|
77 | Checkout& checkout, bool& config); |
---|
78 | }; |
---|
79 | |
---|
80 | class Svn |
---|
81 | { |
---|
82 | public: |
---|
83 | |
---|
84 | static void checkout (Vcs::Checkout checkout, |
---|
85 | bool config, bool with_version_directory); |
---|
86 | }; |
---|
87 | |
---|
88 | #endif |
---|