monotone

monotone Mtn Source Tree

Root/legacy.hh

1#ifndef __LEGACY_HH__
2#define __LEGACY_HH__
3
4// Copyright (C) 2005 Nathaniel Smith <njs@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13// old code needed for reading legacy data (so we can then convert it)
14
15#include <map>
16
17#include "paths.hh"
18#include "vocab.hh"
19
20class database;
21
22namespace legacy
23{
24 ////////
25 // parser for old .mt-attrs file format
26 typedef std::map<file_path, std::map<std::string, std::string> > dot_mt_attrs_map;
27
28 void
29 read_dot_mt_attrs(data const & dat, dot_mt_attrs_map & attr);
30
31 ///////
32 // parsing old-style revisions, for 'rosterify' command
33
34 // HACK: this is a special reader which picks out the new_manifest field in
35 // a revision; it ignores all other symbols. This is because, in the
36 // pre-roster database, we have revisions holding change_sets, not
37 // csets. If we apply the cset reader to them, they fault. We need to
38 // *partially* read them, however, in order to get the manifest IDs out of
39 // the old revisions (before we delete the revs and rebuild them)
40
41 typedef std::map<revision_id, std::map<file_path, file_path> > renames_map;
42
43 void
44 get_manifest_and_renames_for_rev(database & db,
45 revision_id const & ident,
46 manifest_id & mid,
47 renames_map & renames);
48
49 ///////
50 // parsing old-style manifests, for 'rosterify' and 'changesetify' commands
51 typedef std::map<file_path, file_id,
52 std::less<file_path> > manifest_map;
53 void read_manifest_map(manifest_data const & mdat,
54 manifest_map & man);
55
56}
57
58// Local Variables:
59// mode: C++
60// fill-column: 76
61// c-file-style: "gnu"
62// indent-tabs-mode: nil
63// End:
64// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
65
66#endif

Archive Download this file

Branches

Tags

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