source: CMT/v1r25-branch/source/cmt_vcs.h

Last change on this file was 664, checked in by rybkin, 10 years ago

merge -r 646:663 HEAD

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1//-----------------------------------------------------------
2// Copyright Christian Arnault LAL-Orsay CNRS
3// arnault@lal.in2p3.fr
4// Modified by Grigory Rybkin
5// See the complete license in cmt_license.txt "http://www.cecill.info".
6//-----------------------------------------------------------
7
8#ifndef __cmt_vcs_h__
9#define __cmt_vcs_h__
10
11#include "cmt_system.h"
12#include "cmt_use.h"
13
14class Modules;
15class Vcs
16{
17 public:
18
19  typedef enum
20    {
21      Cvs,
22      Svn
23    } VcsType;
24
25 public:
26 
27/*   static void tags (const CmtSystem::cmt_string_vector& arguments); */
28/*   static void branches (const cmt_string& module); */
29/*   static void subpackages (const cmt_string& module); */
30/*   static void subprojects (const cmt_string& module); */
31  static void checkout (const CmtSystem::cmt_string_vector& arguments);
32
33  class Checkout
34  {
35  public:
36    Checkout ()
37      : m_head (false), m_recursive (false), m_context (false), m_info (false)
38      { }
39    cmt_string m_version_tag;
40    bool m_head;
41    cmt_string m_checkout_dir;
42    cmt_string m_version_dir;
43    cmt_string m_offset;
44    CmtSystem::cmt_string_vector m_modules;
45    cmt_string m_requirements;
46    cmt_string m_command;
47    bool m_recursive;
48    bool m_context;
49    bool m_info;
50    void print ()
51      {
52        cerr << "m_version_tag: " << m_version_tag << endl;
53        cerr << "m_head: " << m_head << endl;
54        cerr << "m_checkout_dir: " << m_checkout_dir << endl;
55        cerr << "m_version_dir: " << m_version_dir << endl;
56        cerr << "m_offset: " << m_offset << endl;
57        for (int arg = 0; arg < m_modules.size (); arg++)
58          {
59            cerr << "m_modules[" << arg << "]: " << m_modules[arg] << endl;
60          }
61        cerr << "m_requirements: " << m_requirements << endl;
62        cerr << "m_command: " << m_command << endl;
63        cerr << "m_recursive: " << m_recursive << endl;
64        cerr << "m_context: " << m_context << endl;
65      }
66  };
67
68  static void checkout_module (const Checkout& checkout,
69                               bool config, bool with_version_directory,
70                               cmt_string module, cmt_string version_tag,
71                               VcsType type);
72  static void checkout_from_requirements (const Checkout& checkout,
73                                          bool config, bool with_version_directory,
74                                          const cmt_string& requirements,
75                                          VcsType type);
76  static void checkout_context (const Checkout& checkout, Modules modules,
77                                bool config, bool with_version_directory,
78                                VcsType type);
79
80 private:
81
82  static void help ();
83  static void add_cmtpath (const cmt_string& dir);
84  static bool need_version_directory ();
85  static int parse_arguments (const CmtSystem::cmt_string_vector& arguments,
86                              Checkout& checkout, bool& config);
87  static int parse_checkout (Checkout& checkout, Modules& modules);
88  //  static int parse_checkout (const Checkout& checkout, cmt_string& uses);
89  static int resolve_uses (const cmt_string& text, cmt_string& uses);
90  static int resolve_uses (const cmt_string& text, Use::UsePtrVector& uses);
91  static int resolve_uses (const Checkout& checkout, const cmt_string& uses);
92  //  static int resolve_uses (const Checkout& checkout, const Modules& modules);
93  //  static void start_visit (IUseVisitor& visitor);
94};
95
96class Svn
97{
98 public:
99 
100  static void checkout (Vcs::Checkout checkout, Modules modules,
101                       bool config, bool with_version_directory);
102};
103
104class IUseVisitor
105{
106 public:
107  //virtual void pre (Project* p) = 0;
108  virtual void in (Use* use) = 0;
109  //virtual void in_again (Project* p) = 0;
110  //virtual void post (Project* p) = 0;
111};
112
113#endif
Note: See TracBrowser for help on using the repository browser.