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

Last change on this file since 693 was 663, checked in by rybkin, 10 years ago

See C.L. 522

  • 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
[663]4// Modified by Grigory Rybkin
[2]5// See the complete license in cmt_license.txt "http://www.cecill.info".
6//-----------------------------------------------------------
7
[496]8#ifndef __cmt_vcs_h__
9#define __cmt_vcs_h__
[2]10
11#include "cmt_system.h"
[535]12#include "cmt_use.h"
[2]13
[535]14class Modules;
[496]15class Vcs
[2]16{
[496]17 public:
[534]18
19  typedef enum
20    {
21      Cvs,
22      Svn
23    } VcsType;
24
25 public:
[2]26 
[496]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); */
[2]31  static void checkout (const CmtSystem::cmt_string_vector& arguments);
32
[496]33  class Checkout
34  {
35  public:
[534]36    Checkout ()
[535]37      : m_head (false), m_recursive (false), m_context (false), m_info (false)
[534]38      { }
[496]39    cmt_string m_version_tag;
[535]40    bool m_head;
[496]41    cmt_string m_checkout_dir;
42    cmt_string m_version_dir;
43    cmt_string m_offset;
44    CmtSystem::cmt_string_vector m_modules;
[534]45    cmt_string m_requirements;
46    cmt_string m_command;
47    bool m_recursive;
48    bool m_context;
[535]49    bool m_info;
[496]50    void print ()
51      {
52        cerr << "m_version_tag: " << m_version_tag << endl;
[535]53        cerr << "m_head: " << m_head << endl;
[496]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          }
[534]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;
[496]65      }
66  };
67
[534]68  static void checkout_module (const Checkout& checkout,
69                               bool config, bool with_version_directory,
[535]70                               cmt_string module, cmt_string version_tag,
[534]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);
[535]76  static void checkout_context (const Checkout& checkout, Modules modules,
77                                bool config, bool with_version_directory,
78                                VcsType type);
[534]79
[496]80 private:
81
82  static void help ();
83  static void add_cmtpath (const cmt_string& dir);
84  static bool need_version_directory ();
[535]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);
[2]94};
95
[496]96class Svn
97{
98 public:
99 
[535]100  static void checkout (Vcs::Checkout checkout, Modules modules,
[496]101                       bool config, bool with_version_directory);
102};
103
[535]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
[2]113#endif
Note: See TracBrowser for help on using the repository browser.