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
26class project_t
27{
28 app_state & app;
29 std::map<branch_name, std::pair<outdated_indicator, std::set<revision_id> > > branch_heads;
30 std::set<branch_name> branches;
31 outdated_indicator indicator;
32
33public:
34 project_t(app_state & app);
35
36 void get_branch_list(std::set<branch_name> & names);
37 void get_branch_list(globish const & glob, std::set<branch_name> & names);
38 void get_branch_heads(branch_name const & name, std::set<revision_id> & heads);
39
40 outdated_indicator get_tags(std::set<tag_t> & tags);
41 void put_tag(revision_id const & id, std::string const & name);
42
43 bool revision_is_in_branch(revision_id const & id, branch_name const & branch);
44 void put_revision_in_branch(revision_id const & id,
45 branch_name const & branch);
46
47 outdated_indicator get_revision_cert_hashes(revision_id const & rid,
48 std::vector<hexenc<id> > & hashes);
49 outdated_indicator get_revision_certs(revision_id const & id,
50 std::vector<revision<cert> > & certs);
51 outdated_indicator get_revision_certs_by_name(revision_id const & id,
52 cert_name const & name,
53 std::vector<revision<cert> > & certs);
54 outdated_indicator get_revision_branches(revision_id const & id,
55 std::set<branch_name> & branches);
56 outdated_indicator get_branch_certs(branch_name const & branch,
57 std::vector<revision<cert> > & certs);
58
59 void put_standard_certs(revision_id const & id,
60 branch_name const & branch,
61 utf8 const & changelog,
62 date_t const & time,
63 utf8 const & author);
64 void put_standard_certs_from_options(revision_id const & id,
65 branch_name const & branch,
66 utf8 const & changelog);
67
68 void put_cert(revision_id const & id,
69 cert_name const & name,
70 cert_value const & value);
71};
72
73#endif
74
75
76// Local Variables:
77// mode: C++
78// fill-column: 76
79// c-file-style: "gnu"
80// indent-tabs-mode: nil
81// End:
82// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
83

Archive Download this file

Branches

Tags

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