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
10#include "cert.hh"
11#include "outdated_indicator.hh"
12#include "vocab.hh"
13
14class app_state;
15
16class tag_t
17{
18public:
19 revision_id ident;
20 utf8 name;
21 rsa_keypair_id key;
22 tag_t(revision_id const & ident, utf8 const & name, rsa_keypair_id const & key);
23};
24bool operator < (tag_t const & a, tag_t const & b);
25
26typedef bool suspended_indicator;
27
28class project_t
29{
30 app_state & app;
31 std::map<std::pair<branch_name, suspended_indicator>, 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, bool allow_suspend_certs = true);
39 void get_branch_list(globish const & glob, std::set<branch_name> & names,
40 bool allow_suspend_certs = true);
41 void get_branch_heads(branch_name const & name, std::set<revision_id> & heads,
42 std::multimap<revision_id, revision_id> *inverse_graph_cache_ptr = NULL);
43
44 outdated_indicator get_tags(std::set<tag_t> & tags);
45 void put_tag(revision_id const & id, std::string const & name);
46
47 bool revision_is_in_branch(revision_id const & id, branch_name const & branch);
48 void put_revision_in_branch(revision_id const & id,
49 branch_name const & branch);
50
51 bool revision_is_suspended_in_branch(revision_id const & id, branch_name const & branch);
52 void suspend_revision_in_branch(revision_id const & id,
53 branch_name const & branch);
54
55 outdated_indicator get_revision_cert_hashes(revision_id const & rid,
56 std::vector<hexenc<id> > & hashes);
57 outdated_indicator get_revision_certs(revision_id const & id,
58 std::vector<revision<cert> > & certs);
59 outdated_indicator get_revision_certs_by_name(revision_id const & id,
60 cert_name const & name,
61 std::vector<revision<cert> > & certs);
62 outdated_indicator get_revision_branches(revision_id const & id,
63 std::set<branch_name> & branches);
64 outdated_indicator get_branch_certs(branch_name const & branch,
65 std::vector<revision<cert> > & certs);
66
67 void put_standard_certs(revision_id const & id,
68 branch_name const & branch,
69 utf8 const & changelog,
70 date_t const & time,
71 utf8 const & author);
72 void put_standard_certs_from_options(revision_id const & id,
73 branch_name const & branch,
74 utf8 const & changelog);
75
76 void put_cert(revision_id const & id,
77 cert_name const & name,
78 cert_value const & value);
79};
80
81#endif
82
83
84// Local Variables:
85// mode: C++
86// fill-column: 76
87// c-file-style: "gnu"
88// indent-tabs-mode: nil
89// End:
90// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
91

Archive Download this file

Branches

Tags

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