# # # add_file "rev_types.hh" # content [b737aea93821772121ad0e197346a492b01ad291] # # patch "Makefile.am" # from [a3c168f353f4b8067559dbf136b7eee3928d6e13] # to [a06ed9cd27e9377fa52ced74131e136d4202e2d4] # # patch "annotate.cc" # from [c53402defbc6caabca1cc2af8439d6dc93b78c42] # to [c9bd09ef8719f801368bf0a07a09ba98afe2f38f] # # patch "annotate.hh" # from [c14105693d3c6e7813adc27295e44d2134ef5502] # to [1ffd0ce10fb46ba3d995e3ae5fbc1638d7462896] # # patch "asciik.cc" # from [c1b62f0e8a2347a961476756cb88d502494cfd32] # to [2d6d29c25b745d4e6edf50b936260b578ba1cc25] # # patch "asciik.hh" # from [b1c45a89506145446b33457ca62c836c9f255689] # to [80f43a7385027a74cc27728be8da0bc81bab85ba] # # patch "automate.cc" # from [b8943689152840aa05ca214dcc6240c1c4cc1386] # to [bfcb89a183337e269f8de377876d84a1f217497a] # # patch "base.hh" # from [6f10b727eb2d3f1e1c8e61223b080595ccef7b76] # to [0d3a9bd364e4f1d791384e11074a86e29a24080c] # # patch "cert.cc" # from [b9f4a223c51537671b6dbcc7814a6069244504f3] # to [bf85ea5442652da9c33d9c8e86a433b03580d38e] # # patch "cmd_db.cc" # from [297c7ba6e5ea74edf822caf8e1acc9b113e5fd66] # to [3ee4683a5bf823e4bd6e2fa58d530bb8855945eb] # # patch "cmd_diff_log.cc" # from [1630867b9e3c4004e3f9263e861285dc7f9ad4b1] # to [5acec4dbefcd8cbf47ced5068d2cd6b7f4e5c01a] # # patch "cmd_files.cc" # from [40d4cb0e2464923ab8c9acd08c35cd4f257a520b] # to [8352fcfda0f5f42347c9bf384d8cd457cf06e4fe] # # patch "cmd_list.cc" # from [28bfb5898869212de53955aafe7f90a22c3e909f] # to [4de1e461e891d6461f673b3708f21423ece0085b] # # patch "cmd_merging.cc" # from [3678e7d84993b8c91627cec91a6957e3a3a575c9] # to [2c89f51225c02200a2ba3e861afb94403fa6478a] # # patch "cmd_netsync.cc" # from [3faa92d18fdbcb4c2bf5d38d343ee196f9a69334] # to [56cd0fe69f28349a46fcd1b19acc0df610c7f011] # # patch "cmd_ws_commit.cc" # from [d37dc1b666e1ac37175dde775b48a24c0ff0cefa] # to [273085e0ae7815df69f24d0360421fe14eaef81b] # # patch "cset.hh" # from [d76a7276730c9649ea326745abfd0d2be1c19a82] # to [5120df6bd9c521f03437fc04e5f02ed7dc610b97] # # patch "database.cc" # from [12855c10843f0770e7ffe9138750ab18d9601c94] # to [0583790131e5fdfba09f85576942dd1c667b0623] # # patch "database.hh" # from [03747a6095f46b36c98ad383fe85b26dc2bf92c4] # to [806b33e75ca02f48aa08181ccce62f4f96aabb87] # # patch "database_check.cc" # from [e7462b630cad47cf8e0c263b293b7228d8e16392] # to [422d7a962b3bc0cb200c5e0da87105d3ad63bb93] # # patch "diff_patch.cc" # from [863137e97631b7f95879bb4baef1644d2435ec68] # to [e359a4c03c6ce548d6414dce11160fbcb6fcb831] # # patch "diff_patch.hh" # from [172cec4dd2b4e2bb80b454660910313a97cff8a7] # to [be90bd587cb2f838ce6c28326a27c3dbb950c9ab] # # patch "graph.cc" # from [2d934cb225b5639919fec3eda0cbec615cf2f903] # to [b1b4a684801c0a846062baa4d991c3a271ccf5f0] # # patch "graph.hh" # from [6384f6bd01b8b43383ba2e6adf6ae10b6f725bac] # to [9d9ffba34494fe66abde8d86fe6cc6ee1b002f62] # # patch "hybrid_map.hh" # from [fe63fa2bb750db88df486a71e1eb492839e76118] # to [c0b815591a24a6442550a32afdd54bebc8524784] # # patch "merge.cc" # from [21d74edb8e5adefa0a5f3848321003facf32a4f1] # to [5110775ef0a938c14246f95abd33a6b97118baba] # # patch "netsync.cc" # from [80b2879ab8f06fd0b93b8774b69671debba79c40] # to [664f4bc27935c3e2bafa564d99c02ea5bbbc9a47] # # patch "project.cc" # from [919ba0487836de6e7520f368e202b6e146683297] # to [49f00bd051beef2c2293ef36ab83f09c226ebe05] # # patch "rcs_import.cc" # from [b32cdb110fdf01057d6afac6b1d91263b0d74551] # to [1f4de49046aeb6d1f1b08c7677b68a6b440d45f1] # # patch "restrictions.cc" # from [a61dcdc2f5dc2eef14a0f324de21dfe53a1e1fff] # to [87c7a8736ee7c289e9de64923ef04bd8016f2801] # # patch "restrictions.hh" # from [08cc08dc32191e1f3ec2c44233a09f24d841bacb] # to [c87a3068f3c7d6ac19a2115dee07d48fc8fcab73] # # patch "revision.cc" # from [86c0d8a6aacc484acae33d7d192dcc294cbe9080] # to [8f850eef37d3e69f8abaa75bb9b07623576738ac] # # patch "revision.hh" # from [40fdeded2fc3bf25dd780a6aaa583326084b7811] # to [80779e60e01a93a50f50e5c2c3b8e291b6130831] # # patch "roster.cc" # from [5250b2f5913c0bd144a9828a1317384956729fc9] # to [e17d14033b423a0ddef95fd3b49d43011d676d1a] # # patch "roster.hh" # from [944e852bb147760f804ceb6063a1934b016d4c86] # to [0da49ea4d1bda34fe2875b0e45add9b6918f2df4] # # patch "roster_delta.cc" # from [dc0b4bc54afd8cca8a3f1364597c0f469d90eaee] # to [079b42a78a8a638a7b18624f69e4852952c9a521] # # patch "roster_delta.hh" # from [85506c111153554e2184a41cae920e4198890bfd] # to [1c64a4f5d5b9c474f5709f108357269fb2c934d9] # # patch "roster_merge.hh" # from [4e12424804e19a3ad5c353d6bbb7b0c779be4519] # to [fb803cd207c21b77a69115552a6820664b607ba5] # # patch "sanity.hh" # from [5ba1f5f71bc2a3d6c53f27bb7bbcd896d3e8155f] # to [4ba3c209ddf14a22609ec8e5b41e409551b74602] # # patch "vector.hh" # from [d89d098e94f5ef800383b9ccd0d52f9a9c8e6b66] # to [978075c1e0d5965855106d5e6a4f82518fdde041] # # patch "work.cc" # from [b082863ee52fa26b8a4e208026f63264d2448672] # to [c0fb90e7eacf1cd942f091a0e5f15e8663216117] # # patch "work.hh" # from [5811bd0a1000f0e1d30ed8df820bcd3e0bd1ba96] # to [45263b3d38c4b8772f69daaf16fd3858f5c36c8c] # # patch "work_migration.cc" # from [7b1b482621ac0a94b6e7de9a6f6e4e279e497c54] # to [39215330e16b8265ff0e3a918a8e60edc34edef9] # ============================================================ --- rev_types.hh b737aea93821772121ad0e197346a492b01ad291 +++ rev_types.hh b737aea93821772121ad0e197346a492b01ad291 @@ -0,0 +1,102 @@ +// Copyright (C) 2007 Zack Weinberg +// +// This program is made available under the GNU GPL version 2.0 or +// greater. See the accompanying file COPYING for details. +// +// This program is distributed WITHOUT ANY WARRANTY; without even the +// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. + +#ifndef __REV_TYPES_HH__ +#define __REV_TYPES_HH__ + +// This file contains forward declarations and typedefs for all of the basic +// types associated with revision handling. It should be included instead +// of (any or all of) basic_io.hh, cset.hh, graph.hh, paths.hh, revision.hh, +// roster.hh, and database.hh when all that is necessary is these +// declarations. + +#include +#include "vocab.hh" +#include "numeric_vocab.hh" +#include "hybrid_map.hh" +#include "vector.hh" + +// full definitions in basic_io.hh +namespace basic_io +{ + struct printer; + struct parser; + struct stanza; +} + +// full definitions in cset.hh +typedef std::map attr_map_t; +typedef u32 node_id; +struct cset; +struct editable_tree; + +// full definitions in graph.hh +struct rev_graph; +struct reconstruction_graph; +typedef std::vector reconstruction_path; +typedef std::multimap rev_ancestry_map; + +// full definitions in paths.hh +class any_path; +class bookkeeping_path; +class file_path; +class system_path; +class path_component; + +// full definitions in revision.hh +struct revision_t; +typedef std::map > edge_map; +typedef edge_map::value_type edge_entry; + +// full definitions in rev_height.hh +class rev_height; + +// full definitions in roster.hh +struct node_id_source; +struct node; +struct dir_node; +struct file_node; +struct marking_t; +class roster_t; +class editable_roster_base; + +typedef boost::shared_ptr node_t; +typedef boost::shared_ptr file_t; +typedef boost::shared_ptr dir_t; +typedef std::map marking_map; + +typedef std::map dir_map; +typedef hybrid_map node_map; + +// (true, "val") or (false, "") are both valid attr values (for proper +// merging, we have to widen the attr_value type to include a first-class +// "undefined" value). +typedef std::map > full_attr_map_t; + +// full definitions in database.hh +class database; +class conditional_transaction_guard; +class transaction_guard; + +typedef boost::shared_ptr roster_t_cp; +typedef boost::shared_ptr marking_map_cp; +typedef std::pair cached_roster; + +typedef std::map parent_map; +typedef parent_map::value_type parent_entry; + +#endif // __REV_TYPES_HH__ + +// Local Variables: +// mode: C++ +// fill-column: 76 +// c-file-style: "gnu" +// indent-tabs-mode: nil +// End: +// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s: ============================================================ --- Makefile.am a3c168f353f4b8067559dbf136b7eee3928d6e13 +++ Makefile.am a06ed9cd27e9377fa52ced74131e136d4202e2d4 @@ -23,7 +23,7 @@ MOST_SOURCES = \ MOST_SOURCES = \ $(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES) platform-wrapped.hh \ - mtn-sanity.cc mtn-sanity.hh ui.cc ui.hh \ + rev_types.hh mtn-sanity.cc mtn-sanity.hh ui.cc ui.hh \ app_state.cc app_state.hh \ commands.cc commands.hh $(CMD_SOURCES) \ diff_patch.cc diff_patch.hh \ ============================================================ --- annotate.cc c53402defbc6caabca1cc2af8439d6dc93b78c42 +++ annotate.cc c9bd09ef8719f801368bf0a07a09ba98afe2f38f @@ -32,6 +32,7 @@ #include "ui.hh" #include "vocab.hh" #include "rev_height.hh" +#include "roster.hh" using std::back_insert_iterator; using std::back_inserter; ============================================================ --- annotate.hh c14105693d3c6e7813adc27295e44d2134ef5502 +++ annotate.hh 1ffd0ce10fb46ba3d995e3ae5fbc1638d7462896 @@ -11,7 +11,7 @@ // PURPOSE. #include "vocab.hh" -#include "roster.hh" +#include "rev_types.hh" class project_t; ============================================================ --- asciik.cc c1b62f0e8a2347a961476756cb88d502494cfd32 +++ asciik.cc 2d6d29c25b745d4e6edf50b936260b578ba1cc25 @@ -116,6 +116,8 @@ Loop: #include "cmd.hh" #include "app_state.hh" #include "project.hh" +#include "database.hh" +#include "revision.hh" using std::insert_iterator; using std::max; ============================================================ --- asciik.hh b1c45a89506145446b33457ca62c836c9f255689 +++ asciik.hh 80f43a7385027a74cc27728be8da0bc81bab85ba @@ -1,11 +1,10 @@ #ifndef __ASCIIK_HH__ #define __ASCIIK_HH__ #include #include "vector.hh" +#include "vocab.hh" -#include "revision.hh" - class asciik { public: ============================================================ --- automate.cc b8943689152840aa05ca214dcc6240c1c4cc1386 +++ automate.cc bfcb89a183337e269f8de377876d84a1f217497a @@ -34,12 +34,15 @@ #include "packet.hh" #include "restrictions.hh" #include "revision.hh" +#include "roster.hh" #include "transforms.hh" +#include "simplestring_xform.hh" #include "vocab.hh" #include "globish.hh" #include "charset.hh" #include "safe_map.hh" #include "work.hh" +#include "database.hh" using std::allocator; using std::basic_ios; @@ -1241,7 +1244,7 @@ CMD_AUTOMATE(get_current_revision, N_("[ make_revision(old_rosters, new_roster, rev); make_restricted_revision(old_rosters, new_roster, mask, rev, - excluded, execid); + excluded, join_words(execid)); calculate_ident(rev, ident); write_revision(rev, dat); ============================================================ --- base.hh 6f10b727eb2d3f1e1c8e61223b080595ccef7b76 +++ base.hh 0d3a9bd364e4f1d791384e11074a86e29a24080c @@ -38,6 +38,8 @@ void dump(T const &, std::string &) == sizeof(T)) }; } +template <> void dump(std::string const & obj, std::string & out); + // NORETURN(void function()); declares a function that will never return // in the normal fashion. a function that invariably throws an exception // counts as NORETURN. ============================================================ --- cert.cc b9f4a223c51537671b6dbcc7814a6069244504f3 +++ cert.cc bf85ea5442652da9c33d9c8e86a433b03580d38e @@ -24,7 +24,7 @@ #include "keys.hh" #include "key_store.hh" #include "netio.hh" -#include "option.hh" +#include "options.hh" #include "project.hh" #include "revision.hh" #include "sanity.hh" ============================================================ --- cmd_db.cc 297c7ba6e5ea74edf822caf8e1acc9b113e5fd66 +++ cmd_db.cc 3ee4683a5bf823e4bd6e2fa58d530bb8855945eb @@ -16,10 +16,12 @@ #include "revision.hh" #include "constants.hh" #include "app_state.hh" +#include "database.hh" #include "project.hh" #include "keys.hh" #include "key_store.hh" #include "work.hh" +#include "rev_height.hh" using std::cin; using std::cout; ============================================================ --- cmd_diff_log.cc 1630867b9e3c4004e3f9263e861285dc7f9ad4b1 +++ cmd_diff_log.cc 5acec4dbefcd8cbf47ced5068d2cd6b7f4e5c01a @@ -26,7 +26,9 @@ #include "transforms.hh" #include "app_state.hh" #include "project.hh" +#include "database.hh" #include "work.hh" +#include "roster.hh" using std::cout; using std::deque; ============================================================ --- cmd_files.cc 40d4cb0e2464923ab8c9acd08c35cd4f257a520b +++ cmd_files.cc 8352fcfda0f5f42347c9bf384d8cd457cf06e4fe @@ -20,7 +20,9 @@ #include "transforms.hh" #include "app_state.hh" #include "project.hh" +#include "database.hh" #include "work.hh" +#include "roster.hh" using std::cout; using std::ostream_iterator; ============================================================ --- cmd_list.cc 28bfb5898869212de53955aafe7f90a22c3e909f +++ cmd_list.cc 4de1e461e891d6461f673b3708f21423ece0085b @@ -20,6 +20,7 @@ #include "cert.hh" #include "charset.hh" #include "cmd.hh" +#include "roster.hh" #include "database.hh" #include "globish.hh" #include "keys.hh" ============================================================ --- cmd_merging.cc 3678e7d84993b8c91627cec91a6957e3a3a575c9 +++ cmd_merging.cc 2c89f51225c02200a2ba3e861afb94403fa6478a @@ -28,6 +28,7 @@ #include "simplestring_xform.hh" #include "keys.hh" #include "key_store.hh" +#include "database.hh" using std::cout; using std::make_pair; @@ -246,7 +247,7 @@ CMD(update, "update", "", CMD_REF(worksp temp_node_id_source nis; // Get the OLD and WORKING rosters - database::roster_t_cp old_roster + roster_t_cp old_roster = parent_cached_roster(parents.begin()).first; MM(*old_roster); @@ -676,7 +677,7 @@ CMD(merge_into_workspace, "merge_into_wo options::opts::none) { revision_id left_id, right_id; - database::cached_roster left, right; + cached_roster left, right; shared_ptr working_roster = shared_ptr(new roster_t()); if (args.size() != 1) @@ -733,7 +734,7 @@ CMD(merge_into_workspace, "merge_into_wo merge_result); revision_id lca_id; - database::cached_roster lca; + cached_roster lca; find_common_ancestor_for_merge(db, left_id, right_id, lca_id); db.get_roster(lca_id, lca); ============================================================ --- cmd_netsync.cc 3faa92d18fdbcb4c2bf5d38d343ee196f9a69334 +++ cmd_netsync.cc 56cd0fe69f28349a46fcd1b19acc0df610c7f011 @@ -15,6 +15,8 @@ #include "app_state.hh" #include "project.hh" #include "work.hh" +#include "database.hh" +#include "roster.hh" #include ============================================================ --- cmd_ws_commit.cc d37dc1b666e1ac37175dde775b48a24c0ff0cefa +++ cmd_ws_commit.cc 273085e0ae7815df69f24d0360421fe14eaef81b @@ -25,6 +25,9 @@ #include "basic_io.hh" #include "keys.hh" #include "key_store.hh" +#include "simplestring_xform.hh" +#include "database.hh" +#include "roster.hh" using std::cout; using std::make_pair; @@ -1092,7 +1095,7 @@ CMD(commit, "commit", "ci", CMD_REF(work work.update_current_roster_from_filesystem(new_roster, mask); make_restricted_revision(old_rosters, new_roster, mask, restricted_rev, - excluded, execid); + excluded, join_words(execid)); restricted_rev.check_sane(); N(restricted_rev.is_nontrivial(), F("no changes to commit")); ============================================================ --- cset.hh d76a7276730c9649ea326745abfd0d2be1c19a82 +++ cset.hh 5120df6bd9c521f03437fc04e5f02ed7dc610b97 @@ -10,23 +10,14 @@ // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. -#include #include -#include "vector.hh" - -#include "numeric_vocab.hh" #include "paths.hh" -#include "vocab.hh" -#include "sanity.hh" +#include "rev_types.hh" -typedef std::map attr_map_t; - // Virtual interface to a tree-of-files which you can edit // destructively; this may be the filesystem or an in-memory // representation (a roster / mfest). -typedef u32 node_id; - struct editable_tree { // Detaching existing nodes (for renaming or deleting) @@ -110,9 +101,6 @@ delta_entry_dst(std::mapsecond.second; } - -namespace basic_io { struct printer; struct parser; } - void print_cset(basic_io::printer & printer, cset const & cs); ============================================================ --- database.cc 12855c10843f0770e7ffe9138750ab18d9601c94 +++ database.cc 0583790131e5fdfba09f85576942dd1c667b0623 @@ -44,6 +44,7 @@ #include "xdelta.hh" #include "epoch.hh" #include "graph.hh" +#include "roster.hh" #include "roster_delta.hh" #include "rev_height.hh" #include "vocab_hash.hh" @@ -153,7 +154,7 @@ namespace struct roster_size_estimator { - unsigned long operator() (database::cached_roster const & cr) + unsigned long operator() (cached_roster const & cr) { I(cr.first); I(cr.second); @@ -246,9 +247,9 @@ private: { database_impl & imp; roster_writeback_manager(database_impl & imp) : imp(imp) {} - void writeout(revision_id const &, database::cached_roster const &); + void writeout(revision_id const &, cached_roster const &); }; - LRUWritebackCache roster_cache; @@ -1236,7 +1237,7 @@ database_impl::roster_writeback_manager: void database_impl::roster_writeback_manager::writeout(revision_id const & id, - database::cached_roster const & cr) + cached_roster const & cr) { I(cr.first); I(cr.second); @@ -1444,7 +1445,7 @@ database_impl::get_roster_base(string co revision_id ident(ident_str); if (roster_cache.exists(ident)) { - database::cached_roster cr; + cached_roster cr; roster_cache.fetch(ident, cr); I(cr.first); roster = *(cr.first); @@ -3486,15 +3487,14 @@ database::get_roster(revision_id const & return; } - database::cached_roster cr; + cached_roster cr; get_roster(rev_id, cr); roster = *cr.first; marking = *cr.second; } void -database::get_roster(revision_id const & rev_id, - database::cached_roster & cr) +database::get_roster(revision_id const & rev_id, cached_roster & cr) { get_roster_version(rev_id, cr); I(cr.first); @@ -3529,7 +3529,7 @@ database::put_roster(revision_id const & revision_id old_rev = *i; if (imp->roster_base_stored(old_rev)) { - database::cached_roster cr; + cached_roster cr; get_roster_version(old_rev, cr); roster_delta reverse_delta; delta_rosters(*roster, *marking, *(cr.first), *(cr.second), reverse_delta); ============================================================ --- database.hh 03747a6095f46b36c98ad383fe85b26dc2bf92c4 +++ database.hh 806b33e75ca02f48aa08181ccce62f4f96aabb87 @@ -12,12 +12,8 @@ #include "vector.hh" #include -#include #include - -#include "vocab.hh" -#include "roster.hh" -#include "graph.hh" +#include "rev_types.hh" #include "cert.hh" class app_state; @@ -27,8 +23,6 @@ class rev_height; class key_store; class outdated_indicator; class rev_height; -struct revision_t; -class conditional_transaction_guard; // this file defines a public, typed interface to the database. // the database class encapsulates all knowledge about sqlite, @@ -97,15 +91,6 @@ private: friend class conditional_transaction_guard; // - // --== Write-buffering -- tied into transaction ==-- - // --== machinery and delta compression machinery ==-- - // -public: - typedef boost::shared_ptr roster_t_cp; - typedef boost::shared_ptr marking_map_cp; - typedef std::pair cached_roster; - - // // --== Reading/writing delta-compressed objects ==-- // public: @@ -451,12 +436,7 @@ void check_db(database & db); // Parent maps are used in a number of places to keep track of all the // parent rosters of a given revision. -typedef std::map -parent_map; -typedef parent_map::value_type -parent_entry; - inline revision_id const & parent_id(parent_entry const & p) { return p.first; @@ -467,13 +447,13 @@ inline revision_id const & parent_id(par return i->first; } -inline database::cached_roster const & +inline cached_roster const & parent_cached_roster(parent_entry const & p) { return p.second; } -inline database::cached_roster const & +inline cached_roster const & parent_cached_roster(parent_map::const_iterator i) { return i->second; ============================================================ --- database_check.cc e7462b630cad47cf8e0c263b293b7228d8e16392 +++ database_check.cc 422d7a962b3bc0cb200c5e0da87105d3ad63bb93 @@ -19,6 +19,7 @@ #include "transforms.hh" #include "cert.hh" #include "rev_height.hh" +#include "roster.hh" #include "outdated_indicator.hh" // the database has roughly the following structure ============================================================ --- diff_patch.cc 863137e97631b7f95879bb4baef1644d2435ec68 +++ diff_patch.cc e359a4c03c6ce548d6414dce11160fbcb6fcb831 @@ -30,6 +30,7 @@ #include "file_io.hh" #include "pcrewrap.hh" #include "lua_hooks.hh" +#include "database.hh" using std::make_pair; using std::map; @@ -539,7 +540,7 @@ load_and_cache_roster(database & db, rev rout = i->second; else { - database::cached_roster cr; + cached_roster cr; db.get_roster(rid, cr); safe_insert(rmap, make_pair(rid, cr.first)); rout = cr.first; ============================================================ --- diff_patch.hh 172cec4dd2b4e2bb80b454660910313a97cff8a7 +++ diff_patch.hh be90bd587cb2f838ce6c28326a27c3dbb950c9ab @@ -10,14 +10,8 @@ // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. -#include "vocab.hh" -#include "roster.hh" +#include "rev_types.hh" -#include - -#include -#include "vector.hh" - class database; class lua_hooks; ============================================================ --- graph.cc 2d934cb225b5639919fec3eda0cbec615cf2f903 +++ graph.cc b1b4a684801c0a846062baa4d991c3a271ccf5f0 @@ -10,6 +10,7 @@ #include "numeric_vocab.hh" #include "hash_map.hh" #include "vocab_hash.hh" +#include "rev_height.hh" using boost::shared_ptr; using std::string; ============================================================ --- graph.hh 6384f6bd01b8b43383ba2e6adf6ae10b6f725bac +++ graph.hh 9d9ffba34494fe66abde8d86fe6cc6ee1b002f62 @@ -20,10 +20,8 @@ #include #include "vector.hh" #include +#include "rev_types.hh" -#include "vocab.hh" -#include "rev_height.hh" - struct reconstruction_graph { virtual bool is_base(std::string const & node) const = 0; @@ -31,15 +29,11 @@ struct reconstruction_graph virtual ~reconstruction_graph() {}; }; -typedef std::vector reconstruction_path; - void get_reconstruction_path(std::string const & start, reconstruction_graph const & graph, reconstruction_path & path); -typedef std::multimap rev_ancestry_map; - void toposort_rev_ancestry(rev_ancestry_map const & graph, std::vector & revisions); ============================================================ --- hybrid_map.hh fe63fa2bb750db88df486a71e1eb492839e76118 +++ hybrid_map.hh c0b815591a24a6442550a32afdd54bebc8524784 @@ -10,7 +10,7 @@ // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. - +#include "sanity.hh" #include "hash_map.hh" #include ============================================================ --- merge.cc 21d74edb8e5adefa0a5f3848321003facf32a4f1 +++ merge.cc 5110775ef0a938c14246f95abd33a6b97118baba @@ -18,6 +18,7 @@ #include "roster_merge.hh" #include "safe_map.hh" #include "transforms.hh" +#include "database.hh" using std::make_pair; using std::map; ============================================================ --- netsync.cc 80b2879ab8f06fd0b93b8774b69671debba79c40 +++ netsync.cc 664f4bc27935c3e2bafa564d99c02ea5bbbc9a47 @@ -25,6 +25,7 @@ #include "lua_hooks.hh" #include "key_store.hh" #include "project.hh" +#include "database.hh" #include "cert.hh" #include "constants.hh" #include "enumerator.hh" @@ -45,6 +46,7 @@ #include "hmac.hh" #include "globish.hh" #include "uri.hh" +#include "options.hh" #include "botan/botan.h" ============================================================ --- project.cc 919ba0487836de6e7520f368e202b6e146683297 +++ project.cc 49f00bd051beef2c2293ef36ab83f09c226ebe05 @@ -11,6 +11,7 @@ #include "transforms.hh" #include "lua_hooks.hh" #include "keys.hh" +#include "options.hh" using std::string; using std::set; ============================================================ --- rcs_import.cc b32cdb110fdf01057d6afac6b1d91263b0d74551 +++ rcs_import.cc 1f4de49046aeb6d1f1b08c7677b68a6b440d45f1 @@ -40,6 +40,7 @@ #include "sanity.hh" #include "transforms.hh" #include "ui.hh" +#include "roster.hh" using std::make_pair; using std::map; ============================================================ --- restrictions.cc a61dcdc2f5dc2eef14a0f324de21dfe53a1e1fff +++ restrictions.cc 87c7a8736ee7c289e9de64923ef04bd8016f2801 @@ -10,14 +10,13 @@ #include "base.hh" #include "safe_map.hh" #include "vector.hh" - #include "restrictions.hh" #include "file_io.hh" +#include "roster.hh" +#include "database.hh" // for parent_roster #ifdef BUILD_UNIT_TESTS # include "unit_tests.hh" -# include "roster.hh" -# include "sanity.hh" #else # include "work.hh" #endif ============================================================ --- restrictions.hh 08cc08dc32191e1f3ec2c44233a09f24d841bacb +++ restrictions.hh c87a3068f3c7d6ac19a2115dee07d48fc8fcab73 @@ -27,8 +27,9 @@ // (commit and revert) to be "tested" first with non-destructive commands // (ls unknown/ignored/missing/known, status, diff) +#include #include "vocab.hh" -#include "database.hh" // for parent_map +#include "rev_types.hh" class workspace; ============================================================ --- revision.cc 86c0d8a6aacc484acae33d7d192dcc294cbe9080 +++ revision.cc 8f850eef37d3e69f8abaa75bb9b07623576738ac @@ -41,6 +41,9 @@ #include "legacy.hh" #include "rev_height.hh" #include "outdated_indicator.hh" +#include "database.hh" +#include "roster.hh" +#include "graph.hh" using std::back_inserter; using std::copy; @@ -733,7 +736,7 @@ make_restricted_revision(parent_map cons node_restriction const & mask, revision_t & rev, cset & excluded, - commands::command_id const & cmd_name) + utf8 const & cmd_name) { edge_map edges; bool no_excludes = true; @@ -755,7 +758,7 @@ make_restricted_revision(parent_map cons N(old_rosters.size() == 1 || no_excludes, F("the command '%s %s' cannot be restricted in a two-parent workspace") - % ui.prog_name % join_words(cmd_name)()); + % ui.prog_name % cmd_name); recalculate_manifest_id_for_restricted_rev(old_rosters, edges, rev); } ============================================================ --- revision.hh 40fdeded2fc3bf25dd780a6aaa583326084b7811 +++ revision.hh 80779e60e01a93a50f50e5c2c3b8e291b6130831 @@ -11,15 +11,13 @@ // PURPOSE. #include -#include +#include "vector.hh" +#include "rev_types.hh" -#include +class key_store; +class node_restriction; +class path_restriction; -#include "cset.hh" -#include "vocab.hh" -#include "database.hh" -#include "commands.hh" - // a revision is a text object. It has a precise, normalizable serial form // as UTF-8 text. it also has some sub-components. not all of these // sub-components are separately serialized (they could be but there is no @@ -46,12 +44,6 @@ // from [95b50ede90037557fd0fbbfad6a9fdd67b0bf413] // to [bd39086b9da776fc22abd45734836e8afb59c8c0] -typedef std::map > -edge_map; - -typedef edge_map::value_type -edge_entry; - enum made_for { made_for_nobody, made_for_workspace, made_for_database }; struct @@ -215,7 +207,7 @@ make_restricted_revision(parent_map cons node_restriction const & mask, revision_t & rev, cset & excluded, - commands::command_id const & cmd_name); + utf8 const & cmd_name); void build_changesets_from_manifest_ancestry(database & db, key_store & keys, @@ -229,9 +221,6 @@ regenerate_caches(database & db); regenerate_caches(database & db); // basic_io access to printers and parsers - -namespace basic_io { struct printer; struct parser; } - void print_revision(basic_io::printer & printer, revision_t const & rev); ============================================================ --- roster.cc 5250b2f5913c0bd144a9828a1317384956729fc9 +++ roster.cc e17d14033b423a0ddef95fd3b49d43011d676d1a @@ -1897,7 +1897,7 @@ namespace { cset const & right_cs = edge_changes(i); I(!null_id(left_rid) && !null_id(right_rid)); - database::cached_roster left_cached, right_cached; + cached_roster left_cached, right_cached; db.get_roster(left_rid, left_cached); db.get_roster(right_rid, right_cached); ============================================================ --- roster.hh 944e852bb147760f804ceb6063a1934b016d4c86 +++ roster.hh 0da49ea4d1bda34fe2875b0e45add9b6918f2df4 @@ -10,18 +10,11 @@ // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. -#include - -#include - -#include "cset.hh" #include "hybrid_map.hh" -#include "numeric_vocab.hh" #include "paths.hh" -#include "sanity.hh" +#include "rev_types.hh" +#include "cset.hh" // need full definition of editable_tree -#include "vocab.hh" - struct node_id_source { virtual node_id next() = 0; @@ -30,13 +23,6 @@ struct node_id_source /////////////////////////////////////////////////////////////////// -struct node; -struct dir_node; -struct file_node; -typedef boost::shared_ptr node_t; -typedef boost::shared_ptr file_t; -typedef boost::shared_ptr dir_t; - node_id const the_null_node = 0; inline bool @@ -45,18 +31,9 @@ null_node(node_id n) return n == the_null_node; } - -// (true, "val") or (false, "") are both valid attr values (for proper -// merging, we have to widen the attr_value type to include a first-class -// "undefined" value). -typedef std::map > full_attr_map_t; -typedef std::map dir_map; -typedef hybrid_map node_map; - template <> void dump(node_id const & val, std::string & out); template <> void dump(full_attr_map_t const & val, std::string & out); - struct node { node(); @@ -166,14 +143,10 @@ struct marking_t } }; -typedef std::map marking_map; - template <> void dump(std::set const & revids, std::string & out); template <> void dump(marking_t const & marking, std::string & out); template <> void dump(marking_map const & marking_map, std::string & out); -namespace basic_io { struct printer; struct parser; } - class roster_t { public: @@ -322,9 +295,6 @@ template <> void dump(roster_t const & v template <> void dump(roster_t const & val, std::string & out); -class database; -struct revision_t; - // adaptor class to enable cset application on rosters. class editable_roster_base : public editable_tree @@ -441,12 +411,6 @@ void calculate_ident(roster_t const & ro void calculate_ident(roster_t const & ros, manifest_id & ident); -namespace basic_io -{ - struct stanza; - struct parser; -} - // for roster_delta void push_marking(basic_io::stanza & st, bool is_file, marking_t const & mark); void parse_marking(basic_io::parser & pa, marking_t & marking); ============================================================ --- roster_delta.cc dc0b4bc54afd8cca8a3f1364597c0f469d90eaee +++ roster_delta.cc 079b42a78a8a638a7b18624f69e4852952c9a521 @@ -18,6 +18,7 @@ #include "safe_map.hh" #include "parallel_iter.hh" +#include "roster.hh" #include "roster_delta.hh" #include "basic_io.hh" #include "paths.hh" ============================================================ --- roster_delta.hh 85506c111153554e2184a41cae920e4198890bfd +++ roster_delta.hh 1c64a4f5d5b9c474f5709f108357269fb2c934d9 @@ -12,8 +12,7 @@ // This file contains "diff"/"patch" code that operates directly on rosters // (with their associated markings). -#include "vocab.hh" -#include "roster.hh" +#include "rev_types.hh" void delta_rosters(roster_t const & from, marking_map const & from_markings, ============================================================ --- roster_merge.hh 4e12424804e19a3ad5c353d6bbb7b0c779be4519 +++ roster_merge.hh fb803cd207c21b77a69115552a6820664b607ba5 @@ -10,10 +10,9 @@ // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. +#include "rev_types.hh" #include "diff_patch.hh" -#include "vocab.hh" -#include "roster.hh" -#include "sanity.hh" +#include "roster.hh" // needs full definition of roster_t available // interactions between conflict types: // node rename conflicts never participate in structural conflicts ============================================================ --- sanity.hh 5ba1f5f71bc2a3d6c53f27bb7bbcd896d3e8155f +++ sanity.hh 4ba3c209ddf14a22609ec8e5b41e409551b74602 @@ -12,7 +12,6 @@ #include #include -#include #include "boost/current_function.hpp" @@ -431,23 +430,6 @@ Musing::gasp(std::string & out) const #define PERM_MM(obj) /* */ #endif -template -void dump(T const &, std::string &); - -template <> void dump(std::string const & obj, std::string & out); - -template void -dump(std::vector const & vec, std::string & out) -{ - for (size_t i = 0; i < vec.size(); ++i) - { - T const & val = vec[i]; - std::string msg; - dump(val, msg); - out += msg; - } -}; - // debugging utility to dump out vars like MM but without requiring a crash extern void print_var(std::string const & value, ============================================================ --- vector.hh d89d098e94f5ef800383b9ccd0d52f9a9c8e6b66 +++ vector.hh 978075c1e0d5965855106d5e6a4f82518fdde041 @@ -79,6 +79,18 @@ inline T const & checked_index(std::vect #define idx(v, i) checked_index((v), (i), #v, #i, __FILE__, __LINE__) +template void +dump(std::vector const & vec, std::string & out) +{ + for (size_t i = 0; i < vec.size(); ++i) + { + T const & val = vec[i]; + std::string msg; + dump(val, msg); + out += msg; + } +}; + // Local Variables: // mode: C++ // c-file-style: "gnu" ============================================================ --- work.cc b082863ee52fa26b8a4e208026f63264d2448672 +++ work.cc c0fb90e7eacf1cd942f091a0e5f15e8663216117 @@ -31,6 +31,8 @@ #include "ui.hh" #include "charset.hh" #include "app_state.hh" +#include "database.hh" +#include "roster.hh" using std::deque; using std::exception; @@ -218,7 +220,7 @@ get_roster_for_rid(database & db, static void get_roster_for_rid(database & db, revision_id const & rid, - database::cached_roster & cr) + cached_roster & cr) { // We may be asked for a roster corresponding to the null rid, which // is not in the database. In this situation, what is wanted is an empty @@ -247,7 +249,7 @@ workspace::get_parent_rosters(database & for (edge_map::const_iterator i = rev.edges.begin(); i != rev.edges.end(); i++) { - database::cached_roster cr; + cached_roster cr; get_roster_for_rid(db, edge_old_revision(i), cr); safe_insert(parents, make_pair(edge_old_revision(i), cr)); } ============================================================ --- work.hh 5811bd0a1000f0e1d30ed8df820bcd3e0bd1ba96 +++ work.hh 45263b3d38c4b8772f69daaf16fd3858f5c36c8c @@ -11,16 +11,16 @@ // PURPOSE. #include -#include "vector.hh" -#include "vocab.hh" #include "paths.hh" -#include "database.hh" +#include "rev_types.hh" class path_restriction; class node_restriction; struct content_merge_adaptor; class lua_hooks; class i18n_format; +struct options; +class app_state; // // this file defines structures to deal with the "workspace" of a tree ============================================================ --- work_migration.cc 7b1b482621ac0a94b6e7de9a6f6e4e279e497c54 +++ work_migration.cc 39215330e16b8265ff0e3a918a8e60edc34edef9 @@ -10,6 +10,7 @@ #include "base.hh" #include "sanity.hh" #include "ui.hh" +#include "cset.hh" #include "simplestring_xform.hh" #include "revision.hh" #include "file_io.hh"