monotone

monotone Mtn Source Tree

Root/project.hh

1// 2007 Timothy Brownawell <tbrownaw@gmail.com>
2// GNU GPL V2 or later
3
4#ifndef __PROJECT_HH__
5#define __PROJECT_HH__
6
7#include <map>
8#include <set>
9#include <string>
10
11#include "cert.hh"
12#include "outdated_indicator.hh"
13#include "vocab.hh"
14
15class app_state;
16struct packet_consumer;
17
18class tag_t
19{
20public:
21 revision_id ident;
22 utf8 name;
23 rsa_keypair_id key;
24 tag_t(revision_id const & ident, utf8 const & name, rsa_keypair_id const & key);
25};
26bool operator < (tag_t const & a, tag_t const & b);
27
28class project_t
29{
30 app_state & app;
31 std::map<branch_name, std::pair<outdated_indicator, std::set<revision_id> > > branch_heads;
32 std::set<branch_name> branches;
33 outdated_indicator indicator;
34
35public:
36 project_t(app_state & app);
37
38 void get_branch_list(std::set<branch_name> & names);
39 void get_branch_list(globish const & glob, std::set<branch_name> & names);
40 void get_branch_heads(branch_name const & name, std::set<revision_id> & heads);
41
42 outdated_indicator get_tags(std::set<tag_t> & tags);
43 void put_tag(revision_id const & id, std::string const & name, packet_consumer & pc);
44
45 bool revision_is_in_branch(revision_id const & id, branch_name const & branch);
46 void put_revision_in_branch(revision_id const & id,
47 branch_name const & branch,
48 packet_consumer & pc);
49
50 outdated_indicator get_revision_cert_hashes(revision_id const & rid,
51 std::vector<hexenc<id> > & hashes);
52 outdated_indicator get_revision_certs(revision_id const & id,
53 std::vector<revision<cert> > & certs);
54 outdated_indicator get_revision_certs_by_name(revision_id const & id,
55 cert_name const & name,
56 std::vector<revision<cert> > & certs);
57 outdated_indicator get_revision_branches(revision_id const & id,
58 std::set<branch_name> & branches);
59 outdated_indicator get_branch_certs(branch_name const & branch,
60 std::vector<revision<cert> > & certs);
61
62 void put_standard_certs(revision_id const & id,
63 branch_name const & branch,
64 utf8 const & changelog,
65 date_t const & time,
66 utf8 const & author,
67 packet_consumer & pc);
68 void put_standard_certs_from_options(revision_id const & id,
69 branch_name const & branch,
70 utf8 const & changelog,
71 packet_consumer & pc);
72
73 void put_cert(revision_id const & id,
74 cert_name const & name,
75 cert_value const & value,
76 packet_consumer & pc);
77};
78
79#endif
80
81
82// Local Variables:
83// mode: C++
84// fill-column: 76
85// c-file-style: "gnu"
86// indent-tabs-mode: nil
87// End:
88// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
89

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status