source: CMT/HEAD/source/cmt_vcs.h @ 660

Last change on this file since 660 was 535, checked in by rybkin, 14 years ago

See C.L. 422

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