# # # patch "AUTHORS" # from [b8056b4cefa9663455b5c7cf8bc9e17ce249b253] # to [f7ac1c3e3631e448e2036a8072e244947c86f01c] # # patch "ChangeLog" # from [3259087552320f52656e41144bf2226084610a25] # to [9f676dadd9a7c1c702cabea26cfc3210d1e22726] # # patch "annotate.cc" # from [f77b679344341a4af199df9b59efd49b4676a6af] # to [7655d63779fde07e30bbd6b2b4a5c74378175a5d] # # patch "annotate.hh" # from [fa08bd0d934bb739c0ac61726c9c6b698605ad9f] # to [2c21ed973503781e799cb80b18ea83a3398010d1] # # patch "app_state.cc" # from [2af59d84eedf016fb3ad85d1c0e76667070d2fc6] # to [624fa50ae7e30fd72155297dcc5954aa66e2d0b5] # # patch "app_state.hh" # from [93a467f82e48fc13684a3796f0c93b6922a56842] # to [1e1011728a2da0db22589ac19fe9de5b00d08680] # # patch "automate.cc" # from [b8757225e1989f6a7d491e7442152445afb579e1] # to [fb597bb9483f7531adbb6e2501188d74063bf60a] # # patch "automate.hh" # from [50a099fbae11d18d8020c40813ede340f9005f54] # to [a1c69c33629b9173de51c3c4a5c5b84302c82c7f] # # patch "basic_io.cc" # from [0cd7c3eb2d37b603a49cab9959f582bcc4fb661f] # to [d7e7798e323fe76518a577010d4eef1f7639a0b1] # # patch "basic_io.hh" # from [2f590c89a77dd2c425ecc8ce5a0922124f120284] # to [c40999a46e70901ea3964b4c378d8cb368437dd2] # # patch "cert.cc" # from [d568dcf9cbf42901fbc3aec941fb6111004a74e4] # to [6e1ffc5b990cf82e6ee2a7d1492127b2f71aa105] # # patch "charset.cc" # from [c958f957b5deca18a5803c512ae5cf58d08b5fb1] # to [3813493b3cd605cb0fb39306a10d11a2b115ae82] # # patch "cmd_diff_log.cc" # from [6b49be84ff5e47f22c1942927ea41ab7c24da386] # to [c2d375111f402eac0c82134f174627d88608dcb0] # # patch "cmd_merging.cc" # from [14dbf8776d68cf092e76c4d7479afaafd24e4705] # to [f3c3f2b70f29de1634b9fcd300ddfaeba0b2fe79] # # patch "cmd_ws_commit.cc" # from [159a7abbffa9e3992f5a3dba2af148de388e1f53] # to [69cca94b132fd71d62be2a05e303d14a6b68b65e] # # patch "configure.ac" # from [d341e69d700975ab4f573f5a1847c68fb16f841e] # to [824721ae0b37ed846b0240a912e197eb69d4bd23] # # patch "database.cc" # from [0d25c2fa019f20eb0b7299f2b569a4091571aed1] # to [243ed549122fd7494a7cd43535d2f8b480743c07] # # patch "file_io.cc" # from [f2ae5cfeb4c6e7ac273fb6d11ad8f18f48ce6222] # to [7c50a2a9534b3e6a0f0f876f785b5a638d419f95] # # patch "file_io.hh" # from [36dc8411e9bf01109fc5f42d7ece84c2f7a03635] # to [a20a0decf624fa58359aff924770e5199d60767f] # # patch "lcs.cc" # from [6c1c76404a788927308bff3b8f52d52f8ae1c12a] # to [11c987c3b32ff3c1c860030dc298b5a5547fc2fa] # # patch "lua.cc" # from [06e4a9aeca73e87a2617ff8df2d674646bf2cb8e] # to [510492e0a3d30022cff1fcf325ddf6de32a899f4] # # patch "netcmd.cc" # from [8fa03553a30d87ff442de0d38e0e3042211c6f08] # to [bd6ee0d97bdb27879e1d8342d6bc64899a6971e7] # # patch "pch.hh" # from [d907c0f5e974b97e595f43f5d65abc65af76732a] # to [99ec41067206a464d4793fe917599f5d51882839] # # patch "sanity.cc" # from [eb02236fb3eb72ac83d3b4a30cadad147aec9895] # to [5a79c408881d20bbe1df1081c51dfedf49bd8824] # # patch "sanity.hh" # from [3a383c56e35f90f08f81b3362f448521ad06904a] # to [e56bf6cd3f576b4ce4ebb9937f4fdaa4ece13367] # # patch "ui.hh" # from [ffdc426cb8a9a6de1b8a7a09317df1fbb62f77ef] # to [0f806f7ebf686e12e5a67297b39ffeb030abe2dc] # # patch "unix/get_system_flavour.cc" # from [cbbb43edbaf647bf4005887684a98c94633d2cfb] # to [3c68d38211c3c7f8c6e06eee7d9fbce40497b2fc] # # patch "xdelta.cc" # from [d884013d3dc309f7dfa6f3d4541adb2ba3ef981e] # to [8953f76da8baf0622a089c476f8680bccbf43ac6] # ============================================================ --- AUTHORS b8056b4cefa9663455b5c7cf8bc9e17ce249b253 +++ AUTHORS f7ac1c3e3631e448e2036a8072e244947c86f01c @@ -1,13 +1,15 @@ main files: ----------- -Graydon Hoare originally wrote *.{lua,sql,cc,hh} -in the top level directory. That's me. +Graydon Hoare originally wrote most of the files +*.{lua,sql,cc,hh} in the top level directory. That's me. -Two exceptions are the file main.cc, which is a slightly reworked copy -of execution_monitor.cc from the boost project; and the file -mkstemp.cc, which is a slightly reworked copy of mkstemp code from -glib. In both cases I've noted the original copyrights in the files. +Three exceptions are the file main.cc, which is a slightly reworked +copy of execution_monitor.cc from the boost project; the file +lru_cache.h, which is a slightly modified copy of a file from Patrick +Audley, and the file mkstemp.cc, which is a slightly reworked copy of +mkstemp code from glib. In both cases I've noted the original +copyrights in the files. Another possible exception -- depending on how you interpret the word "wrote" -- is the file lcs.hh, which I did write, but the writing was ============================================================ --- ChangeLog 3259087552320f52656e41144bf2226084610a25 +++ ChangeLog 9f676dadd9a7c1c702cabea26cfc3210d1e22726 @@ -1,3 +1,24 @@ +2006-05-28 Graydon Hoare + + * AUTHORS: Minor touchups. + * ChangeLog: Fix capitalization. + * annotate.{cc,hh}: + * app_state.{cc,hh}: + * automate.{cc,hh}: + * lcs.cc: + * basic_io.{cc,hh}: Cosmetic and copyright fixes. + * configure.ac: Permit PCH for 4.* not 4.0*. + * cert.cc: + * charset.cc: + * cmd_diff_log.cc: + * cmd_merging.cc: + * cmd_ws_commit.cc: + * database.cc: + * ui.hh: + * unix/get_system_flavour.cc: + * xdelta.cc: Purge boost::format uses. + * sanity.{cc,hh}: Hide boost::format in pimpl. + 2006-05-28 Matt Johnston * std_hooks.lua (get_netsync_connect_command): quote patterns @@ -3535,7 +3556,7 @@ choices and moves them on to running a dedicated server. Other small tweaks in nearby sections while here. -2005-12-18 graydon hoare +2005-12-18 Graydon Hoare * AUTHORS: Add Roland. @@ -3886,19 +3907,19 @@ assume that the address of a newly allocated Buffer will always be greated than existing Buffers). -2005-11-25 graydon hoare +2005-11-25 Graydon Hoare * database.cc (get_version): Another important fix: make sure to cancel overlapping paths, to avoid exponential memory requirement in deep, heavily-forked-and-merged storage paths. -2005-11-25 graydon hoare +2005-11-25 Graydon Hoare * database.cc (get_version): Another important fix: make sure to cancel overlapping paths, to avoid exponential memory requirement in deep, heavily-forked-and-merged storage paths. -2005-11-25 graydon hoare +2005-11-25 Graydon Hoare * database.cc (get_version): Crucial fix! Rewrite the delta-reconstruction algorithm to work with a DAG storage topology, @@ -6836,7 +6857,7 @@ (get_preferred_merge3_command): Provide more information on how to use vim as merge tool. -2005-08-03 graydon hoare +2005-08-03 Graydon Hoare * unix/process.cc (make_executable): Fix race, set user/group/other. @@ -7327,7 +7348,7 @@ * tests/t_restricted_diff_unchanged.at: New test. * testsuite.at: Add it. -2005-07-13 graydon hoare +2005-07-13 Graydon Hoare * rcs_import.cc (cvs_branch::cvs_branch): Initialize bools to false. @@ -7341,7 +7362,7 @@ tests. * testsuite.at: Add them. -2005-07-11 graydon hoare +2005-07-11 Graydon Hoare * AUTHORS: Add Jordan. * commands.cc (ls_tags): Do not uniquify tags. @@ -7674,17 +7695,17 @@ merkle_tree.hh, monotone.cc, netcmd.cc, netsync.cc, netxx/osutil.h, packet.cc: Namespace and include file cleanup. -2005-06-29 graydon hoare +2005-06-29 Graydon Hoare * tests/t_cvsimport_drepper2.at: New test. * testsuite.at: Call it. -2005-06-23 graydon hoare +2005-06-23 Graydon Hoare * rcs_import.cc (import_cvs_repo): Put branch imports inside transaction blocks, add a couple tickers. -2005-06-22 graydon hoare +2005-06-22 Graydon Hoare * rcs_file.cc: Track file:line numbers, accept files which violate some lies in rcs file format. @@ -7697,12 +7718,12 @@ (import_branch) (import_cvs_repo): Support non-branch tags. -2005-06-21 graydon hoare +2005-06-21 Graydon Hoare * rcs_import.{cc,hh} (import_rcs_file): Rename to test_parse_rcs_file. * commands.cc (rcs_import): rename call. -2005-06-19 graydon hoare +2005-06-19 Graydon Hoare * rcs_import.cc: Rewrite change set inference logic. @@ -8234,7 +8255,7 @@ * tests/t_restricted_commit_with_inodeprints.at: new bug reports * testsuite.at: call them -2005-06-04 graydon hoare +2005-06-04 Graydon Hoare * rcs_import.cc (note_state_at_branch_beginning): Move time back when @@ -8248,7 +8269,7 @@ * contrib/monotone.zsh_completion: use verbose output when completing revisions -2005-06-02 graydon hoare +2005-06-02 Graydon Hoare * rcs_import.cc (cvs_key::is_synthetic_branch_founding_commit): New field. @@ -8658,12 +8679,12 @@ * monotone.texi (Network): Document 'serve' as taking more than one collection argument. -2005-05-15 graydon hoare +2005-05-15 Graydon Hoare * rcs_import.cc (note_state_at_branch_beginning): collect branch beginning states into a single synthetic commit. -2005-05-15 graydon hoare +2005-05-15 Graydon Hoare * rcs_import.cc: rewrite most of the branch logic to address issues raised in bugs 13032 and 13063. @@ -11610,7 +11631,7 @@ * revision.cc (struct anc_graph): Fixup after merge. -2005-02-18 graydon hoare +2005-02-18 Graydon Hoare * database.cc (set_epoch): Fix SQL. * monotone.texi (Rebuilding ancestry): Reword a bit. @@ -11628,7 +11649,7 @@ * monotone.texi: Document db rebuild. Add section on rebuilding ancestry and epochs. -2005-02-06 graydon hoare +2005-02-06 Graydon Hoare * commands.cc (db): Add epoch commands. (list): Likewise. @@ -12115,13 +12136,13 @@ * configure.ac: Improve Boost detection by trying several possible library suffixes before aborting. -2005-02-18 graydon hoare +2005-02-18 Graydon Hoare * change_set.cc (apply_change_set): Avoid fast path when there are adds. (apply_path_rearrangement): Likewise. -2005-02-18 graydon hoare +2005-02-18 Graydon Hoare * automate.cc (automate_heads): Fix initialize() call. * change_set.{cc,hh} @@ -12139,11 +12160,11 @@ * xdelta.cc (compute_delta_insns): Correct 1-byte-source bug. -2005-02-18 graydon hoare +2005-02-18 Graydon Hoare * Makefile.am (MOST_SOURCES): Add smap.hh. -2005-02-18 graydon hoare +2005-02-18 Graydon Hoare * basic_io.{cc,hh}: Inline some stuff. * change_set.cc: Use smap various places, reduce to 32-bit tids. @@ -12314,7 +12335,7 @@ conventions for database management following question on mailing list. -2005-02-12 graydon hoare +2005-02-12 Graydon Hoare * change_set.{cc,hh}: Correct code to pass newly-added unit tests. @@ -12332,7 +12353,7 @@ diffs * monotone.texi: update for restrictions -2005-02-08 graydon hoare +2005-02-08 Graydon Hoare * database.cc (version_cache::set): Fix bad expiry logic. @@ -12351,7 +12372,7 @@ * change_set.cc: Add a few more invariants; add lots and lots of unit tests. -2005-02-06 graydon hoare +2005-02-06 Graydon Hoare * change_set.cc: Use hash_map in a few places. (confirm_unique_entries_in_directories): Fix invariants. @@ -12477,7 +12498,7 @@ * work.hh: Remove tabs. -2005-02-03 graydon hoare +2005-02-03 Graydon Hoare * tests/t_i18n_changelog.at: New test. * testsuite.at: Run it. @@ -12502,7 +12523,7 @@ manifest. * revision.cc (check_sane): More invariants. -2005-01-28 graydon hoare +2005-01-28 Graydon Hoare * database.{cc,hh}: More netsync speed tweaks. * netsync.cc: Likewise. @@ -12551,7 +12572,7 @@ suffixes * botan/{gzip.cpp}: fix type for std::max() comparison -2005-01-27 graydon hoare +2005-01-27 Graydon Hoare * AUTHORS: Mention Georg. * change_set.cc: Null out names which are in null directories. @@ -12773,7 +12794,7 @@ Alter logic to yell if a rename crosses the restriction boundary, rather than silently ignore it. -2005-01-19 graydon hoare +2005-01-19 Graydon Hoare * commands.cc: Fix up some merge breakage. * tests/t_add_dot.at: Un-XFAIL. @@ -12999,7 +13020,7 @@ * tests/t_status_missing.at: new test * testsuite.at: include it -2005-01-10 graydon hoare +2005-01-10 Graydon Hoare * commands.cc (explicit_merge): Tweak merge message. * database.cc (check_sqlite_format_version): New function. @@ -13020,7 +13041,7 @@ for optimization. This also does not change the schema (i.e. still uses base64 encoded values in tables) -2005-01-17 graydon hoare +2005-01-17 Graydon Hoare * AUTHORS: Mention Wojciech and Neil. * revision.cc (calculate_ancestors_from_graph): Make non-recursive. @@ -13040,7 +13061,7 @@ using the same directory name as the branch name, unless a branch is specified. -2005-01-17 graydon hoare +2005-01-17 Graydon Hoare * cryptopp/osrng.cpp (NonblockingRng::GenerateBlock): Bring forward patch lost in cryptopp 5.2 upgrade. @@ -13077,7 +13098,7 @@ * tests/t_status_missing.at: new test * testsuite.at: include it -2005-01-10 graydon hoare +2005-01-10 Graydon Hoare * commands.cc (explicit_merge): Tweak merge message. * database.cc (check_sqlite_format_version): New function. @@ -13231,14 +13252,14 @@ * botan/{aes,des,dh,dsa,elgamal,lion,lubyrack,nr,rw,openpgp}*: removed unused files. -2004-12-30 graydon hoare +2004-12-30 Graydon Hoare * constants.cc (netcmd_current_protocol_version): Set to 3. * tests/t_crlf.at: New test of crlf line encodings. * testsuite.at: Call it. * monotone.spec: Note 0.16 release. -2004-12-30 graydon hoare +2004-12-30 Graydon Hoare * win32/get_system_flavour.cc: Fix little compile bugs. @@ -13254,7 +13275,7 @@ * tests/t_log_nonexistent.at: New check to verify previous. * testsuite.at: Add it. -2004-12-30 graydon hoare +2004-12-30 Graydon Hoare * Makefile.am: Clean full testsuite directory and full-version. * configure.ac: Bump version number. @@ -13279,7 +13300,7 @@ deletion of a file with the same name as the rename src. * testsuite.at: add it -2004-12-29 graydon hoare +2004-12-29 Graydon Hoare * AUTHORS: Add Jordi. * change_set.{cc,hh}: Make sanity helpers const. @@ -13292,7 +13313,7 @@ (calculate_change_sets_recursive): Use results. * tests/t_no_change_deltas.at: Fix. -2004-12-29 graydon hoare +2004-12-29 Graydon Hoare * change_set.cc: Fix unit tests to satisfy sanity checks. * std_hooks.lua: Fix status checking on external merges. @@ -13336,7 +13357,7 @@ in each revision in a nice format (easier to read than what 'cat revision' shows). -2004-12-28 graydon hoare +2004-12-28 Graydon Hoare * AUTHORS: Add various recent authors. @@ -13344,7 +13365,7 @@ * debian/*: Fix up for package building. -2004-12-28 graydon hoare +2004-12-28 Graydon Hoare * change_set.{cc,hh}: Add sanity checking, rework some of concatenation logic to accomodate. @@ -13501,11 +13522,11 @@ * tests/t_patch_drop_add.at: Remove priority notes, since these are no longer bugs. -2004-12-17 graydon hoare +2004-12-17 Graydon Hoare * tests/t_merge_2.at: Works now, remove xfail. -2004-12-17 graydon hoare +2004-12-17 Graydon Hoare * tests/t_merge_1.at: Remove AT_CHECK(false) and xfail. * tests/t_fdiff_normalize.at: New test. @@ -13549,7 +13570,7 @@ * commands.cc (lca): Correct negative status text. * commands.cc (update): Use GNU style braces. -2004-12-12 graydon hoare +2004-12-12 Graydon Hoare * commands.cc: Fix bug reported in t_attr.at * tests/t_attr.at: Remove xfail. @@ -13737,7 +13758,7 @@ (queue_data_cmd): Call 'note_item_sent'. (queue_delta_cmd): Call 'note_item_sent'. -2004-12-09 graydon hoare +2004-12-09 Graydon Hoare * ROADMAP: Add file. @@ -13794,7 +13815,7 @@ * tests/t_ambig_update.at: Also check that update fails when one candidate edge is deeper than the other. -2004-12-08 graydon hoare +2004-12-08 Graydon Hoare * change_set.cc (extend_renumbering_via_added_files): Look up parent tid in existing renumbering. @@ -13833,7 +13854,7 @@ * commands.cc (explicit_merge): New command. -2004-12-08 graydon hoare +2004-12-08 Graydon Hoare * change_set.cc (extend_renumbering_via_added_files): Look up parent tid in existing renumbering. @@ -13882,18 +13903,18 @@ * Makefile.am (package_full_revision.txt): Silence error messages when deducing full package revision. -2004-12-06 graydon hoare +2004-12-06 Graydon Hoare * unix/get_system_flavour.cc: * win32/get_system_flavour.cc: Add missing files. -2004-12-06 graydon hoare +2004-12-06 Graydon Hoare * commands.cc (merge): Add newline in output. * change_set.cc (project_missing_deltas): Fix very bad delta-renaming bug. -2004-12-06 graydon hoare +2004-12-06 Graydon Hoare * change_set.cc: * tests/t_merge_add_del.at: @@ -13932,7 +13953,7 @@ * configure.ac: bumped the prequisite version to 2.58 since some tests use AT_XFAIL_IF -2004-12-05 graydon hoare +2004-12-05 Graydon Hoare * Makefile.am (package_full_revision.txt): Use top_builddir to locate monotone executable. @@ -13949,7 +13970,7 @@ * configure.ac: bumped the prequisite version to 2.58 since some tests use AT_XFAIL_IF -2004-12-04 graydon hoare +2004-12-04 Graydon Hoare * commands.cc (fcommit): New command. (update): Finish off merge of update command. @@ -14042,7 +14063,7 @@ * commands.cc: reordered commands to help merge with changesets branch -2004-12-01 graydon hoare +2004-12-01 Graydon Hoare * {unix,win32}/get_system_flavour.cc: New files. * basic_io.{cc,hh}: Give names to input sources. @@ -14347,19 +14368,19 @@ * monotone.texi: Fix typos. -2004-11-08 graydon hoare +2004-11-08 Graydon Hoare * monotone.texi: Some minor cleanups. * netsync.cc: Fix a formatter. -2004-11-07 graydon hoare +2004-11-07 Graydon Hoare * figures/*.txt: Drop. * monotone.texi: Pull ASCII figures back in conditionally. * NEWS, AUTHORS, monotone.spec: Update for 0.15. * monotone.1: Update. -2004-11-06 graydon hoare +2004-11-06 Graydon Hoare * README.changesets: New file. * config.guess, config.sub: Remove. @@ -14370,7 +14391,7 @@ * po/POTFILES.in: Update to remove os_specific.hh. * po/monotone.pot: Regenerate. -2004-11-05 graydon hoare +2004-11-05 Graydon Hoare * constants.cc: Up timeout, connection limit. * monotone.texi: Various cleanups. @@ -14386,7 +14407,7 @@ * Makefile.am (EXTRA_DIST): Include spec file. * commands.cc (diff): No output if empty diff. -2004-10-31 graydon hoare +2004-10-31 Graydon Hoare * commands.cc (diff): Use guess_binary. Fix up some messages to fit on single lines. @@ -14395,7 +14416,7 @@ * texinfo.css: Make images align nicely. * netsync.cc: Fix up some messages to be clearer. -2004-10-30 graydon hoare +2004-10-30 Graydon Hoare * figures/*: New figures. * monotone.texi: Rewrite much of the tutorial. @@ -14410,13 +14431,13 @@ * sanity.cc (dump_buffer): Wrap bare string in call to string(), to disambiguate conversions (required by Boost 1.30). -2004-10-26 graydon hoare +2004-10-26 Graydon Hoare * tests/t_update_missing.at: New test from Bruce Stephens * testsuite.at: Call it. * change_set.cc: Fix the error exposed by it. -2004-10-26 graydon hoare +2004-10-26 Graydon Hoare * work.{cc,hh}: Comply with Derek's new tests. * commands.cc: Likewise. @@ -14437,7 +14458,7 @@ * tests/t_add.at: New test. * testsuite.at: Call it. -2004-10-26 graydon hoare +2004-10-26 Graydon Hoare * basic_io.{cc,hh}: Rework to use indented stanzas. * change_set.cc, revision.cc: Likewise. @@ -14445,14 +14466,14 @@ * commands.cc: Sanity check file ID on delta commit. * work.cc: Chatter a bit more on add/drop. -2004-10-17 graydon hoare +2004-10-17 Graydon Hoare * merkle_tree.cc: Fix bad logging. * netsync.cc: Fix transmission bugs. * work.cc: Add some progress messages back in. * monotone.texi: Change contents of MT/work in example. -2004-10-17 graydon hoare +2004-10-17 Graydon Hoare * commands.cc (log): Keep a seen list, mask frontier by it. * monotone.texi: Updates to cover revision terminology. @@ -14519,17 +14540,17 @@ a result, set the tick writer to be the progress dot kind or the counting type. -2004-10-15 graydon hoare +2004-10-15 Graydon Hoare * std_hooks.lua (get_revision_cert_trust): Add. -2004-10-14 graydon hoare +2004-10-14 Graydon Hoare * main.cc (UNIX_STYLE_SIGNAL_HANDLING): Enable on OSX. * cryptopp/*: Upgrade to 5.2.1 * Makefile.am: Adjust for a couple new files. -2004-10-13 graydon hoare +2004-10-13 Graydon Hoare * change_set.cc (__STDC_CONSTANT_MACROS): Further hammering. * commands.cc (changesetify): New subcommand to db. @@ -14545,22 +14566,22 @@ * schema_migration.cc: Add migration code for revisions. * Makefile.am: Mention views.sql. -2004-10-12 graydon hoare +2004-10-12 Graydon Hoare * unix/read_password.cc: Don't force echo on. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare merge a batch of changes from trunk, see below. * monotone.spec: Bump to 0.14. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare fix bug 9884 * tests/t_singlenetsync.at: sleep 5 * tests/t_netsync.at: sleep 5 -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * AUTHORS: Mention Richard Levitte. * Makefile.am: Remove nonce stuff. @@ -14587,12 +14608,12 @@ * tests/t_null.at: Adjust for new option names. * unit_tests.cc: Set debug, not verbose. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * tests/t_remerge.at: New test. * testsuite.at: Call it. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * cryptopp/algebra.cpp: * cryptopp/asn.h: @@ -14611,22 +14632,22 @@ * lua.cc: Fixes for g++ 3.4 from Michael Scherer. * AUTHORS: Mention Michael. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * tests/t_movedel.at: New test. * testsuite.at: Call it. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * tests/t_movepatch.at: New test. * testsuite.at: Call it. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * change_set.cc: * file_io.{cc,hh}: Bug Fixes. -2004-10-10 graydon hoare +2004-10-10 Graydon Hoare * cert.{cc,hh} (cert_revision_manifest): Bug fixes. * commands.cc (approve) @@ -14637,7 +14658,7 @@ * tests/t_ls_missing.at: * tests/t_testresult.at: Bug fixes. -2004-10-09 graydon hoare +2004-10-09 Graydon Hoare * netsync.cc: * packet.cc: @@ -14646,7 +14667,7 @@ * tests/t_single_char_filenames.at: * tests/t_singlenetsync.at: Bug fixes. -2004-10-04 graydon hoare +2004-10-04 Graydon Hoare * Makefile.am: Re-enable rcs stuff. * cert.{cc,hh}: Bug fixes. @@ -14662,7 +14683,7 @@ * rcs_file.cc: Pick up bug fix from trunk. * rcs_import.cc: Teach about revisions. -2004-10-03 graydon hoare +2004-10-03 Graydon Hoare * change_set.{cc,hh}: Lots of little bug fixes. * commands.cc: Likewise. @@ -14674,7 +14695,7 @@ * testsuite.at: Likewise. * work.cc: Bug fixes. -2004-09-30 graydon hoare +2004-09-30 Graydon Hoare * app_state.cc: Inform db of app. * change_set.cc: Bug fixes. @@ -14684,11 +14705,11 @@ * file_io.{cc,hh}: Remove unlink function. * schema.sql: Pass pubkey data into trust call. -2004-09-29 graydon hoare +2004-09-29 Graydon Hoare * change_set.cc: Various bug fixes, merge unit tests. -2004-09-26 graydon hoare +2004-09-26 Graydon Hoare * predicament.{cc,hh}: Remove. * Makefile.am: Update. @@ -14697,7 +14718,7 @@ * file_io.{cc,hh}: Likewise, and implement link/unlink. * lua.{cc,hh}: Implement conflict resolver hooks. -2004-09-25 graydon hoare +2004-09-25 Graydon Hoare * change_set.{cc,hh}: Rewrite entirely. * work.cc: Adjust to compensate. @@ -14764,18 +14785,18 @@ * tests/t_update.at: commit --message * tests/t_versions.at: commit --message -2004-09-19 graydon hoare +2004-09-19 Graydon Hoare * change_set.cc: More bug fixes. * basic_io.cc: Improve error reporting. * commands.cc (complete): Teach about revisions. * database.{cc,hh}: Add complete variant for revisions. -2004-09-19 graydon hoare +2004-09-19 Graydon Hoare * change_set.cc: Add a unit test, fix some bugs. -2004-09-18 graydon hoare +2004-09-18 Graydon Hoare * change_set.{cc,hh} (subtract_change_sets): New function. (build_pure_addition_change_set): New function. @@ -14786,12 +14807,12 @@ * database.{cc,hh} (get_manifest): New function. * cert.cc: Use it. -2004-09-13 graydon hoare +2004-09-13 Graydon Hoare * change_set.cc: Bug fixes. * commands.cc: Likewise. -2004-09-13 graydon hoare +2004-09-13 Graydon Hoare * change_set.{cc,hh}: Implement delta renaming and merging. * commands.cc @@ -14803,7 +14824,7 @@ (move_dir): New function. (delete_dir_recursive): New function. -2004-09-10 graydon hoare +2004-09-10 Graydon Hoare * basic_io.{cc,hh}: Move to more "normal" looking quoted output. @@ -14844,7 +14865,7 @@ * tests/t_single_char_filenames.at: ditto * tests/t_versions.at: ditto -2004-09-06 graydon hoare +2004-09-06 Graydon Hoare * Makefile.am: Revise, * cert.{cc,hh}: Minor bug fixes. @@ -14858,7 +14879,7 @@ * schema.sql: Fix typos. * update.{cc,hh}: Teach about revisions. -2004-09-06 graydon hoare +2004-09-06 Graydon Hoare * Makefile.am (unit_tests): Revise. * change_set.{cc,hh}: Move accessors to header. @@ -14878,7 +14899,7 @@ * commands.cc (restrict_patch_set): fix bug in removal of restricted adds/dels/moves/deltas -2004-08-28 graydon hoare +2004-08-28 Graydon Hoare * Makefile.am (unit_tests): Split out working parts. * basic_io.{cc,hh}: Minor fixes. @@ -14894,7 +14915,7 @@ * vocab.cc: Instantiate revision. * work.{cc,hh}: Rewrite in terms of path_rearrangement. -2004-08-17 graydon hoare +2004-08-17 Graydon Hoare * database.cc: Simplified. * schema.sql: Simplified. @@ -14902,14 +14923,14 @@ * revision.{hh,cc}: Stripped out tid_source. * change_set.{cc,hh}: Oops, never committed! -2004-08-16 graydon hoare +2004-08-16 Graydon Hoare * change_set.{hh,cc}: Simplified, finished i/o. * revision.{hh,cc}: Fix to match, redo i/o. * basic_io.cc (basic_io::parser::key): Print trailing colon. * vocab.hh: Whitespace tweak. -2004-08-09 graydon hoare +2004-08-09 Graydon Hoare * change_set.{hh,cc}: New files. * basic_io.{hh,cc}: New files. @@ -14919,7 +14940,7 @@ * lua.{hh,cc}, std_hooks.lua: Model predicaments. * Makefile.am: Update. -2004-07-10 graydon hoare +2004-07-10 Graydon Hoare * lcs.{hh,cc}: Move lcs.hh body into lcs.cc. * diff_patch.cc: Modify to compensate. @@ -14943,12 +14964,12 @@ * commands.cc (restrict_patch_set): new function. called by commit, update, status, diff commands -2004-07-05 graydon hoare +2004-07-05 Graydon Hoare * cert.cc (operator<): Fix wrong ordering of fields. -2004-06-07 graydon hoare +2004-06-07 Graydon Hoare * cryptopp/algebra.cpp: * cryptopp/asn.h: @@ -14967,38 +14988,38 @@ * lua.cc: Fixes for g++ 3.4 from Michael Scherer. * AUTHORS: Mention Michael. -2004-05-28 graydon hoare +2004-05-28 Graydon Hoare * tests/t_movedel.at: New test. * testsuite.at: Call it. * diff_patch.cc (adjust_deletes_under_renames): New function. (merge3): Use it. -2004-05-27 graydon hoare +2004-05-27 Graydon Hoare * tests/t_movepatch.at: New test. * testsuite.at: Call it. * diff_patch.cc (adjust_deltas_under_renames): New function. (merge3): Use it. -2004-05-20 graydon hoare +2004-05-20 Graydon Hoare * NEWS: Note 0.13 release. * configure.ac: Bump version number. * monotone.spec: Likewise. -2004-05-19 graydon hoare +2004-05-19 Graydon Hoare * file_io.cc (tilde_expand): Fix fs::path use. -2004-05-18 graydon hoare +2004-05-18 Graydon Hoare * diff_patch.cc (apply_directory_moves): Fix fs::path use. * file_io.cc (write_data_impl): Likewise. * packet.cc: Use explicit true/false maps in caches. * sanity.cc (dump_buffer): Write to clog (buffered). -2004-05-16 graydon hoare +2004-05-16 Graydon Hoare * keys.cc (get_passphrase): Reimplement. * unix/read_password.c: Remove. @@ -15006,7 +15027,7 @@ * constants.{hh,cc} (maxpasswd): New constant. * Makefile.am: Teach about platform specific stuff. -2004-05-16 graydon hoare +2004-05-16 Graydon Hoare * diff_patch.cc (merge2): Don't discard files on one side. * std_hooks.lua (merge2_xxdiff_cmd): Specify merge filename. @@ -15038,7 +15059,7 @@ * monotone.texi (Hook Reference): Update documented default definitions of 'merge2' and 'merge3'. -2004-05-12 graydon hoare +2004-05-12 Graydon Hoare * AUTHORS: Rename Netxx back to netxx. Really, look in the manifest; it's been renamed! @@ -15056,12 +15077,12 @@ (merge3): Likewise. Also add (disabled) hook to use CVS 'merge' command, as a demonstration of how to. -2004-05-12 graydon hoare +2004-05-12 Graydon Hoare * std_hooks.lua (get_author): Remove standard definition. * monotone.texi: Document change. -2004-05-12 graydon hoare +2004-05-12 Graydon Hoare * cert.cc (cert_manifest_author_default): Use default signing key name for default author, if lua hook fails. @@ -15077,7 +15098,7 @@ * tests/t_ls_missing.at: New test case. * testsuite.at: Added t_ls_missing.at. -2004-05-10 graydon hoare +2004-05-10 Graydon Hoare * nonce.cc, nonce.hh: New files. * Makefile.am: Note new files. @@ -15092,20 +15113,20 @@ * monotone.texi, monotone.1: Adjust to compensate. * work.cc, work.hh: Constify some arguments. -2004-05-09 graydon hoare +2004-05-09 Graydon Hoare * diff_patch.cc: Remove recording of file merge ancestry. -2004-05-09 graydon hoare +2004-05-09 Graydon Hoare * commands.cc (ls_missing): Modify to account for work. -2004-05-09 graydon hoare +2004-05-09 Graydon Hoare * commands.cc (list missing): New command. * monotone.texi, monotone.1: Update to document. -2004-05-08 graydon hoare +2004-05-08 Graydon Hoare * main.cc: New file encompassing prg_exec_monitor. * mkstemp.cc, mkstemp.hh: New portable implementation. @@ -15120,7 +15141,7 @@ * monotone.texi: Removed extraneous @ftable directive. -2004-05-02 graydon hoare +2004-05-02 Graydon Hoare * monotone.texi: Add stuff on selectors, new hooks. * AUTHORS: Typo fix. @@ -15163,13 +15184,13 @@ * rcs_import.cc (process_branch): also follow branches of last/first versions -2004-04-29 graydon hoare +2004-04-29 Graydon Hoare * configure.ac: Fix up windows probe and bundling checks. * netxx/resolve_getaddrinfo.cxx: Local hack for stream addresses. * netsync.cc: Report address before listening. -2004-04-29 graydon hoare +2004-04-29 Graydon Hoare * cert.cc (get_branch_heads): Calculate a "disapproved version" attribute which culls a version with only disapproved ancestry @@ -15228,19 +15249,19 @@ * configure.ac: enable use of installed SQLite library -2004-04-20 graydon hoare +2004-04-20 Graydon Hoare * lua.hh, lua.cc (hook_note_commit): New hook. * commands.cc (commit): Call it. -2004-04-19 graydon hoare +2004-04-19 Graydon Hoare * cert.cc: Make trust messages nicer. * merkle_tree.cc: Clarify logging messages. * netsync.cc: Reorganize tickers, put client in txn. * packet.cc, packet.hh: Teach about constructability. -2004-04-16 graydon hoare +2004-04-16 Graydon Hoare * netsync.cc (session::extra_manifests): New member. (session::analyze_ancestry_graph): Use it. @@ -15258,11 +15279,11 @@ * monotone.texi: Typo fixes. -2004-04-10 graydon hoare +2004-04-10 Graydon Hoare * netsync.cc: Minor bug fixes. -2004-04-10 graydon hoare +2004-04-10 Graydon Hoare * database.{cc,hh}: * commands.{cc,hh}: @@ -15271,7 +15292,7 @@ * vocab_terms.hh: Implement first cut at selectors. -2004-04-10 graydon hoare +2004-04-10 Graydon Hoare * cert.cc (operator<): Include name in compare. (operator==): Likewise. @@ -15279,7 +15300,7 @@ * rcs_file.cc: Rewrite by hand, no spirit. * rcs_import.cc: Change ticker names a bit. -2004-04-09 graydon hoare +2004-04-09 Graydon Hoare * app_state.cc: Fix a couple file path constructions. * file_io.cc (book_keeping_file): Make one variant static. @@ -15287,7 +15308,7 @@ * work.cc: Ditto. * rcs_file.cc: fcntl fix from Paul Snively for OSX. -2004-04-09 graydon hoare +2004-04-09 Graydon Hoare * file_io.cc: Fix boost filesystem "." and ".." breakage. * lua.cc: Fix format of log entry. @@ -15296,14 +15317,14 @@ * testsuite/t_i18n_file.at: Fix autotest LANG breakage. * testsuite/t_null.at: Account for chatter with --verbose. -2004-04-09 graydon hoare +2004-04-09 Graydon Hoare * configure.ac: Comment out check for sse2, set bundling to true by default. * INSTALL: describe changes to bundling. * Makefile.am: Remove vestiges of depot. -2004-04-07 graydon hoare +2004-04-07 Graydon Hoare * adns/*: * network.{cc,hh}: @@ -15332,20 +15353,20 @@ * commands.cc: * std_hooks.lua: Add initial selector stuff. -2004-03-29 graydon hoare +2004-03-29 Graydon Hoare * monotone.spec: Update for 0.11 release. Release point (v 0.11). -2004-03-29 graydon hoare +2004-03-29 Graydon Hoare * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Set. * commands.cc: Tidy up / narrow output width. * patch_set.cc: Likewise. * monotone.texi: Cleanups for PDF generation. -2004-03-28 graydon hoare +2004-03-28 Graydon Hoare * NEWS: Mention 0.11 release. * AUTHORS: Mention Robert. @@ -15354,7 +15375,7 @@ * file_io.cc (walk_tree_recursive): Ignore broken symlinks. -2004-03-27 graydon hoare +2004-03-27 Graydon Hoare * monotone.texi: Flesh out netsync stuff, remove old network stuff. * monotone.1: Likewise. @@ -15369,7 +15390,7 @@ * network.cc: * schema_migration.cc: Bundled library switch logic. -2004-03-27 graydon hoare +2004-03-27 Graydon Hoare * depot.cc (dump): Implement. * tests/t_http.at, test/t_proxy.at: Use "depot.cgi dump" rather than sqlite. @@ -15381,18 +15402,18 @@ * vocab.cc (verify): Normalize local_path's during verification on boost 1.31.0. * monotone.texi: Rip out some of the pre-netsync networking docs. -2004-03-24 graydon hoare +2004-03-24 Graydon Hoare * boost/circular_buffer_base.hpp: Boost version insulation. * cert.cc, cert.hh, commands.cc: Differentiate "unknown" keys from "bad". * xdelta.cc, proto_machine.cc: Fix boost version insulation. -2004-03-24 graydon hoare +2004-03-24 Graydon Hoare * rcs_import.cc (import_substates): Filter by branch. * xdelta.cc: Minor bits of insulation. -2004-03-24 graydon hoare +2004-03-24 Graydon Hoare * AUTHORS: Mention Robert. * configure.ac: Enable sse2 stuff. @@ -15412,16 +15433,16 @@ * xdelta.cc: Portability fixes for boost 1.31.0 -2004-03-22 graydon hoare +2004-03-22 Graydon Hoare * cryptopp/integer.cpp, integer.h: Enable SSE2 multiply code. * database.cc, database.hh, certs.cc: Speed up 'heads'. -2004-03-21 graydon hoare +2004-03-21 Graydon Hoare * lcs.hh, sanity.hh: Minor performance tweaks. -2004-03-20 graydon hoare +2004-03-20 Graydon Hoare * rcs_import.cc: Teach how to aggregate branches. * monotone.texi: Start section on netsync. @@ -15440,27 +15461,27 @@ * quick_alloc.hh: Fixes for gcc 3.4 compat and warnings. -2004-03-17 graydon hoare +2004-03-17 Graydon Hoare * cryptopp/config.h: Fix for gcc aliasing optimization error. * rcs_import.cc (cvs_history::note_file_edge): Fix for first changelog import bug (#5813). -2004-03-15 graydon hoare +2004-03-15 Graydon Hoare * rcs_import.cc: Import lone versions properly. * tests/t_singlecvs.at: New test for it. * testsuite.at: Call it. -2004-03-14 graydon hoare +2004-03-14 Graydon Hoare * commands.cc (diff): Show added files too. * monotone.texi: Fix typo. -2004-03-08 graydon hoare +2004-03-08 Graydon Hoare * netsync.cc (analyze_manifest_edge): Fix broken formatter. -2004-03-07 graydon hoare +2004-03-07 Graydon Hoare * Makefile.am (BOOST_SANDBOX_SOURCES): Remove boost::socket entries. (NETXX_SOURCES): Predicate on IP6 support in OS (from Paul Snively). @@ -15473,7 +15494,7 @@ * sanity.hh, sanity.cc: Make log formatters give file:line coords, throw log offending coordinate if formatting fails. -2004-03-07 graydon hoare +2004-03-07 Graydon Hoare * sqlite/date.c, sqlite/vdbeInt.h, sqlite/vdbeaux.c: Add. * sqlite/*.c: Upgrade to 2.8.12. @@ -15482,18 +15503,18 @@ (expand_ancestors) (expand_dominators): Resize child bitmaps to cover parent. -2004-03-06 graydon hoare +2004-03-06 Graydon Hoare * netsync.cc (get_root_prefix): Fix from Paul Snively to fix static initialization order on mac OSX. * montone.texi: Typo fix from Anders Petersson. * *.cc: Move all function defs into column 0. -2004-03-04 graydon hoare +2004-03-04 Graydon Hoare * std_hooks.lua: Fix merger execution pessimism. -2004-03-04 graydon hoare +2004-03-04 Graydon Hoare * adler32.hh: Modify to use u8. * depot.cc, netcmd.cc, xdelta.cc: Modify to use u8. @@ -15502,14 +15523,14 @@ * schema_migration.cc: Strip whitespace in sha1. (changes received from Christof Petig) -2004-03-01 graydon hoare +2004-03-01 Graydon Hoare * commands.cc: Handle anonymous pulling. * netsync.cc: Ditto. Release point (v 0.10). -2004-03-01 graydon hoare +2004-03-01 Graydon Hoare * NEWS: Mention impending 0.10 release. * cert.cc, cert.hh: Bug fixes, implement trust function, QA stuff. @@ -15533,7 +15554,7 @@ * ui.cc (sanitize): Clean escape chars from output (optional?) * update.cc: Rewrite entirely in terms of new QA definitions. -2004-02-24 graydon hoare +2004-02-24 Graydon Hoare * commands.cc (ls_keys): Write key hash codes. * constands.cc (netsync_timeout_seconds): Up to 120. @@ -15541,14 +15562,14 @@ * patch_set.cc (manifests_to_patch_set): Fix bug in overload default construction. -2004-02-22 graydon hoare +2004-02-22 Graydon Hoare * patch_set.cc, patch_set.hh: Parameterize yet further. * netsync.cc: Fix a lot of bugs, add manifest and file grovelling. * tests/t_netsync.at: A new test (which runs!) * testsuite.at: Call it. -2004-02-20 graydon hoare +2004-02-20 Graydon Hoare * cert.cc, cert.hh, key.cc, key.hh, database.cc, database.hh: Add lots of little netsync support routines. @@ -15564,7 +15585,7 @@ * netcmd.cc: Switch everything over to uleb128s. * netsync.cc: Implement lots of missing stuff. -2004-02-09 graydon hoare +2004-02-09 Graydon Hoare * netsync.cc (ROOT_PREFIX): New variable. * commands.cc (merkle): New command. @@ -15573,7 +15594,7 @@ * monotone.texi: Spelling corrections. -2004-02-09 graydon hoare +2004-02-09 Graydon Hoare * database.cc, database.hh (get_version_size) @@ -15584,7 +15605,7 @@ Cleanup and typesafety. * netsync.cc: Cleanup, typesafety, implement refine phase. -2004-02-01 graydon hoare +2004-02-01 Graydon Hoare * netsync.cc: Remove a lot of stuff, implement auth phase. * constants.cc, constants.hh: Move constants from netsync.cc. @@ -15599,7 +15620,7 @@ * database.cc, database.hh (public_key_exists) (get_pubkey): New functions based on key hashes. -2004-01-31 graydon hoare +2004-01-31 Graydon Hoare * Netxx/*: New files. * AUTHORS: Mention Netxx. @@ -15643,7 +15664,7 @@ Add check for pthread_mutex_lock and ACX_PTHREAD. * m4/acx_pthread.m4: New file. -2004-01-07 graydon hoare +2004-01-07 Graydon Hoare * Makefile.am: * po/POTFILES.in: @@ -15657,7 +15678,7 @@ Release point (v 0.9). -2004-01-07 graydon hoare +2004-01-07 Graydon Hoare * cert.cc (ensure_parents_loaded) (expand_dominators) @@ -15671,14 +15692,14 @@ * vocab.cc (verify) Fix use of val() / iterator. * constants.cc (illegal_path_bytes): NUL-terminate. -2004-01-02 graydon hoare +2004-01-02 Graydon Hoare * diff_patch.cc (normalize_extents): Improve to handle an odd case. * tests/t_fmerge.at: New test, to test it. * commands.cc (fload, fmerge): Permanently enable, for test. * testsuite.at: Call new test. -2004-01-01 graydon hoare +2004-01-01 Graydon Hoare * file_io.hh, file_io.cc (read_localized_data, write_localized_data): New functions @@ -15690,7 +15711,7 @@ * po/monotone.pot: Regenerate. * NEWS, configure.ac: Prep for 0.9 release. -2003-12-30 graydon hoare +2003-12-30 Graydon Hoare * file_io.hh, file_io.cc (mkpath): New function. * commands.cc, database.cc, diff_patch.cc, file_io.cc, @@ -15699,7 +15720,7 @@ * monotone.texi: Include i18n docs. * tests/t_i18n_file.at: Check colon in filename. -2003-12-29 graydon hoare +2003-12-29 Graydon Hoare * file_io.cc: Localize names before touching fs. * lua.hh, lua.cc (hook_get_system_charset): Remove useless fn. @@ -15709,7 +15730,7 @@ * tests/t_i18n_file.at: New test. * testsuite.at: Call it. -2003-12-28 graydon hoare +2003-12-28 Graydon Hoare * app_state.cc, app_state.hh: Massage to use i18n vocab. * cert.cc, commands.cc, commands.hh, rcs_import.cc, @@ -15725,7 +15746,7 @@ * monotone.cc (utf8_argv): Charconv argv. * network.hh, network.cc: Use url.{hh,cc}. -2003-12-28 graydon hoare +2003-12-28 Graydon Hoare * constants.hh, constants.cc (idlen): New constant. * commands.cc, vocab.cc: Use it. @@ -15743,12 +15764,12 @@ (externalize_rsa_keypair_id): New functions. * url.hh, url.cc (parse_utf8_url): New function. -2003-12-20 graydon hoare +2003-12-20 Graydon Hoare * diff_patch.cc (normalize_extents): New function. (merge_via_edit_scripts): Use it. -2003-12-19 graydon hoare +2003-12-19 Graydon Hoare [net.venge.monotone.i18n branch] @@ -15776,33 +15797,33 @@ * commands.cc: Various formatting cleanups. * unit_tests.cc, unit_tests.hh: Connect to url tests. -2003-12-19 graydon hoare +2003-12-19 Graydon Hoare * diff_patch.cc (merge3): Skip patches to deleted files. -2003-12-16 graydon hoare +2003-12-16 Graydon Hoare * commands.cc (ls_ignored, ignored_itemizer): Fold in as subcases of unknown. -2003-12-16 graydon hoare +2003-12-16 Graydon Hoare * lua.cc (working_copy_rcfilename): MT/monotonerc not MT/.monotonerc. -2003-12-16 graydon hoare +2003-12-16 Graydon Hoare * lua.hh, lua.cc (working_copy_rcfilename): New function. * monotone.cc: Add working copy rcfiles. * commands.cc (ls_unknown, unknown_itemizer): Skip ignored files. -2003-12-16 graydon hoare +2003-12-16 Graydon Hoare * file_io.cc (walk_tree_recursive): continue on book-keeping file. -2003-12-15 graydon hoare +2003-12-15 Graydon Hoare * tests/t_unidiff.at, t_unidiff2.at: Check for mimencode. -2003-12-15 graydon hoare +2003-12-15 Graydon Hoare * configure.ac: Add --enable-static-boost. * Makefile.am: Likewise. @@ -15831,7 +15852,7 @@ * commands.cc (update): Notice when we're already up-to-date. * commands.cc (propagate): Assign branch name correctly when merging. -2003-12-05 graydon hoare +2003-12-05 Graydon Hoare * lcs.hh (edit_script): New entry point. * diff_patch.cc: Rewrite merge in terms of edit scripts. @@ -15840,19 +15861,19 @@ * randomfile.hh: Prohibit deletes on end of chunks. * sanity.cc: EOL-terminate truncated long lines. -2003-12-02 graydon hoare +2003-12-02 Graydon Hoare * database.cc, database.hh (reverse_queue): Copy constructor. * std_hooks.lua (merge3): Remove afile, not ancestor. * monotone.cc: Remove debugging message. * ui.cc (finish_ticking): Set last_write_was_a_tick to false. -2003-12-01 graydon hoare +2003-12-01 Graydon Hoare * app_state.hh, app_state.cc (set_signing_key): New fn, persist key. * monotone.cc (cpp_main): Permit commuting the --help argument around. -2003-11-30 graydon hoare +2003-11-30 Graydon Hoare * network.cc (post_queued_blobs_to_network): Fail when posted_ok is false. * database.cc (initialize): Fail when -journal file exists. @@ -15871,7 +15892,7 @@ * http_tasks.cc (check_received_bytes): Allow "-" as well. * depot.cc (execute_post_query): Allow "-" as well. -2003-11-28 graydon hoare +2003-11-28 Graydon Hoare * cert.cc: Various speedups. * cycle_detector.hh (edge_makes_cycle): Use visited set, too. @@ -15880,7 +15901,7 @@ * sqlite/os.c (sqliteOsRandomSeed): Harmless valgrind purification. * tests/t_fork.at, tests/t_merge.at: Ignore stderr chatter on 'heads'. -2003-11-27 graydon hoare +2003-11-27 Graydon Hoare * Makefile.am (AM_LDFLAGS): No more -static, sigh. * cert.cc (find_relevant_edges): Keep dynamic-programming caches. @@ -15888,41 +15909,41 @@ * cert.cc, cert.hh (rename_edge): Add constructor, copy constructor. * commands.cc (list certs): Note rename certs are binary. -2003-11-24 graydon hoare +2003-11-24 Graydon Hoare * network.cc: Continue fetch, post loops even if one target has an exception. -2003-11-24 graydon hoare +2003-11-24 Graydon Hoare * database.hh, database.cc (delete_posting): Change to take queue sequence numbers. * commands.cc (queue): Use new API. * network.cc (post_queued_blobs_to_network): Use new API. -2003-11-24 graydon hoare +2003-11-24 Graydon Hoare * std_hooks.lua (get_http_proxy): Return nil when no ENV var. * monotone.texi (get_http_proxY): Document change. -2003-11-24 graydon hoare +2003-11-24 Graydon Hoare * tests/t_proxy.at: Add a test for proxying with tinyproxy. * testsuite.at: Call it. * lua.cc: Fix dumb error breaking proxying. * network.cc: Be verbose about proxying. -2003-11-23 graydon hoare +2003-11-23 Graydon Hoare * http_tasks.cc (read_chunk): Tolerate 0x20* after chunk len. -2003-11-23 graydon hoare +2003-11-23 Graydon Hoare * network.cc: Make more informative error policy. * boost/socket/socketstream.hpp: Pass SocketType to streambuf template. * boost/socket/src/default_socket_impl.cpp: Translate EINTR. -2003-11-22 graydon hoare +2003-11-22 Graydon Hoare * lua.cc, lua.hh (hook_get_http_proxy): New hook. * std_hooks.lua (get_http_proxy): Default uses HTTP_PROXY. @@ -15931,7 +15952,7 @@ * http_tasks.hh, http_tasks.cc: Teach about proxies (sigh). * monotone.texi: Document new hooks. -2003-11-22 graydon hoare +2003-11-22 Graydon Hoare * lua.cc, lua.hh (hook_get_connect_addr): New hook. * std_hooks.lua (get_connect_addr): Default uses HTTP_PROXY. @@ -15939,7 +15960,7 @@ * http_tasks.cc: Teach about HTTP/1.1. * cert.cc (bogus_cert_p): Fix UI ugly. -2003-11-21 graydon hoare +2003-11-21 Graydon Hoare * constants.hh (postsz): New constant for suggested post size. * database.cc, database.hh (queue*): Change db API slightly. @@ -15959,7 +15980,7 @@ * missing: Removed generated file. -2003-11-14 graydon hoare +2003-11-14 Graydon Hoare * commands.cc (vcheck): Add. * cert.cc, cert.hh (cert_manifest_vcheck): Add. @@ -15970,7 +15991,7 @@ * monotone.texi (Hash Integrity): New section. * monotone.1: Document vcheck. -2003-11-14 graydon hoare +2003-11-14 Graydon Hoare * database.cc, database.hh (reverse_queue): New class. (compute_older_version): New functions. @@ -15985,7 +16006,7 @@ * tests/t_cross.at: Ignore new UI chatter. * monotone.texi (Transmitting Changes): Change UI output. -2003-11-13 graydon hoare +2003-11-13 Graydon Hoare * Makefile.am (AUTOMAKE_OPTIONS): Require 1.7.1 * commands.cc (addtree): Wrap in transaction guard. @@ -16001,18 +16022,18 @@ * tests/t_cvsimport.at: New test. * testsuite.at: Call it. -2003-11-10 graydon hoare +2003-11-10 Graydon Hoare * commands.cc (find_oldest_ancestors): New function. (queue): New "addtree" subcommand. * monotone.texi: Document it. * monotone.1: Document it. -2003-11-10 graydon hoare +2003-11-10 Graydon Hoare * file_io.cc (walk_tree_recursive): Ignore MT/ -2003-11-09 graydon hoare +2003-11-09 Graydon Hoare * database.cc (dump, load): Implement. * commands.cc (db): Call db.dump, load. @@ -16021,7 +16042,7 @@ special sections. * monotone.1: Mention dump and load. -2003-11-09 graydon hoare +2003-11-09 Graydon Hoare * rcs_file.hh (rcs_symbol): New structure. * rcs_file.cc (symbol): New rule. @@ -16033,7 +16054,7 @@ * monotone.texi: Document new command variant. * monotone.1: Ditto. -2003-11-09 graydon hoare +2003-11-09 Graydon Hoare * quick_alloc.hh: New file. * Makefile.am: Add it. @@ -16042,7 +16063,7 @@ * vocab.cc: Relax path name requirements a bit. * sqlite/sqliteInt.h: Up size of row to 16mb. -2003-11-02 graydon hoare +2003-11-02 Graydon Hoare * commands.cc (post): Post everything if no URL given; don't base decision off branch name presence. @@ -16059,11 +16080,11 @@ Release point (v 0.7). -2003-11-01 graydon hoare +2003-11-01 Graydon Hoare * http_tasks.cc: Drop extra leading slashes in HTTP messages. -2003-10-31 graydon hoare +2003-10-31 Graydon Hoare * commands.cc, database.cc, database.hh, lua.cc, lua.hh, network.cc, network.hh, packet.cc, packet.hh, schema.sql, @@ -16075,7 +16096,7 @@ * tests/t_smtp.at: New test. * testsuite.at: Call it. -2003-10-31 graydon hoare +2003-10-31 Graydon Hoare * patch_set.cc (manifests_to_patch_set): Second form with explicit renames. (manifests_to_patch_set): Split edit+rename events when we see them. @@ -16087,7 +16108,7 @@ * proto_machine.cc (read_line): get() into streambuf. * Makefile.am: Cover renames and adds. -2003-10-31 graydon hoare +2003-10-31 Graydon Hoare * diff_patch.cc (merge3): Extract renames. * commands.cc (calculate_new_manifest_map): Extract renames. @@ -16100,7 +16121,7 @@ * tests/t_erename.at: New test for edit+rename events. * testsuite.at: Call t_erename.at. -2003-10-30 graydon hoare +2003-10-30 Graydon Hoare * patch_set.cc (operator<): s/a/b/ in a few places, yikes! * cert.cc: Add machinery for rename edge certs. @@ -16115,7 +16136,7 @@ transforms.hh, update.hh, vocab.hh, work.hh, xdelta.hh: fix use of std:: prefix / "using namespace" pollution. -2003-10-27 graydon hoare +2003-10-27 Graydon Hoare * lua/liolib.c (io_mkstemp): Portability fix from Ian Main. @@ -16123,7 +16144,7 @@ * transforms.cc,hh (diff): Same. * rcs_import.cc: Various speedups to cvs import. -2003-10-26 graydon hoare +2003-10-26 Graydon Hoare * cert.cc (get_parents): New function. (write_paths_recursive): New function. @@ -16133,12 +16154,12 @@ Call write_ancestry_paths for "reposting" queue strategy. -2003-10-25 graydon hoare +2003-10-25 Graydon Hoare * commands.cc (log): Skip looking inside nonexistent manifests for file comments. -2003-10-24 graydon hoare +2003-10-24 Graydon Hoare * adns/*.c, adns/*.h: Import adns library. * Makefile.am: Update to build adns into lib3rdparty.a. @@ -16152,12 +16173,12 @@ * commands.cc (get_log_message, status, diff): Use patch_set_to_text_summary for complete description. -2003-10-22 graydon hoare +2003-10-22 Graydon Hoare * monotone.texi: Document 'queue' command. * monotone.1: Likewise. -2003-10-22 graydon hoare +2003-10-22 Graydon Hoare * diff_patch.cc (infer_directory_moves): New function. @@ -16167,12 +16188,12 @@ * tests/t_renamed.at: New test for dir renames. * testsuite.at: Call it. -2003-10-21 graydon hoare +2003-10-21 Graydon Hoare * commands.cc (queue): New command. (list): Add "queue" subcommand, too. -2003-10-21 graydon hoare +2003-10-21 Graydon Hoare * diff_patch.cc (merge_deltas): New function. (check_map_inclusion): New function. @@ -16183,7 +16204,7 @@ * file_io.cc, file_io.hh (make_dir_for): New function. * commands.cc (update): Call make_dir_for on update. -2003-10-20 graydon hoare +2003-10-20 Graydon Hoare * commands.cc: Replace [] with idx() everywhere. @@ -16202,20 +16223,20 @@ * network.cc (post_queued_blobs_to_network): Do nothing if no packets to post. -2003-10-20 graydon hoare +2003-10-20 Graydon Hoare * cert.cc (get_branch_heads): Fix dumb bug. * diff_patch.cc (merge3): Fix dumb bug. (merge2): Fix dumb bug. (try_to_merge_files): Fix dumb bug. -2003-10-20 graydon hoare +2003-10-20 Graydon Hoare * file_io.cc (tilde_expand): New function. * monotone.cc (cpp_main): Expand tildes in db and rcfile arguments. -2003-10-20 graydon hoare +2003-10-20 Graydon Hoare * rcs_import.cc (import_cvs_repo): Check key existence at beginning of import pass, to avoid wasted work. @@ -16224,7 +16245,7 @@ * commands.cc (log): Add each seen id to `cycles'. -2003-10-19 graydon hoare +2003-10-19 Graydon Hoare * AUTHORS: Mention Tecgraf PUC-Rio and their copyright. @@ -16243,18 +16264,18 @@ * commands.cc (merge): Use app.branch_name instead of args[0] for the branch name. -2003-10-17 graydon hoare +2003-10-17 Graydon Hoare * commands.cc (log): New command. Various other bug fixes. * monotone.1, monotone.texi: Minor updates. -2003-10-17 graydon hoare +2003-10-17 Graydon Hoare * monotone.texi: Expand command and hook references. * commands.cc: Disable db dump / load commands for now. -2003-10-16 graydon hoare +2003-10-16 Graydon Hoare * sanity.hh: Add a const version of idx(). * diff_patch.cc: Change to using idx() everywhere. @@ -16263,7 +16284,7 @@ * tests/t_cross.at: New test for merging merges. * testsuite.at: Call t_cross.at. -2003-10-10 graydon hoare +2003-10-10 Graydon Hoare * lua.hh, lua.cc (hook_apply_attribute): New hook. * work.hh, work.cc (apply_attributes): New function. @@ -16272,7 +16293,7 @@ * std_hooks.lua (temp_file): Use some env vars. (attr_functions): Make table of attr-setting functions. -2003-10-10 graydon hoare +2003-10-10 Graydon Hoare * work.cc: Fix add/drop inversion bug. * lua/*.{c,h}: Import lua 5.0 sources. @@ -16281,27 +16302,27 @@ tests/t_persist_phrase.at, configure.ac, config.h.in, Makefile.am: Modify to handle presence of lua 5.0. -2003-10-08 graydon hoare +2003-10-08 Graydon Hoare * rcs_import.cc: Attach aux certs to child, not parent. * manifest.cc: Speed up some calculations. * keys.cc: Optionally cache decoded keys. -2003-10-07 graydon hoare +2003-10-07 Graydon Hoare * manifest.hh, manifest.cc, rcs_import.cc: Write manifests w/o compression. * vocab.hh, vocab.cc: Don't re-verify verified data. * ui.hh, ui.cc: Minor efficiency tweaks. -2003-10-07 graydon hoare +2003-10-07 Graydon Hoare * commands.cc, work.cc, work.hh: Add some preliminary stuff to support explicit renaming, .mt-attrs. * monotone.texi: Add skeletal sections for command reference, hook reference, CVS phrasebook. Fill in some parts. -2003-10-02 graydon hoare +2003-10-02 Graydon Hoare * boost/circular_buffer*.hpp: Add. * AUTHORS, cert.cc, commands.cc, database.cc, @@ -16313,7 +16334,7 @@ logging and asserty stuff with boost::format objects rather than vsnprintf. -2003-10-01 graydon hoare +2003-10-01 Graydon Hoare * testsuite.at: Don't use getenv("HOSTNAME"). * database.cc (exec, fetch): Do va_end/va_start again in between @@ -16328,7 +16349,7 @@ * monotone.cc: Remove "monotone.db" default to --db option in help text. -2003-09-27 graydon hoare +2003-09-27 Graydon Hoare * diff_patch.cc: Rework conflict detection. * rcs_import.cc: Remove some pointless slowness. @@ -16336,7 +16357,7 @@ Release point (v 0.5). -2003-09-27 graydon hoare +2003-09-27 Graydon Hoare * AUTHORS, NEWS, configure.ac: Update for 0.5 release. * monotone.texi: Various updates. @@ -16344,7 +16365,7 @@ * database.cc (sql): Require --db for init. * work.cc (read_options_map): Fix options regex. -2003-09-27 graydon hoare +2003-09-27 Graydon Hoare * lcs.hh: New jaffer LCS algorithm. * interner.hh, rcs_import.cc: Templatize interner. @@ -16367,11 +16388,11 @@ set. * app_state.cc (app_state): Default to no database. -2003-09-26 graydon hoare +2003-09-26 Graydon Hoare * debian/*, monotone.spec: Add packaging control files. -2003-09-24 graydon hoare +2003-09-24 Graydon Hoare * database.cc, database.hh (debug): New function. * commands.cc (debug): New command. @@ -16381,13 +16402,13 @@ * commands.cc (list): List unknown, ignored files. * monotone.texi, monotone.1: Document. -2003-09-24 graydon hoare +2003-09-24 Graydon Hoare * commands.cc (queue_edge_for_target_ancestor): Queue the correct ancestry cert, from child to target, as well as patch_set. -2003-09-22 graydon hoare +2003-09-22 Graydon Hoare * depot_schema.sql, schema_migration.cc, schema_migration.hh: Add. @@ -16458,7 +16479,7 @@ (Commands): Mention "list branches". (Branches): Likewise. -2003-09-15 graydon hoare +2003-09-15 Graydon Hoare * http_tasks.cc: Fix networking to handle long input. @@ -16494,7 +16515,7 @@ * monotone.cc (cpp_main): Don't set initial database name on app. Use new settor methods. Don't look at MT_BRANCH or MT_DB. -2003-09-14 graydon hoare +2003-09-14 Graydon Hoare * vocab.cc, vocab.hh: Add streamers for vocab terms in preparation for switch to formatter. @@ -16517,7 +16538,7 @@ * tests/t_http.at: If we can't find boa or depot.cgi, skip the test. -2003-09-12 graydon hoare +2003-09-12 Graydon Hoare * update.cc (pick_update_target): Only insert base rev as update candidate if it actually exists in db. @@ -16548,7 +16569,7 @@ * Makefile.am (TESTS): unit_tests is not in srcdir. -2003-09-11 graydon hoare +2003-09-11 Graydon Hoare * commands.cc: Check for MT directory in status. * commands.cc: Require directory for checkout. @@ -16568,7 +16589,7 @@ * commands.cc, monotone.cc: Report unknown commands nicely. -2003-09-08 graydon hoare +2003-09-08 Graydon Hoare * tests/merge.at: Accept tromey's non-error case for update. @@ -16597,7 +16618,7 @@ * texinfo.tex, INSTALL, Makefile.in, aclocal.m4, compile, depcomp, install-sh, missing, mkinstalldirs: Removed generated files. -2003-09-04 graydon hoare +2003-09-04 Graydon Hoare * Makefile.am, depot.cc, http_tasks.cc, http_tasks.hh, lua.cc, lua.hh, monotone.texi, network.cc, tests/t_http.at, @@ -16615,13 +16636,13 @@ Release point (v 0.4). -2003-09-03 graydon hoare +2003-09-03 Graydon Hoare * monotone.texi: Expand notes about setting up depot. * update.cc: Update by ancestry. Duh. -2003-09-02 graydon hoare +2003-09-02 Graydon Hoare * boost/socket/streambuf.hpp: Bump ppos on overflow. @@ -16660,7 +16681,7 @@ HAVE_LIBLUALIB templates. * lua.cc: Include config.h. Use LUA_H, LIBLUA_H macros. -2003-08-29 graydon hoare +2003-08-29 Graydon Hoare * Makefile.am, txt2c.cc, lua.cc, database.cc: Use a C constant-building converter rather than objcopy. @@ -16674,12 +16695,12 @@ Modify packet queueing strategy to select ancestors from known network server content, rather than most recent edge. -2003-08-25 graydon hoare +2003-08-25 Graydon Hoare * AUTHORS, ChangeLog, Makefile.am, NEWS, configure.ac, tests/t_http.at: Release point (v 0.3) -2003-08-24 graydon hoare +2003-08-24 Graydon Hoare * nntp_tasks.cc: Measure success from postlines state. * network.cc: Print summary counts of transmissions. @@ -16690,13 +16711,13 @@ * monotone.texi: Update to reflect depot existence. * http_tasks.cc: Pick bugs out. -2003-08-24 graydon hoare +2003-08-24 Graydon Hoare * commands.cc: Wash certs before output. * *.cc,*.hh: Adjust cert packet format to be more readable, avoid superfluous gzipping. -2003-08-24 graydon hoare +2003-08-24 Graydon Hoare * configure, Makefile.in: Remove generated files, oops. * commands.cc: Implement 'propagate'. @@ -16706,7 +16727,7 @@ * diff_patch.hh, diff_patch.cc: Implement basic merge2-on-manifest. -2003-08-23 graydon hoare +2003-08-23 Graydon Hoare * monotone.cc: Handle user-defined lua hooks as overriding internal / .monotonerc hooks no matter @@ -16728,7 +16749,7 @@ * database.cc: Include "sqlite/sqlite.h", not . -2003-08-20 graydon hoare +2003-08-20 Graydon Hoare * boost/*: incorporate boost sandbox bits, for now. @@ -16739,7 +16760,7 @@ fix up networking layer to pass nntp tests again -2003-08-19 graydon hoare +2003-08-19 Graydon Hoare * Makefile.am, Makefile.in, app_state.hh, cert.cc, commands.cc, constants.hh, cryptopp/misc.h, database.cc, depot.cc, @@ -16754,21 +16775,21 @@ - implement nicer failure modes for sanity. - redo commands to print nicer, fail nicer. -2003-08-18 graydon hoare +2003-08-18 Graydon Hoare * Makefile.am, Makefile.in, adler32.hh, database.cc, depot.cc, mac.hh, xdelta.cc, Makefile.am, Makefile.in: first pass at a depot (CGI-based packet service) -2003-08-08 graydon hoare +2003-08-08 Graydon Hoare * Makefile.am, Makefile.in AUTHORS, ChangeLog, Makefile.am, Makefile.in, NEWS, monotone.1, monotone.info, monotone.texi: release point (v 0.2) -2003-08-08 graydon hoare +2003-08-08 Graydon Hoare * cert.cc, cert.hh, interner.hh, rcs_import.cc: @@ -16779,7 +16800,7 @@ improvements to cycle detection stuff -2003-08-05 graydon hoare +2003-08-05 Graydon Hoare * rcs_import.cc: @@ -16797,7 +16818,7 @@ cvs import seems to be working, but several linear algorithms need replacement -2003-07-28 graydon hoare +2003-07-28 Graydon Hoare * Makefile.am, Makefile.in, cert.cc, commands.cc, database.cc, database.hh, manifest.cc, rcs_file.cc, rcs_import.cc, @@ -16805,38 +16826,38 @@ cvs graph reconstruction hobbling along. -2003-07-21 graydon hoare +2003-07-21 Graydon Hoare * database.cc, xdelta.cc, xdelta.hh: piecewise xdelta; improves speed a fair bit. -2003-07-11 graydon hoare +2003-07-11 Graydon Hoare * Makefile.am, Makefile.in, config.h.in, configure, configure.ac, transforms.cc, xdelta.cc, xdelta.hh: implement xdelta by hand, forget 3rd party delta libs. -2003-07-02 graydon hoare +2003-07-02 Graydon Hoare * database.cc, rcs_import.cc, transforms.cc, transforms.hh: speedups all around in the storage system -2003-07-01 graydon hoare +2003-07-01 Graydon Hoare * database.hh, rcs_import.cc, transforms.cc, transforms.hh: speed improvements to RCS import -2003-06-30 graydon hoare +2003-06-30 Graydon Hoare * rcs_import.cc, transforms.cc: some speed improvements to RCS import -2003-06-29 graydon hoare +2003-06-29 Graydon Hoare * commands.cc, database.hh, rcs_import.cc, transforms.cc: @@ -16848,12 +16869,12 @@ Makefile.am: preliminary support for reading and walking RCS files -2003-04-09 graydon hoare +2003-04-09 Graydon Hoare * autogen.sh: oops * */*: savannah import -2003-04-06 graydon hoare +2003-04-06 Graydon Hoare * initial release. ============================================================ --- annotate.cc f77b679344341a4af199df9b59efd49b4676a6af +++ annotate.cc 7655d63779fde07e30bbd6b2b4a5c74378175a5d @@ -1,18 +1,22 @@ -// -*- mode: C++; c-file-style: "gnu"; indent-tabs-mode: nil -*- -// copyright (C) 2005 emile snyder -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// Copyright (C) 2005 Emile Snyder +// +// 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. -#include -#include #include #include +#include +#include #include #include "annotate.hh" #include "app_state.hh" +#include "cert.hh" #include "constants.hh" #include "cset.hh" #include "interner.hh" @@ -20,11 +24,10 @@ #include "platform.hh" #include "revision.hh" #include "sanity.hh" -#include "transforms.hh" #include "simplestring_xform.hh" -#include "vocab.hh" -#include "cert.hh" +#include "transforms.hh" #include "ui.hh" +#include "vocab.hh" using std::auto_ptr; using std::back_insert_iterator; @@ -39,14 +42,15 @@ using std::string; using std::vector; -using boost::shared_ptr; +using boost::shared_ptr; class annotate_lineage_mapping; -class annotate_context { +class annotate_context +{ public: - annotate_context(file_id fid, app_state &app); + annotate_context(file_id fid, app_state & app); shared_ptr initial_lineage() const; @@ -65,63 +69,75 @@ void dump(app_state & app) const; - string get_line(int line_index) const { return file_lines[line_index]; } + string get_line(int line_index) const + { + return file_lines[line_index]; + } private: - void build_revisions_to_annotations(app_state & app, map & revs_to_notations) const; + void build_revisions_to_annotations(app_state & app, + map & r2a) const; vector file_lines; vector annotations; - /// equivalent_lines[n] = m means that line n should be blamed to the same + /// equivalent_lines[n] = m means that line n should be blamed to the same /// revision as line m map equivalent_lines; /// keep a count so we can tell quickly whether we can terminate size_t annotated_lines_completed; - // elements of the set are indexes into the array of lines in the UDOI - // lineages add entries here when they notice that they copied a line from the UDOI + // elements of the set are indexes into the array of lines in the + // UDOI lineages add entries here when they notice that they copied + // a line from the UDOI set copied_lines; - // similarly, lineages add entries here for all the lines from the UDOI they know about that they didn't copy + // similarly, lineages add entries here for all the lines from the + // UDOI they know about that they didn't copy set touched_lines; }; /* - An annotate_lineage_mapping tells you, for each line of a file, where in the - ultimate descendent of interest (UDOI) the line came from (a line not - present in the UDOI is represented as -1). + An annotate_lineage_mapping tells you, for each line of a file, + where in the ultimate descendent of interest (UDOI) the line came + from (a line not present in the UDOI is represented as -1). */ -class annotate_lineage_mapping { +class annotate_lineage_mapping +{ public: - annotate_lineage_mapping(const file_data &data); - annotate_lineage_mapping(const vector &lines); + annotate_lineage_mapping(file_data const & data); + annotate_lineage_mapping(vector const & lines); // debugging //bool equal_interned (const annotate_lineage_mapping &rhs) const; - /// need a better name. does the work of setting copied bits in the context object. - shared_ptr - build_parent_lineage(shared_ptr acp, revision_id parent_rev, const file_data &parent_data) const; + /// need a better name. does the work of setting copied bits in the + /// context object. + shared_ptr + build_parent_lineage(shared_ptr acp, + revision_id parent_rev, + file_data const & parent_data) const; - void merge(const annotate_lineage_mapping &other, const shared_ptr &acp); + void merge(annotate_lineage_mapping const & other, + shared_ptr const & acp); void credit_mapped_lines(shared_ptr acp) const; void set_copied_all_mapped(shared_ptr acp) const; private: - void init_with_lines(const vector &lines); + void init_with_lines(vector const & lines); - static interner in; // FIX, testing hack + static interner in; // FIX, testing hack vector file_interned; - // maps an index into the vector of lines for our current version of the file - // into an index into the vector of lines of the UDOI: - // eg. if the line file_interned[i] will turn into line 4 in the UDOI, mapping[i] = 4 + // maps an index into the vector of lines for our current version of + // the file into an index into the vector of lines of the UDOI: + // eg. if the line file_interned[i] will turn into line 4 in the + // UDOI, mapping[i] = 4 vector mapping; }; @@ -130,56 +146,70 @@ /* - annotate_node_work encapsulates the input data needed to process + annotate_node_work encapsulates the input data needed to process the annotations for a given childrev, considering all the childrev -> parentrevN edges. */ -struct annotate_node_work { +struct annotate_node_work +{ annotate_node_work(shared_ptr annotations_, shared_ptr lineage_, - revision_id revision_, node_id fid_)//, file_path node_fpath_) - : annotations(annotations_), + revision_id revision_, node_id fid_) + : annotations(annotations_), lineage(lineage_), - revision(revision_), - fid(fid_)//, node_fpath(node_fpath_) + revision(revision_), + fid(fid_) {} - annotate_node_work(const annotate_node_work &w) - : annotations(w.annotations), + + annotate_node_work(annotate_node_work const & w) + : annotations(w.annotations), lineage(w.lineage), revision(w.revision), - fid(w.fid) //, node_fpath(w.node_fpath) + fid(w.fid) {} shared_ptr annotations; shared_ptr lineage; revision_id revision; - //file_id node_fid; node_id fid; - //file_path node_fpath; }; -class lineage_merge_node { +class lineage_merge_node +{ public: typedef shared_ptr splm; - lineage_merge_node(const lineage_merge_node &m) - : work(m.work), incoming_edges(m.incoming_edges), completed_edges(m.completed_edges) + lineage_merge_node(lineage_merge_node const & m) + : work(m.work), + incoming_edges(m.incoming_edges), + completed_edges(m.completed_edges) {} lineage_merge_node(annotate_node_work wu, size_t incoming) - : work(wu), incoming_edges(incoming), completed_edges(1) + : work(wu), + incoming_edges(incoming), + completed_edges(1) {} - - void merge(splm incoming, const shared_ptr &acp) - { + + void merge(splm incoming, + shared_ptr const & acp) + { work.lineage->merge(*incoming, acp); completed_edges++; } - bool iscomplete () const { I(completed_edges <= incoming_edges); return incoming_edges == completed_edges; } - - annotate_node_work get_work() const { I(iscomplete()); return work; } + bool iscomplete() const + { + I(completed_edges <= incoming_edges); + return incoming_edges == completed_edges; + } + annotate_node_work get_work() const + { + I(iscomplete()); + return work; + } + private: annotate_node_work work; size_t incoming_edges; @@ -190,7 +220,7 @@ -annotate_context::annotate_context(file_id fid, app_state &app) +annotate_context::annotate_context(file_id fid, app_state & app) : annotated_lines_completed(0) { // initialize file_lines @@ -198,14 +228,16 @@ app.db.get_file_version(fid, fpacked); string encoding = constants::default_encoding; // FIXME split_into_lines(fpacked.inner()(), encoding, file_lines); - L(FL("annotate_context::annotate_context initialized with %d file lines\n") % file_lines.size()); + L(FL("annotate_context::annotate_context initialized " + "with %d file lines\n") % file_lines.size()); // initialize annotations revision_id nullid; annotations.clear(); annotations.reserve(file_lines.size()); annotations.insert(annotations.begin(), file_lines.size(), nullid); - L(FL("annotate_context::annotate_context initialized with %d entries in annotations\n") % annotations.size()); + L(FL("annotate_context::annotate_context initialized " + "with %d entries in annotations\n") % annotations.size()); // initialize copied_lines and touched_lines copied_lines.clear(); @@ -213,15 +245,16 @@ } -shared_ptr +shared_ptr annotate_context::initial_lineage() const { - shared_ptr res(new annotate_lineage_mapping(file_lines)); + shared_ptr + res(new annotate_lineage_mapping(file_lines)); return res; } -void +void annotate_context::evaluate(revision_id rev) { revision_id nullid; @@ -235,26 +268,35 @@ inserter(credit_lines, credit_lines.begin())); set::const_iterator i; - for (i = credit_lines.begin(); i != credit_lines.end(); i++) { - I(*i < annotations.size()); - if (annotations[*i] == nullid) { - //L(FL("evaluate setting annotations[%d] -> %s, since touched_lines contained %d, copied_lines didn't and annotations[%d] was nullid\n") - // % *i % rev % *i % *i); - annotations[*i] = rev; - annotated_lines_completed++; - } else { - //L(FL("evaluate LEAVING annotations[%d] -> %s\n") % *i % annotations[*i]); + for (i = credit_lines.begin(); i != credit_lines.end(); i++) + { + I(*i < annotations.size()); + if (annotations[*i] == nullid) + { + + // L(FL("evaluate setting annotations[%d] -> %s, since " + // "touched_lines contained %d, copied_lines didn't and " + // "annotations[%d] was nullid\n") % *i % rev % *i % *i); + + annotations[*i] = rev; + annotated_lines_completed++; + } + else + { + //L(FL("evaluate LEAVING annotations[%d] -> %s\n") + // % *i % annotations[*i]); + } } - } - + copied_lines.clear(); touched_lines.clear(); } -void +void annotate_context::set_copied(int index) { //L(FL("annotate_context::set_copied %d\n") % index); + if (index == -1) return; @@ -262,10 +304,11 @@ copied_lines.insert(index); } -void +void annotate_context::set_touched(int index) { //L(FL("annotate_context::set_touched %d\n") % index); + if (index == -1) return; @@ -276,7 +319,8 @@ void annotate_context::set_equivalent(int index, int index2) { - L(FL("annotate_context::set_equivalent index %d index2 %d\n") % index % index2); + L(FL("annotate_context::set_equivalent " + "index %d index2 %d\n") % index % index2); equivalent_lines[index] = index2; } @@ -285,17 +329,21 @@ { revision_id null_id; - for (size_t i=0; i::const_iterator j = equivalent_lines.find(i); - if (j == equivalent_lines.end()) { - L(FL("annotate_equivalent_lines unable to find equivalent for line %d\n") % i); - } - I(j != equivalent_lines.end()); - annotations[i] = annotations[j->second]; - annotated_lines_completed++; + for (size_t i=0; i::const_iterator j = equivalent_lines.find(i); + if (j == equivalent_lines.end()) + { + L(FL("annotate_equivalent_lines unable to find " + "equivalent for line %d\n") % i); + } + I(j != equivalent_lines.end()); + annotations[i] = annotations[j->second]; + annotated_lines_completed++; + } } - } } bool @@ -310,28 +358,28 @@ string cert_string_value(vector< revision > const & certs, - const string & name, - bool from_start, bool from_end, - const string & sep) + string const & name, + bool from_start, bool from_end, + string const & sep) { - for (vector < revision < cert > >::const_iterator i = certs.begin (); - i != certs.end (); ++i) + for (vector< revision >::const_iterator i = certs.begin(); + i != certs.end(); ++i) { - if (i->inner ().name () == name) + if (i->inner().name() == name) { cert_value tv; - decode_base64 (i->inner ().value, tv); + decode_base64 (i->inner().value, tv); string::size_type f = 0; string::size_type l = string::npos; if (from_start) - l = tv ().find_first_of (sep); + l = tv ().find_first_of(sep); if (from_end) { - f = tv ().find_last_of (sep); + f = tv ().find_last_of(sep); if (f == string::npos) f = 0; } - return tv ().substr (f, l); + return tv().substr(f, l); } } @@ -340,14 +388,16 @@ void -annotate_context::build_revisions_to_annotations(app_state &app, - map &revs_to_notations) const +annotate_context::build_revisions_to_annotations +(app_state & app, + map & revs_to_notations) const { I(annotations.size() == file_lines.size()); // build set of unique revisions present in annotations set seen; - for (vector::const_iterator i = annotations.begin(); i != annotations.end(); i++) + for (vector::const_iterator i = annotations.begin(); + i != annotations.end(); i++) { seen.insert(*i); } @@ -355,15 +405,19 @@ size_t max_note_length = 0; // build revision -> annotation string mapping - for (set::const_iterator i = seen.begin(); i != seen.end(); i++) + for (set::const_iterator i = seen.begin(); + i != seen.end(); i++) { vector< revision > certs; app.db.get_revision_certs(*i, certs); erase_bogus_certs(certs, app); - string author(cert_string_value(certs, author_cert_name, true, false, "@< ")); - string date(cert_string_value(certs, date_cert_name, true, false, "T")); + string author(cert_string_value(certs, author_cert_name, + true, false, "@< ")); + string date(cert_string_value(certs, date_cert_name, + true, false, "T")); + string result; result.append((*i).inner ()().substr(0, 8)); result.append(".. by "); @@ -372,12 +426,15 @@ result.append(date); result.append(": "); - max_note_length = (result.size() > max_note_length) ? result.size() : max_note_length; + max_note_length = ((result.size() > max_note_length) + ? result.size() + : max_note_length); revs_to_notations[*i] = result; } // justify annotation strings - for (map::iterator i = revs_to_notations.begin(); i != revs_to_notations.end(); i++) + for (map::iterator i = revs_to_notations.begin(); + i != revs_to_notations.end(); i++) { size_t l = i->second.size(); i->second.insert(string::size_type(0), max_note_length - l, ' '); @@ -386,14 +443,14 @@ void -annotate_context::dump(app_state &app) const +annotate_context::dump(app_state & app) const { revision_id nullid; I(annotations.size() == file_lines.size()); map revs_to_notations; string empty_note; - if (global_sanity.brief) + if (global_sanity.brief) { build_revisions_to_annotations(app, revs_to_notations); size_t max_note_length = revs_to_notations.begin()->second.size(); @@ -401,24 +458,27 @@ } revision_id lastid = nullid; - for (size_t i=0; i lines; @@ -428,38 +488,44 @@ init_with_lines(lines); } -annotate_lineage_mapping::annotate_lineage_mapping(const vector &lines) +annotate_lineage_mapping::annotate_lineage_mapping +(vector const & lines) { init_with_lines(lines); } /* bool -annotate_lineage_mapping::equal_interned (const annotate_lineage_mapping &rhs) const +annotate_lineage_mapping::equal_interned +(annotate_lineage_mapping const & rhs) const { bool result = true; if (file_interned.size() != rhs.file_interned.size()) { - L(FL("annotate_lineage_mapping::equal_interned lhs size %d != rhs size %d\n") + L(FL("annotate_lineage_mapping::equal_interned " + "lhs size %d != rhs size %d\n") % file_interned.size() % rhs.file_interned.size()); result = false; } size_t limit = min(file_interned.size(), rhs.file_interned.size()); - for (size_t i=0; i &lines) +annotate_lineage_mapping::init_with_lines(vector const & lines) { file_interned.clear(); file_interned.reserve(lines.size()); @@ -468,147 +534,180 @@ int count; vector::const_iterator i; - for (count=0, i = lines.begin(); i != lines.end(); i++, count++) { - file_interned.push_back(in.intern(*i)); - mapping.push_back(count); - } - L(FL("annotate_lineage_mapping::init_with_lines ending with %d entries in mapping\n") % mapping.size()); + for (count=0, i = lines.begin(); i != lines.end(); i++, count++) + { + file_interned.push_back(in.intern(*i)); + mapping.push_back(count); + } + L(FL("annotate_lineage_mapping::init_with_lines " + "ending with %d entries in mapping\n") % mapping.size()); } shared_ptr -annotate_lineage_mapping::build_parent_lineage(shared_ptr acp, - revision_id parent_rev, - const file_data &parent_data) const +annotate_lineage_mapping::build_parent_lineage +(shared_ptr acp, + revision_id parent_rev, + file_data const & parent_data) const { bool verbose = false; - shared_ptr parent_lineage(new annotate_lineage_mapping(parent_data)); + shared_ptr + parent_lineage(new annotate_lineage_mapping(parent_data)); vector lcs; back_insert_iterator< vector > bii(lcs); - longest_common_subsequence(file_interned.begin(), + longest_common_subsequence(file_interned.begin(), file_interned.end(), - parent_lineage->file_interned.begin(), + parent_lineage->file_interned.begin(), parent_lineage->file_interned.end(), - min(file_interned.size(), parent_lineage->file_interned.size()), + min(file_interned.size(), + parent_lineage->file_interned.size()), back_inserter(lcs)); if (verbose) - L(FL("build_parent_lineage: file_lines.size() == %d, parent.file_lines.size() == %d, lcs.size() == %d\n") - % file_interned.size() % parent_lineage->file_interned.size() % lcs.size()); + L(FL("build_parent_lineage: " + "file_lines.size() == %d, " + "parent.file_lines.size() == %d, " + "lcs.size() == %d\n") + % file_interned.size() + % parent_lineage->file_interned.size() + % lcs.size()); // do the copied lines thing for our annotate_context vector lcs_src_lines; lcs_src_lines.resize(lcs.size()); size_t i, j; i = j = 0; - while (i < file_interned.size() && j < lcs.size()) { - //if (verbose) - if (file_interned[i] == 14) - L(FL("%s file_interned[%d]: %ld\tlcs[%d]: %ld\tmapping[%d]: %ld\n") - % parent_rev % i % file_interned[i] % j % lcs[j] % i % mapping[i]); - - if (file_interned[i] == lcs[j]) { - acp->set_copied(mapping[i]); - lcs_src_lines[j] = mapping[i]; - j++; - } else { - acp->set_touched(mapping[i]); + while (i < file_interned.size() && j < lcs.size()) + { + //if (verbose) + if (file_interned[i] == 14) + L(FL("%s file_interned[%d]: %ld\tlcs[%d]: %ld\tmapping[%d]: %ld\n") + % parent_rev % i % file_interned[i] % j % lcs[j] % i % mapping[i]); + + if (file_interned[i] == lcs[j]) + { + acp->set_copied(mapping[i]); + lcs_src_lines[j] = mapping[i]; + j++; + } + else + { + acp->set_touched(mapping[i]); + } + + i++; } - - i++; - } if (verbose) - L(FL("loop ended with i: %d, j: %d, lcs.size(): %d\n") % i % j % lcs.size()); + L(FL("loop ended with i: %d, j: %d, lcs.size(): %d\n") + % i % j % lcs.size()); I(j == lcs.size()); // set touched for the rest of the lines in the file - while (i < file_interned.size()) { - acp->set_touched(mapping[i]); - i++; - } - + while (i < file_interned.size()) + { + acp->set_touched(mapping[i]); + i++; + } + // determine the mapping for parent lineage if (verbose) - L(FL("build_parent_lineage: building mapping now for parent_rev %s\n") % parent_rev); + L(FL("build_parent_lineage: building mapping now " + "for parent_rev %s\n") % parent_rev); + i = j = 0; - while (i < parent_lineage->file_interned.size() && j < lcs.size()) { - if (parent_lineage->file_interned[i] == lcs[j]) { - parent_lineage->mapping[i] = lcs_src_lines[j]; - j++; - } else { - parent_lineage->mapping[i] = -1; + + while (i < parent_lineage->file_interned.size() && j < lcs.size()) + { + if (parent_lineage->file_interned[i] == lcs[j]) + { + parent_lineage->mapping[i] = lcs_src_lines[j]; + j++; + } + else + { + parent_lineage->mapping[i] = -1; + } + if (verbose) + L(FL("mapping[%d] -> %d\n") % i % parent_lineage->mapping[i]); + + i++; } - if (verbose) - L(FL("mapping[%d] -> %d\n") % i % parent_lineage->mapping[i]); - - i++; - } I(j == lcs.size()); // set mapping for the rest of the lines in the file - while (i < parent_lineage->file_interned.size()) { - parent_lineage->mapping[i] = -1; - if (verbose) - L(FL("mapping[%d] -> %d\n") % i % parent_lineage->mapping[i]); - i++; - } - + while (i < parent_lineage->file_interned.size()) + { + parent_lineage->mapping[i] = -1; + if (verbose) + L(FL("mapping[%d] -> %d\n") % i % parent_lineage->mapping[i]); + i++; + } + return parent_lineage; } void -annotate_lineage_mapping::merge(const annotate_lineage_mapping &other, - const shared_ptr &acp) +annotate_lineage_mapping::merge(annotate_lineage_mapping const & other, + shared_ptr const & acp) { I(file_interned.size() == other.file_interned.size()); I(mapping.size() == other.mapping.size()); //I(equal_interned(other)); // expensive check - for (size_t i=0; i= 0) - mapping[i] = other.mapping[i]; + for (size_t i=0; i= 0) + mapping[i] = other.mapping[i]; - if (mapping[i] >= 0 && other.mapping[i] >= 0) { - //I(mapping[i] == other.mapping[i]); - if (mapping[i] != other.mapping[i]) { - // a given line in the current merged mapping will split and become - // multiple lines in the UDOI. so we have to remember that whenever we - // ultimately assign blame for mapping[i] we blame the same revision - // on other.mapping[i]. - acp->set_equivalent(other.mapping[i], mapping[i]); - } + if (mapping[i] >= 0 && other.mapping[i] >= 0) + { + //I(mapping[i] == other.mapping[i]); + if (mapping[i] != other.mapping[i]) + { + // a given line in the current merged mapping will split + // and become multiple lines in the UDOI. so we have to + // remember that whenever we ultimately assign blame for + // mapping[i] we blame the same revision on + // other.mapping[i]. + acp->set_equivalent(other.mapping[i], mapping[i]); + } + } } - } } void -annotate_lineage_mapping::credit_mapped_lines (shared_ptr acp) const +annotate_lineage_mapping::credit_mapped_lines +(shared_ptr acp) const { vector::const_iterator i; - for (i=mapping.begin(); i != mapping.end(); i++) { - acp->set_touched(*i); - } + for (i=mapping.begin(); i != mapping.end(); i++) + { + acp->set_touched(*i); + } } -void -annotate_lineage_mapping::set_copied_all_mapped (shared_ptr acp) const +void +annotate_lineage_mapping::set_copied_all_mapped +(shared_ptr acp) const { vector::const_iterator i; - for (i=mapping.begin(); i != mapping.end(); i++) { - acp->set_copied(*i); - } + for (i=mapping.begin(); i != mapping.end(); i++) + { + acp->set_copied(*i); + } } static void -do_annotate_node (const annotate_node_work &work_unit, - app_state &app, - deque &nodes_to_process, - set &nodes_complete, - const map &paths_to_nodes, - map &pending_merge_nodes) +do_annotate_node +(annotate_node_work const & work_unit, + app_state & app, + deque & nodes_to_process, + set & nodes_complete, + map const & paths_to_nodes, + map & pending_merge_nodes) { L(FL("do_annotate_node for node %s\n") % work_unit.revision); I(nodes_complete.find(work_unit.revision) == nodes_complete.end()); @@ -618,13 +717,16 @@ marking_map markmap; app.db.get_roster(work_unit.revision, roster, markmap); marking_t marks; - map::const_iterator mmi = markmap.find(work_unit.fid); + + map::const_iterator mmi = + markmap.find(work_unit.fid); I(mmi != markmap.end()); marks = mmi->second; if (marks.file_content.size() == 0) { - L(FL("found empty content-mark set at rev %s\n") % work_unit.revision); + L(FL("found empty content-mark set at rev %s\n") + % work_unit.revision); work_unit.lineage->credit_mapped_lines(work_unit.annotations); work_unit.annotations->evaluate(work_unit.revision); nodes_complete.insert(work_unit.revision); @@ -633,32 +735,34 @@ set parents; - // If we have content-marks which are *not* equal to the current rev, - // we can jump back to them directly. If we have only a content-mark - // equal to the current rev, it means we made a decision here, and - // we must move to the immediate parent revs. + // If we have content-marks which are *not* equal to the current + // rev, we can jump back to them directly. If we have only a + // content-mark equal to the current rev, it means we made a + // decision here, and we must move to the immediate parent revs. // // Unfortunately, while this algorithm *could* use the marking // information as suggested above, it seems to work much better - // (especially wrt. merges) when it goes rev-by-rev, so we leave it that - // way for now. - - // if (marks.file_content.size() == 1 + // (especially wrt. merges) when it goes rev-by-rev, so we leave it + // that way for now. + + // if (marks.file_content.size() == 1 // && *(marks.file_content.begin()) == work_unit.revision) + app.db.get_revision_parents(work_unit.revision, parents); + // else // parents = marks.file_content; size_t added_in_parent_count = 0; - for (set::const_iterator i = parents.begin(); + for (set::const_iterator i = parents.begin(); i != parents.end(); i++) { revision_id parent_revision = *i; roster_t parent_roster; marking_map parent_marks; - L(FL("do_annotate_node processing edge from parent %s to child %s\n") + L(FL("do_annotate_node processing edge from parent %s to child %s\n") % parent_revision % work_unit.revision); I(!(work_unit.revision == parent_revision)); @@ -672,79 +776,88 @@ } // The node was live in the parent, so this represents a delta. - file_t file_in_child = downcast_to_file_t(roster.get_node(work_unit.fid)); - file_t file_in_parent = downcast_to_file_t(parent_roster.get_node(work_unit.fid)); + file_t file_in_child = + downcast_to_file_t(roster.get_node(work_unit.fid)); + file_t file_in_parent = + downcast_to_file_t(parent_roster.get_node(work_unit.fid)); + shared_ptr parent_lineage; if (file_in_parent->content == file_in_child->content) { - L(FL("parent file identical, set copied all mapped and copy lineage\n")); + L(FL("parent file identical, " + "set copied all mapped and copy lineage\n")); parent_lineage = work_unit.lineage; parent_lineage->set_copied_all_mapped(work_unit.annotations); } else { file_data data; - app.db.get_file_version(file_in_parent->content, data); - L(FL("building parent lineage for parent file %s\n") % file_in_parent->content); - parent_lineage = work_unit.lineage->build_parent_lineage(work_unit.annotations, - parent_revision, - data); + app.db.get_file_version(file_in_parent->content, data); + L(FL("building parent lineage for parent file %s\n") + % file_in_parent->content); + parent_lineage + = work_unit.lineage->build_parent_lineage(work_unit.annotations, + parent_revision, + data); } // If this parent has not yet been queued for processing, create the // work unit for it. - map::iterator lmn + map::iterator lmn = pending_merge_nodes.find(parent_revision); - if (lmn == pending_merge_nodes.end()) + if (lmn == pending_merge_nodes.end()) { // Once we move on to processing the parent that this file was // renamed from, we'll need the old name - annotate_node_work newunit(work_unit.annotations, - parent_lineage, - parent_revision, + annotate_node_work newunit(work_unit.annotations, + parent_lineage, + parent_revision, work_unit.fid); - map::const_iterator ptn + map::const_iterator ptn = paths_to_nodes.find(parent_revision); - if (ptn->second > 1) + if (ptn->second > 1) { lineage_merge_node nmn(newunit, ptn->second); pending_merge_nodes.insert(make_pair(parent_revision, nmn)); - L(FL("put new merge node on pending_merge_nodes for parent %s\n") + L(FL("put new merge node on pending_merge_nodes " + "for parent %s\n") % parent_revision); // just checking... //(pending_merge_nodes.find(parent_revision))->second.dump(); } - else + else { - L(FL("single path to node, just stick work on the queue for parent %s\n") + L(FL("single path to node, just stick work on the queue " + "for parent %s\n") % parent_revision); nodes_to_process.push_back(newunit); } - } - else + } + else { // Already a pending node, so we just have to merge the lineage // and decide whether to move it over to the nodes_to_process // queue. - L(FL("merging lineage from node %s to parent %s\n") + L(FL("merging lineage from node %s to parent %s\n") % work_unit.revision % parent_revision); lmn->second.merge(parent_lineage, work_unit.annotations); //L(FL("after merging from work revision %s to parent %s" - // " lineage_merge_node is:\n") % work_unit.revision + // " lineage_merge_node is:\n") % work_unit.revision // % parent_revision); lmn->second.dump(); - if (lmn->second.iscomplete()) { - nodes_to_process.push_back(lmn->second.get_work()); - pending_merge_nodes.erase(lmn); - } + if (lmn->second.iscomplete()) + { + nodes_to_process.push_back(lmn->second.get_work()); + pending_merge_nodes.erase(lmn); + } } } - - if (added_in_parent_count == parents.size()) + + if (added_in_parent_count == parents.size()) { work_unit.lineage->credit_mapped_lines(work_unit.annotations); } @@ -754,8 +867,10 @@ } -void -find_ancestors(app_state &app, revision_id rid, map &paths_to_nodes) +void +find_ancestors(app_state & app, + revision_id rid, + map & paths_to_nodes) { vector frontier; frontier.push_back(rid); @@ -770,7 +885,9 @@ for (set::const_iterator i = parents.begin(); i != parents.end(); ++i) { - map::iterator found = paths_to_nodes.find(*i); + map::iterator found + = paths_to_nodes.find(*i); + if (found == paths_to_nodes.end()) { frontier.push_back(*i); @@ -785,14 +902,18 @@ } } -void +void do_annotate (app_state &app, file_t file_node, revision_id rid) { - L(FL("annotating file %s with content %s in revision %s\n") % file_node->self % file_node->content % rid); + L(FL("annotating file %s with content %s in revision %s\n") + % file_node->self % file_node->content % rid); - shared_ptr acp(new annotate_context(file_node->content, app)); - shared_ptr lineage = acp->initial_lineage(); + shared_ptr + acp(new annotate_context(file_node->content, app)); + shared_ptr lineage + = acp->initial_lineage(); + set nodes_complete; map paths_to_nodes; map pending_merge_nodes; @@ -800,22 +921,32 @@ // build node work unit deque nodes_to_process; - annotate_node_work workunit(acp, lineage, rid, file_node->self); //, fpath); + annotate_node_work workunit(acp, lineage, rid, file_node->self); nodes_to_process.push_back(workunit); auto_ptr revs_ticker(new ticker(N_("revs done"), "r", 1)); revs_ticker->set_total(paths_to_nodes.size() + 1); - while (nodes_to_process.size() && !acp->is_complete()) + + while (nodes_to_process.size() && !acp->is_complete()) { annotate_node_work work = nodes_to_process.front(); nodes_to_process.pop_front(); - do_annotate_node(work, app, nodes_to_process, nodes_complete, paths_to_nodes, pending_merge_nodes); + do_annotate_node(work, app, nodes_to_process, nodes_complete, + paths_to_nodes, pending_merge_nodes); ++(*revs_ticker); } - + I(pending_merge_nodes.size() == 0); acp->annotate_equivalent_lines(); I(acp->is_complete()); acp->dump(app); } + +// 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: ============================================================ --- annotate.hh fa08bd0d934bb739c0ac61726c9c6b698605ad9f +++ annotate.hh 2c21ed973503781e799cb80b18ea83a3398010d1 @@ -1,16 +1,21 @@ #ifndef __ANNOTATE_HH__ #define __ANNOTATE_HH__ -// copyright (C) 2005 emile snyder -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// Copyright (C) 2005 Emile Snyder +// +// 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. #include "platform.hh" #include "vocab.hh" #include "revision.hh" #include "app_state.hh" -extern void do_annotate (app_state &app, file_t file_node, revision_id rid); +void +do_annotate(app_state &app, file_t file_node, revision_id rid); #endif // defined __ANNOTATE_HH__ ============================================================ --- app_state.cc 2af59d84eedf016fb3ad85d1c0e76667070d2fc6 +++ app_state.cc 624fa50ae7e30fd72155297dcc5954aa66e2d0b5 @@ -1,47 +1,58 @@ +// Copyright (C) 2002 Graydon Hoare +// +// 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. + +#include // for strtoul() #include #include #include -#include // for strtoul() -#include -#include #include #include +#include +#include -#include "ui.hh" +#include "botan/pubkey.h" +#include "botan/rsa.h" + #include "app_state.hh" +#include "charset.hh" #include "database.hh" #include "file_io.hh" +#include "platform.hh" #include "sanity.hh" -#include "charset.hh" +#include "ui.hh" #include "work.hh" -#include "platform.hh" using std::exception; using std::map; using std::string; +using std::vector; -// copyright (C) 2002, 2003 graydon hoare -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details - -using namespace std; - static string const database_option("database"); static string const branch_option("branch"); static string const key_option("key"); static string const keydir_option("keydir"); app_state::app_state() - : branch_name(""), db(system_path()), keys(this), recursive(false), + : branch_name(""), db(system_path()), + keys(this), recursive(false), stdhooks(true), rcfiles(true), diffs(false), - no_merges(false), set_default(false), verbose(false), date_set(false), + no_merges(false), set_default(false), + verbose(false), date_set(false), search_root(current_root_path()), - depth(-1), last(-1), next(-1), diff_format(unified_diff), diff_args_provided(false), + depth(-1), last(-1), next(-1), + diff_format(unified_diff), diff_args_provided(false), execute(false), bind_address(""), bind_port(""), - bind_stdio(false), use_transport_auth(true), missing(false), unknown(false), - confdir(get_default_confdir()), have_set_key_dir(false), no_files(false) + bind_stdio(false), use_transport_auth(true), + missing(false), unknown(false), + confdir(get_default_confdir()), + have_set_key_dir(false), no_files(false) { db.set_app(this); lua.set_app(this); @@ -84,9 +95,9 @@ bookkeeping_path dump_path; get_local_dump_path(dump_path); L(FL("setting dump path to %s\n") % dump_path); - // the 'true' means that, e.g., if we're running checkout, then it's - // okay for dumps to go into our starting working dir's _MTN rather - // than the new workspace dir's _MTN. + // The 'true' means that, e.g., if we're running checkout, + // then it's okay for dumps to go into our starting working + // dir's _MTN rather than the new workspace dir's _MTN. global_sanity.filename = system_path(dump_path, false); } } @@ -115,7 +126,8 @@ L(FL("branch name is '%s'\n") % branch_name()); if (!options[key_option]().empty()) - internalize_rsa_keypair_id(options[key_option], signing_key); + internalize_rsa_keypair_id(options[key_option], + signing_key); } } @@ -191,10 +203,10 @@ options[branch_option] = branch_name(); if (found_workspace) { - // already have a workspace, can (must) write options directly, - // because no-one else will do so - // if we don't have a workspace yet, then require_workspace (for - // instance) will call write_options when it finds one. + // Already have a workspace, can (must) write options directly, + // because no-one else will do so. If we don't have a workspace + // yet, then require_workspace (for instance) will call + // write_options when it finds one. write_options(); } } @@ -218,9 +230,10 @@ void app_state::set_root(system_path const & path) { - require_path_is_directory(path, - F("search root '%s' does not exist") % path, - F("search root '%s' is not a directory\n") % path); + require_path_is_directory + (path, + F("search root '%s' does not exist") % path, + F("search root '%s' is not a directory\n") % path); search_root = path; L(FL("set search root to %s\n") % search_root); } @@ -242,10 +255,9 @@ { try { - // boost::posix_time is lame: it can parse "basic" ISO times, of the - // form 20000101T120000, but not "extended" ISO times, of the form - // 2000-01-01T12:00:00. So do something stupid to convert one to the - // other. + // boost::posix_time can parse "basic" ISO times, of the form + // 20000101T120000, but not "extended" ISO times, of the form + // 2000-01-01T12:00:00. So convert one to the other. string tmp = d(); string::size_type pos = 0; while ((pos = tmp.find_first_of("-:")) != string::npos) @@ -255,7 +267,8 @@ } catch (exception &e) { - N(false, F("failed to parse date string '%s': %s") % d % e.what()); + N(false, F("failed to parse date string '%s': %s") + % d % e.what()); } } @@ -373,18 +386,18 @@ // rc files are loaded after we've changed to the workspace so that // _MTN/monotonerc can be loaded between ~/.monotone/monotonerc and other -// rcfiles +// rcfiles. void app_state::load_rcfiles() { - // built-in rc settings are defaults + // Built-in rc settings are defaults. if (stdhooks) lua.add_std_hooks(); // ~/.monotone/monotonerc overrides that, and - // _MTN/monotonerc overrides *that* + // _MTN/monotonerc overrides *that*. if (rcfiles) { @@ -396,7 +409,7 @@ lua.load_rcfile(workspace_rcfile, false); } - // command-line rcfiles override even that + // Command-line rcfiles override even that. for (vector::const_iterator i = extra_rcfiles.begin(); i != extra_rcfiles.end(); ++i) @@ -441,3 +454,11 @@ W(F("Failed to write options file %s") % o_path); } } + +// 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: ============================================================ --- app_state.hh 93a467f82e48fc13684a3796f0c93b6922a56842 +++ app_state.hh 1e1011728a2da0db22589ac19fe9de5b00d08680 @@ -1,34 +1,45 @@ #ifndef __APP_STATE_HH__ #define __APP_STATE_HH__ -// copyright (C) 2002, 2003 graydon hoare -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// Copyright (C) 2002 Graydon Hoare +// +// 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. class app_state; class lua_hooks; -#include -#include -#include +#include +#include + #include +#include -#include - #include "database.hh" +#include "key_store.hh" #include "lua_hooks.hh" +#include "paths.hh" +#include "vocab.hh" #include "work.hh" -#include "vocab.hh" -#include "paths.hh" -#include "key_store.hh" -// this class is supposed to hold all (or.. well, most) of the state of the -// application, barring some unfortunate static objects like the debugging / -// logging system and the command objects, for the time being. the vague intent -// being to make life easier for anyone who wants to embed this program as a -// library someday +namespace Botan +{ + class PK_Signer; + class RSA_PrivateKey; + class PK_Verifier; + class RSA_PublicKey; +}; +// This class is supposed to hold all (or.. well, most) of the state +// of the application, barring some unfortunate static objects like +// the debugging / logging system and the command objects, for the +// time being. The vague intent being to make life easier for anyone +// who wants to embed this program as a library someday. + class app_state { public: @@ -75,13 +86,17 @@ std::set attrs_to_drop; bool no_files; - std::map explicit_option_map; // set if the value of the flag was explicitly given on the command line + // Set if the value of the flag was explicitly given on the command + // line. + std::map explicit_option_map; void set_is_explicit_option (int option_id); bool is_explicit_option(int option_id) const; // These are used to cache signers/verifiers (if the hook allows). - // They can't be function-static variables in key.cc, since they must be - // destroyed before the Botan deinitialize() function is called. */ + // They can't be function-static variables in key.cc, since they + // must be destroyed before the Botan deinitialize() function is + // called. + std::map, boost::shared_ptr > > signers; @@ -94,12 +109,13 @@ void require_workspace(std::string const & explanation = ""); void create_workspace(system_path const & dir); - // Set the branch name. If you only invoke set_branch, the branch + // Set the branch name. If you only invoke set_branch, the branch // name is not sticky (and won't be written to the workspace and // reused by subsequent monotone invocations). Commands which // switch the working to a different branch should invoke // make_branch_sticky (before require_workspace because this // function updates the workspace). + void set_branch(utf8 const & name); void make_branch_sticky(); @@ -134,8 +150,8 @@ explicit app_state(); ~app_state(); - // only use set_prog_name to set this; changes need to be propagated to the - // global ui object + // Only use set_prog_name to set this; changes need to be propagated + // to the global ui object. utf8 prog_name; private: @@ -144,4 +160,12 @@ void write_options(); }; +// 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: + #endif // __APP_STATE_HH__ ============================================================ --- automate.cc b8757225e1989f6a7d491e7442152445afb579e1 +++ automate.cc fb597bb9483f7531adbb6e2501188d74063bf60a @@ -1,16 +1,19 @@ -// -*- mode: C++; c-file-style: "gnu"; indent-tabs-mode: nil -*- -// copyright (C) 2004 nathaniel smith -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// Copyright (C) 2004 Nathaniel Smith +// +// 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. -#include +#include #include #include -#include -#include #include +#include #include +#include #include #include @@ -18,19 +21,19 @@ #include "app_state.hh" #include "basic_io.hh" +#include "cert.hh" #include "commands.hh" #include "constants.hh" +#include "keys.hh" +#include "packet.hh" #include "restrictions.hh" #include "revision.hh" #include "transforms.hh" #include "vocab.hh" -#include "keys.hh" -#include "packet.hh" -#include "cert.hh" using std::allocator; -using std::basic_stringbuf; using std::basic_ios; +using std::basic_stringbuf; using std::char_traits; using std::endl; using std::inserter; @@ -383,10 +386,11 @@ app.db.get_revision_ids(leaves); multimap graph; app.db.get_revision_ancestry(graph); - for (multimap::const_iterator i = graph.begin(); - i != graph.end(); ++i) + for (multimap::const_iterator + i = graph.begin(); i != graph.end(); ++i) leaves.erase(i->first); - for (set::const_iterator i = leaves.begin(); i != leaves.end(); ++i) + for (set::const_iterator i = leaves.begin(); + i != leaves.end(); ++i) output << (*i).inner()() << endl; } @@ -493,7 +497,8 @@ j->second.insert(i->first); } - for (map >::const_iterator i = child_to_parents.begin(); + for (map >::const_iterator + i = child_to_parents.begin(); i != child_to_parents.end(); ++i) { output << (i->first).inner()(); @@ -555,7 +560,8 @@ pre_state, post_state; enum nstate - { UNCHANGED_NODE, PATCHED_NODE, MISSING_NODE, UNKNOWN_NODE, IGNORED_NODE } + { UNCHANGED_NODE, PATCHED_NODE, MISSING_NODE, + UNKNOWN_NODE, IGNORED_NODE } node_state; size_t pre_id, post_id; @@ -597,7 +603,8 @@ { for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++) { - L(FL("%d %d %s\n") % inventory[*i].post_state % post_state % file_path(*i)); + L(FL("%d %d %s\n") % inventory[*i].post_state + % post_state % file_path(*i)); I(inventory[*i].post_state == inventory_item::UNCHANGED_PATH); inventory[*i].post_state = post_state; if (rename_id != 0) @@ -615,7 +622,8 @@ { for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++) { - L(FL("%d %d %s\n") % inventory[*i].node_state % node_state % file_path(*i)); + L(FL("%d %d %s\n") % inventory[*i].node_state + % node_state % file_path(*i)); I(inventory[*i].node_state == inventory_item::UNCHANGED_NODE); inventory[*i].node_state = node_state; } @@ -639,8 +647,10 @@ old_name.insert(i->first); new_name.insert(i->second); - inventory_pre_state(inventory, old_name, inventory_item::RENAMED_PATH, rename_id); - inventory_post_state(inventory, new_name, inventory_item::RENAMED_PATH, rename_id); + inventory_pre_state(inventory, old_name, + inventory_item::RENAMED_PATH, rename_id); + inventory_post_state(inventory, new_name, + inventory_item::RENAMED_PATH, rename_id); rename_id++; } @@ -649,7 +659,8 @@ static void extract_added_file_paths(addition_map const & additions, path_set & paths) { - for (addition_map::const_iterator i = additions.begin(); i != additions.end(); ++i) + for (addition_map::const_iterator i = additions.begin(); + i != additions.end(); ++i) { paths.insert(i->first); } @@ -659,10 +670,12 @@ // Name: inventory // Arguments: none // Added in: 1.0 + // Purpose: Prints a summary of every file found in the workspace or its -// associated base manifest. Each unique path is listed on a line prefixed by -// three status characters and two numeric values used for identifying -// renames. The three status characters are as follows. +// associated base manifest. Each unique path is listed on a line +// prefixed by three status characters and two numeric values used +// for identifying renames. The three status characters are as +// follows. // // column 1 pre-state // ' ' the path was unchanged in the pre-state @@ -679,12 +692,13 @@ // 'I' the node is ignored and not included in the roster // 'M' the node is missing but is included in the roster // -// Output format: Each path is printed on its own line, prefixed by three status -// characters as described above. The status is followed by a single space and -// two numbers, each separated by a single space, used for identifying renames. -// The numbers are followed by a single space and then the pathname, which -// includes the rest of the line. Directory paths are identified as ending with -// the "/" character, file paths do not end in this character. +// Output format: Each path is printed on its own line, prefixed by three +// status characters as described above. The status is followed by a +// single space and two numbers, each separated by a single space, +// used for identifying renames. The numbers are followed by a +// single space and then the pathname, which includes the rest of +// the line. Directory paths are identified as ending with the "/" +// character, file paths do not end in this character. // // Error conditions: If no workspace book keeping _MTN directory is found, // prints an error message to stderr, and exits with status 1. @@ -709,21 +723,24 @@ get_base_and_current_roster_shape(base, curr, nis, app); make_cset(base, curr, cs); - // the current roster (curr) has the complete set of registered nodes - // conveniently with unchanged sha1 hash values + // The current roster (curr) has the complete set of registered nodes + // conveniently with unchanged sha1 hash values. - // the cset (cs) has the list of drops/renames/adds that have occurred between - // the two rosters along with an empty list of deltas. this list is empty - // only because the current roster used to generate the cset does not have - // current hash values as recorded on the filesystem (because get_..._shape - // was used to build it) + // The cset (cs) has the list of drops/renames/adds that have + // occurred between the two rosters along with an empty list of + // deltas. this list is empty only because the current roster used + // to generate the cset does not have current hash values as + // recorded on the filesystem (because get_..._shape was used to + // build it). path_set nodes_added(cs.dirs_added); extract_added_file_paths(cs.files_added, nodes_added); - inventory_pre_state(inventory, cs.nodes_deleted, inventory_item::DROPPED_PATH, 0); + inventory_pre_state(inventory, cs.nodes_deleted, + inventory_item::DROPPED_PATH, 0); inventory_renames(inventory, cs.nodes_renamed); - inventory_post_state(inventory, nodes_added, inventory_item::ADDED_PATH, 0); + inventory_post_state(inventory, nodes_added, + inventory_item::ADDED_PATH, 0); classify_roster_paths(curr, unchanged, changed, missing, app); curr.extract_path_set(known); @@ -732,23 +749,33 @@ file_itemizer u(app, known, unknown, ignored, mask); walk_tree(file_path(), u); - inventory_node_state(inventory, unchanged, inventory_item::UNCHANGED_NODE); - inventory_node_state(inventory, changed, inventory_item::PATCHED_NODE); - inventory_node_state(inventory, missing, inventory_item::MISSING_NODE); - inventory_node_state(inventory, unknown, inventory_item::UNKNOWN_NODE); - inventory_node_state(inventory, ignored, inventory_item::IGNORED_NODE); + inventory_node_state(inventory, unchanged, + inventory_item::UNCHANGED_NODE); + inventory_node_state(inventory, changed, + inventory_item::PATCHED_NODE); + + inventory_node_state(inventory, missing, + inventory_item::MISSING_NODE); + + inventory_node_state(inventory, unknown, + inventory_item::UNKNOWN_NODE); + + inventory_node_state(inventory, ignored, + inventory_item::IGNORED_NODE); + // FIXME: do we want to report on attribute changes here?!? - for (inventory_map::const_iterator i = inventory.begin(); i != inventory.end(); ++i) + for (inventory_map::const_iterator i = inventory.begin(); + i != inventory.end(); ++i) { string path_suffix; if (curr.has_node(i->first)) { - // explicitly skip the root dir for now... - // the trailing / dir format isn't going to work here + // Explicitly skip the root dir for now. The trailing / dir + // format isn't going to work here. node_t n = curr.get_node(i->first); if (is_root_dir_t(n)) continue; if (is_dir_t(n)) path_suffix = "/"; @@ -788,9 +815,10 @@ << " " << i->second.post_id << " " << i->first; - // FIXME: it's possible that a directory was deleted and a file was added - // in it's place (or vice-versa) so we need something like pre/post node - // type indicators rather than a simple path suffix! ugh. + // FIXME: it's possible that a directory was deleted and a file + // was added in it's place (or vice-versa) so we need something + // like pre/post node type indicators rather than a simple path + // suffix! ugh. output << path_suffix; @@ -819,13 +847,13 @@ // Arguments: // 1: a revision id // Added in: 1.0 -// Purpose: Prints all certificates associated with the given revision ID. -// Each certificate is contained in a basic IO stanza. For each certificate, -// the following values are provided: +// Purpose: Prints all certificates associated with the given revision +// ID. Each certificate is contained in a basic IO stanza. For each +// certificate, the following values are provided: // // 'key' : a string indicating the key used to sign this certificate. -// 'signature': a string indicating the status of the signature. Possible -// values of this string are: +// 'signature': a string indicating the status of the signature. +// Possible values of this string are: // 'ok' : the signature is correct // 'bad' : the signature is invalid // 'unknown' : signature was made with an unknown key @@ -836,12 +864,14 @@ // 'trusted' : this certificate is trusted // 'untrusted' : this certificate is not trusted // -// Output format: All stanzas are formatted by basic_io. Stanzas are seperated -// by a blank line. Values will be escaped, '\' -> '\\' and '"' -> '\"'. +// Output format: All stanzas are formatted by basic_io. Stanzas are +// seperated by a blank line. Values will be escaped, '\' -> '\\' and +// '"' -> '\"'. // -// Error conditions: If a certificate is signed with an unknown public key, a -// warning message is printed to stderr. If the revision specified is unknown -// or invalid prints an error message to stderr and exits with status 1. +// Error conditions: If a certificate is signed with an unknown public +// key, a warning message is printed to stderr. If the revision +// specified is unknown or invalid prints an error message to stderr +// and exits with status 1. static void automate_certs(vector args, string const & help_name, @@ -876,8 +906,8 @@ } } - // Make the output deterministic; this is useful for the test suite, in - // particular. + // Make the output deterministic; this is useful for the test suite, + // in particular. sort(certs.begin(), certs.end()); basic_io::printer pr; @@ -895,8 +925,9 @@ rsa_keypair_id keyid = idx(certs, i).key(); signers.insert(keyid); - bool trusted = app.lua.hook_get_revision_cert_trust(signers, ident, - name, tv); + bool trusted = + app.lua.hook_get_revision_cert_trust(signers, ident, + name, tv); st.push_str_pair(syms::key, keyid()); @@ -928,12 +959,14 @@ // Name: get_revision // Arguments: -// 1: a revision id (optional, determined from the workspace if non-existant) +// 1: a revision id (optional, determined from the workspace if +// non-existant) // Added in: 1.0 + // Purpose: Prints change information for the specified revision id. -// There are several changes that are described; each of these is described by -// a different basic_io stanza. The first string pair of each stanza indicates the -// type of change represented. +// There are several changes that are described; each of these is +// described by a different basic_io stanza. The first string pair +// of each stanza indicates the type of change represented. // // All stanzas are formatted by basic_io. Stanzas are separated // by a blank line. Values will be escaped, '\' to '\\' and @@ -985,8 +1018,8 @@ // // These stanzas will always occur in the order listed here; stanzas of // the same type will be sorted by the filename they refer to. -// Error conditions: If the revision specified is unknown or invalid prints an -// error message to stderr and exits with status 1. +// Error conditions: If the revision specified is unknown or invalid +// prints an error message to stderr and exits with status 1. static void automate_get_revision(vector args, string const & help_name, @@ -1031,8 +1064,8 @@ // Name: get_base_revision_id // Arguments: none // Added in: 2.0 -// Purpose: Prints the revision id the current workspace is based on. This is -// the value stored in _MTN/revision +// Purpose: Prints the revision id the current workspace is based +// on. This is the value stored in _MTN/revision // Error conditions: If no workspace book keeping _MTN directory is found, // prints an error message to stderr, and exits with status 1. static void @@ -1055,8 +1088,9 @@ // Arguments: none // Added in: 2.0 // Purpose: Prints the revision id of the current workspace. This is the -// id of the revision that would be committed by an unrestricted commit calculated -// from _MTN/revision, _MTN/work and any edits to files in the workspace. +// id of the revision that would be committed by an unrestricted +// commit calculated from _MTN/revision, _MTN/work and any edits to +// files in the workspace. // Error conditions: If no workspace book keeping _MTN directory is found, // prints an error message to stderr, and exits with status 1. static void @@ -1091,7 +1125,8 @@ // Arguments: // 1: a revision id (optional, determined from the workspace if not given) // Added in: 2.0 -// Purpose: Prints the contents of the manifest associated with the given revision ID. +// Purpose: Prints the contents of the manifest associated with the +// given revision ID. // // Output format: // There is one basic_io stanza for each file or directory in the @@ -1119,14 +1154,14 @@ // occurs: zero or more times // // In addition, 'dir' and 'file' stanzas may have attr information -// included. These are appended to the stanza below the basic dir/file -// information, with one line describing each attr. These lines take the -// form ('attr', attr name, attr value). +// included. These are appended to the stanza below the basic +// dir/file information, with one line describing each attr. These +// lines take the form ('attr', attr name, attr value). // // Stanzas are sorted by the path string. // -// Error conditions: If the revision ID specified is unknown or invalid prints an -// error message to stderr and exits with status 1. +// Error conditions: If the revision ID specified is unknown or +// invalid prints an error message to stderr and exits with status 1. static void automate_get_manifest_of(vector args, string const & help_name, @@ -1199,10 +1234,11 @@ // Added in: 2.0 // Purpose: Prints the revision data in packet format // -// Output format: revision data in "monotone read" compatible packet format +// Output format: revision data in "monotone read" compatible packet +// format // -// Error conditions: If the revision id specified is unknown or invalid prints -// an error message to stderr and exits with status 1. +// Error conditions: If the revision id specified is unknown or +// invalid prints an error message to stderr and exits with status 1. static void automate_packet_for_rdata(vector args, string const & help_name, @@ -1231,8 +1267,8 @@ // // Output format: certs in "monotone read" compatible packet format // -// Error conditions: If the revision id specified is unknown or invalid prints -// an error message to stderr and exits with status 1. +// Error conditions: If the revision id specified is unknown or +// invalid prints an error message to stderr and exits with status 1. static void automate_packets_for_certs(vector args, string const & help_name, @@ -1262,8 +1298,8 @@ // // Output format: file data in "monotone read" compatible packet format // -// Error conditions: If the file id specified is unknown or invalid prints -// an error message to stderr and exits with status 1. +// Error conditions: If the file id specified is unknown or invalid +// prints an error message to stderr and exits with status 1. static void automate_packet_for_fdata(vector args, string const & help_name, @@ -1360,13 +1396,14 @@ // 2c295fcf5fe20301557b9b3a5b4d437b5ab8ec8c // 1:0:l:41:7706a422ccad41621c958affa999b1a1dd644e79 // -// Error conditions: Errors encountered by the commands run only set the error -// code in the output for that command. Malformed input results in exit with -// a non-zero return value and an error message. +// Error conditions: Errors encountered by the commands run only set +// the error code in the output for that command. Malformed input +// results in exit with a non-zero return value and an error message. -//We use our own stringbuf class so we can put in a callback on write. -//This lets us dump output at a set length, rather than waiting until -//we have all of the output. +// We use our own stringbuf class so we can put in a callback on write. +// This lets us dump output at a set length, rather than waiting until +// we have all of the output. + typedef basic_stringbuf, allocator > char_stringbuf; @@ -1646,12 +1683,14 @@ // Arguments: // 1 or more revision ids // Added in: 2.1 -// Purpose: Prints all revisions which are ancestors of all of the revisions -// given as arguments. -// Output format: A list of revision ids, in hexadecimal, each followed by a -// newline. Revisions are printed in alphabetically sorted order. -// Error conditions: If any of the revisions do not exist, prints nothing to -// stdout, prints an error message to stderr, and exits with status 1. +// Purpose: Prints all revisions which are ancestors of all of the +// revisions given as arguments. +// Output format: A list of revision ids, in hexadecimal, each +// followed by a newline. Revisions are printed in alphabetically +// sorted order. +// Error conditions: If any of the revisions do not exist, prints +// nothing to stdout, prints an error message to stderr, and exits +// with status 1. static void automate_common_ancestors(vector args, string const & help_name, app_state & app, ostream & output) @@ -1769,3 +1808,12 @@ else throw usage(root_cmd_name); } + + +// 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: ============================================================ --- automate.hh 50a099fbae11d18d8020c40813ede340f9005f54 +++ automate.hh a1c69c33629b9173de51c3c4a5c5b84302c82c7f @@ -1,10 +1,14 @@ #ifndef __AUTOMATE_HH__ #define __AUTOMATE_HH__ -// copyright (C) 2004 nathaniel smith -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// Copyright (C) 2004 Nathaniel Smith +// +// 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. #include #include @@ -19,4 +23,4 @@ app_state & app, std::ostream & output); +#endif // __AUTOMATE_HH__ -#endif // header guard ============================================================ --- basic_io.cc 0cd7c3eb2d37b603a49cab9959f582bcc4fb661f +++ basic_io.cc d7e7798e323fe76518a577010d4eef1f7639a0b1 @@ -1,11 +1,18 @@ +// Copyright (C) 2004 Graydon Hoare +// +// 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. + #include #include #include #include #include -#include - #include "basic_io.hh" #include "sanity.hh" #include "vocab.hh" @@ -16,17 +23,10 @@ using std::string; using std::vector; -// copyright (C) 2004 graydon hoare -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// This file provides parsing and printing primitives used by the +// higher level parser and printer routines for the datatypes cset, +// roster/marking_map and revision. -// this file provides parsing and printing primitives used by the higher -// level parser and printer routines for the two datatypes change_set and -// revision_set. every revision_set contains a number of change_sets, so -// their i/o routines are somewhat related. - - void basic_io::input_source::err(string const & s) { L(FL("error in %s:%d:%d:E: %s") % name % line % col % s); @@ -169,4 +169,10 @@ return "TOK_UNKNOWN"; } +// 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: - ============================================================ --- basic_io.hh 2f590c89a77dd2c425ecc8ce5a0922124f120284 +++ basic_io.hh c40999a46e70901ea3964b4c378d8cb368437dd2 @@ -1,15 +1,15 @@ #ifndef __BASIC_IO_HH__ #define __BASIC_IO_HH__ -// copyright (C) 2004 graydon hoare -// all rights reserved. -// licensed to the public under the terms of the GNU GPL (>= 2) -// see the file COPYING for details +// Copyright (C) 2004 Graydon Hoare +// +// 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. -// this file provides parsing and printing primitives used by the higher -// level parser and printer routines for the two datatypes change_set and -// revision_set. every revision_set contains a number of change_sets, so -// their i/o routines are somewhat related. #include #include @@ -21,6 +21,10 @@ #include "sanity.hh" #include "vocab.hh" +// This file provides parsing and printing primitives used by the +// higher level parser and printer routines for the datatypes cset, +// roster/marking_map and revision. + namespace basic_io { @@ -42,7 +46,8 @@ int lookahead; char c; input_source(std::string const & in, std::string const & nm) - : line(1), col(1), in(in), curr(in.begin()), name(nm), lookahead(0), c('\0') + : line(1), col(1), in(in), curr(in.begin()), + name(nm), lookahead(0), c('\0') {} inline void peek() @@ -164,7 +169,8 @@ // Make sure it's an escape we recognize. if (UNLIKELY(!(static_cast(in.lookahead) == '"' - || static_cast(in.lookahead) == '\\'))) + || + static_cast(in.lookahead) == '\\'))) in.err("unrecognized character escape"); // Add the escaped character onto the accumulating token. @@ -180,8 +186,10 @@ { // Skip over any further escape marker. in.advance(); - if (UNLIKELY(!(static_cast(in.lookahead) == '"' - || static_cast(in.lookahead) == '\\'))) + if (UNLIKELY + (!(static_cast(in.lookahead) == '"' + || + static_cast(in.lookahead) == '\\'))) in.err("unrecognized character escape"); } in.advance(); @@ -220,9 +228,11 @@ size_t indent; std::vector > entries; void push_hex_pair(symbol const & k, hexenc const & v); - void push_hex_triple(symbol const & k, std::string const & n, hexenc const & v); + void push_hex_triple(symbol const & k, std::string const & n, + hexenc const & v); void push_str_pair(symbol const & k, std::string const & v); - void push_str_triple(symbol const & k, std::string const & n, std::string const & v); + void push_str_triple(symbol const & k, std::string const & n, + std::string const & v); void push_file_pair(symbol const & k, file_path const & v); void push_str_multi(symbol const & k, std::vector const & v); @@ -298,4 +308,12 @@ } +// 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: + #endif // __BASIC_IO_HH__ ============================================================ --- cert.cc d568dcf9cbf42901fbc3aec941fb6111004a74e4 +++ cert.cc 6e1ffc5b990cf82e6ee2a7d1492127b2f71aa105 @@ -320,7 +320,7 @@ cert_signable_text(cert const & t, string & out) { - out = (boost::format("address@hidden:%s]") % t.name % t.ident % remove_ws(t.value())).str(); + out = (FL("address@hidden:%s]") % t.name % t.ident % remove_ws(t.value())).str(); L(FL("cert: signable text %s\n") % out); } ============================================================ --- charset.cc c958f957b5deca18a5803c512ae5cf58d08b5fb1 +++ charset.cc 3813493b3cd605cb0fb39306a10d11a2b115ae82 @@ -606,7 +606,7 @@ ace a = string(idna_vec[i].out); ace tace; utf8_to_ace(utf, tace); - L(boost::format("ACE-encoded %s: '%s'\n") % idna_vec[i].name % tace()); + L(FL("ACE-encoded %s: '%s'\n") % idna_vec[i].name % tace()); BOOST_CHECK(lowercase(a()) == lowercase(tace())); ace_to_utf8(a, tutf); BOOST_CHECK(lowercase(utf()) == lowercase(tutf())); ============================================================ --- cmd_diff_log.cc 6b49be84ff5e47f22c1942927ea41ab7c24da386 +++ cmd_diff_log.cc c2d375111f402eac0c82134f174627d88608dcb0 @@ -243,9 +243,9 @@ split_into_lines(unpacked(), lines); if (! lines.empty()) { - cout << (boost::format("--- %s\t%s\n") % file_path(i->first) % i->second) - << (boost::format("+++ %s\t%s\n") % file_path(i->first) % i->second) - << (boost::format("@@ -0,0 +1,%d @@\n") % lines.size()); + cout << (FL("--- %s\t%s\n") % file_path(i->first) % i->second) + << (FL("+++ %s\t%s\n") % file_path(i->first) % i->second) + << (FL("@@ -0,0 +1,%d @@\n") % lines.size()); for (vector::const_iterator j = lines.begin(); j != lines.end(); ++j) { ============================================================ --- cmd_merging.cc 14dbf8776d68cf092e76c4d7479afaafd24e4705 +++ cmd_merging.cc f3c3f2b70f29de1634b9fcd300ddfaeba0b2fe79 @@ -321,8 +321,8 @@ packet_db_writer dbw(app); cert_revision_in_branch(merged, app.branch_name(), app, dbw); - string log = (boost::format("merge of %s\n" - " and %s\n") % left % right).str(); + string log = (FL("merge of %s\n" + " and %s\n") % left % right).str(); cert_revision_changelog(merged, log, app, dbw); guard.commit(); @@ -481,8 +481,8 @@ string log_message; process_commit_message_args(log_message_given, log_message, app); if (!log_message_given) - log_message = (boost::format("propagate from branch '%s' (head %s)\n" - " to branch '%s' (head %s)\n") + log_message = (FL("propagate from branch '%s' (head %s)\n" + " to branch '%s' (head %s)\n") % idx(args, 0) % (*src_i) % idx(args, 1) % (*dst_i)).str(); @@ -527,9 +527,9 @@ cert_revision_in_branch(merged, branch, app, dbw); - string log = (boost::format("explicit_merge of '%s'\n" - " and '%s'\n" - " to branch '%s'\n") + string log = (FL("explicit_merge of '%s'\n" + " and '%s'\n" + " to branch '%s'\n") % left % right % branch).str(); cert_revision_changelog(merged, log, app, dbw); ============================================================ --- cmd_ws_commit.cc 159a7abbffa9e3992f5a3dba2af148de388e1f53 +++ cmd_ws_commit.cc 69cca94b132fd71d62be2a05e303d14a6b68b65e @@ -192,7 +192,7 @@ cert_revision_in_branch(inv_id, branchname, app, dbw); cert_revision_date_now(inv_id, app, dbw); cert_revision_author_default(inv_id, app, dbw); - cert_revision_changelog(inv_id, (boost::format("disapproval of revision '%s'") % r).str(), app, dbw); + cert_revision_changelog(inv_id, (FL("disapproval of revision '%s'") % r).str(), app, dbw); guard.commit(); } } ============================================================ --- configure.ac d341e69d700975ab4f573f5a1847c68fb16f841e +++ configure.ac 824721ae0b37ed846b0240a912e197eb69d4bd23 @@ -265,7 +265,7 @@ AC_MSG_CHECKING(for gcc with precompiled header support) gxx_version=`${CXX} -dumpversion` case $gxx_version in - 4.0*) + 4.*) AC_MSG_RESULT(found) AM_CONDITIONAL(BUILD_PCH, true) ;; ============================================================ --- database.cc 0d25c2fa019f20eb0b7299f2b569a4091571aed1 +++ database.cc 243ed549122fd7494a7cd43535d2f8b480743c07 @@ -358,7 +358,7 @@ static void dump_row(ostream &out, sqlite3_stmt *stmt, string const& table_name) { - out << boost::format("INSERT INTO %s VALUES(") % table_name; + out << FL("INSERT INTO %s VALUES(") % table_name; unsigned n = sqlite3_data_count(stmt); for (unsigned i = 0; i < n; ++i) { ============================================================ --- file_io.cc f2ae5cfeb4c6e7ac273fb6d11ad8f18f48ce6222 +++ file_io.cc 7c50a2a9534b3e6a0f0f876f785b5a638d419f95 @@ -390,7 +390,7 @@ // nb: no mucking around with multiple-writer conditions. we're a // single-user single-threaded program. you get what you paid for. assert_path_is_directory(bookkeeping_root); - bookkeeping_path tmp = bookkeeping_root / (boost::format("data.tmp.%d") % + bookkeeping_path tmp = bookkeeping_root / (FL("data.tmp.%d") % get_process_id()).str(); write_data_impl(p, dat, tmp); } @@ -412,7 +412,7 @@ data const & data, system_path const & tmpdir) { - write_data_impl(path, data, tmpdir / (boost::format("data.tmp.%d") % + write_data_impl(path, data, tmpdir / (FL("data.tmp.%d") % get_process_id()).str()); } ============================================================ --- file_io.hh 36dc8411e9bf01109fc5f42d7ece84c2f7a03635 +++ file_io.hh a20a0decf624fa58359aff924770e5199d60767f @@ -6,8 +6,6 @@ // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details -#include "boost/format.hpp" - #include "vocab.hh" #include "paths.hh" #include "sanity.hh" ============================================================ --- lcs.cc 6c1c76404a788927308bff3b8f52d52f8ae1c12a +++ lcs.cc 11c987c3b32ff3c1c860030dc298b5a5547fc2fa @@ -38,15 +38,15 @@ */ -#include "lcs.hh" - -#include #include #include +#include + +#include "lcs.hh" #include "sanity.hh" +using std::back_insert_iterator; using std::back_inserter; -using std::back_insert_iterator; using std::copy; using std::iterator_traits; using std::max; ============================================================ --- lua.cc 06e4a9aeca73e87a2617ff8df2d674646bf2cb8e +++ lua.cc 510492e0a3d30022cff1fcf325ddf6de32a899f4 @@ -54,7 +54,9 @@ int t = lua_type(st, i); switch (t) { case LUA_TSTRING: /* strings */ - out += (boost::format("`%s'") % string(lua_tostring(st, i), lua_strlen(st, i))).str(); + out += '`'; + out += string(lua_tostring(st, i), lua_strlen(st, i)); + out += '\''; break; case LUA_TBOOLEAN: /* booleans */ @@ -62,11 +64,11 @@ break; case LUA_TNUMBER: /* numbers */ - out += (boost::format("%g") % lua_tonumber(st, i)).str(); + out += (FL("%g") % lua_tonumber(st, i)).str(); break; default: /* other values */ - out += (boost::format("%s") % lua_typename(st, t)).str(); + out += std::string(lua_typename(st, t)); break; } ============================================================ --- netcmd.cc 8fa03553a30d87ff442de0d38e0e3042211c6f08 +++ netcmd.cc bd6ee0d97bdb27879e1d8342d6bc64899a6971e7 @@ -620,7 +620,7 @@ // error_cmd { - L(boost::format("checking i/o round trip on error_cmd\n")); + L(FL("checking i/o round trip on error_cmd\n")); netcmd out_cmd, in_cmd; string out_errmsg("your shoelaces are untied"), in_errmsg; string buf; @@ -628,12 +628,12 @@ do_netcmd_roundtrip(out_cmd, in_cmd, buf); in_cmd.read_error_cmd(in_errmsg); BOOST_CHECK(in_errmsg == out_errmsg); - L(boost::format("errmsg_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("errmsg_cmd test done, buffer was %d bytes\n") % buf.size()); } // hello_cmd { - L(boost::format("checking i/o round trip on hello_cmd\n")); + L(FL("checking i/o round trip on hello_cmd\n")); netcmd out_cmd, in_cmd; string buf; rsa_keypair_id out_server_keyname("address@hidden"), in_server_keyname; @@ -645,12 +645,12 @@ BOOST_CHECK(in_server_keyname == out_server_keyname); BOOST_CHECK(in_server_key == out_server_key); BOOST_CHECK(in_nonce == out_nonce); - L(boost::format("hello_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("hello_cmd test done, buffer was %d bytes\n") % buf.size()); } // bye_cmd { - L(boost::format("checking i/o round trip on bye_cmd\n")); + L(FL("checking i/o round trip on bye_cmd\n")); netcmd out_cmd, in_cmd; u8 out_phase(1), in_phase; string buf; @@ -659,12 +659,12 @@ do_netcmd_roundtrip(out_cmd, in_cmd, buf); in_cmd.read_bye_cmd(in_phase); BOOST_CHECK(in_phase == out_phase); - L(boost::format("bye_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("bye_cmd test done, buffer was %d bytes\n") % buf.size()); } // anonymous_cmd { - L(boost::format("checking i/o round trip on anonymous_cmd\n")); + L(FL("checking i/o round trip on anonymous_cmd\n")); netcmd out_cmd, in_cmd; protocol_role out_role = source_and_sink_role, in_role; string buf; @@ -681,12 +681,12 @@ BOOST_CHECK(in_include_pattern == out_include_pattern); BOOST_CHECK(in_exclude_pattern == out_exclude_pattern); BOOST_CHECK(in_role == out_role); - L(boost::format("anonymous_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("anonymous_cmd test done, buffer was %d bytes\n") % buf.size()); } // auth_cmd { - L(boost::format("checking i/o round trip on auth_cmd\n")); + L(FL("checking i/o round trip on auth_cmd\n")); netcmd out_cmd, in_cmd; protocol_role out_role = source_and_sink_role, in_role; string buf; @@ -711,23 +711,23 @@ BOOST_CHECK(in_role == out_role); BOOST_CHECK(in_include_pattern == out_include_pattern); BOOST_CHECK(in_exclude_pattern == out_exclude_pattern); - L(boost::format("auth_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("auth_cmd test done, buffer was %d bytes\n") % buf.size()); } // confirm_cmd { - L(boost::format("checking i/o round trip on confirm_cmd\n")); + L(FL("checking i/o round trip on confirm_cmd\n")); netcmd out_cmd, in_cmd; string buf; out_cmd.write_confirm_cmd(); do_netcmd_roundtrip(out_cmd, in_cmd, buf); in_cmd.read_confirm_cmd(); - L(boost::format("confirm_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("confirm_cmd test done, buffer was %d bytes\n") % buf.size()); } // refine_cmd { - L(boost::format("checking i/o round trip on refine_cmd\n")); + L(FL("checking i/o round trip on refine_cmd\n")); netcmd out_cmd, in_cmd; string buf; refinement_type out_ty (refinement_query), in_ty(refinement_response); @@ -747,12 +747,12 @@ in_cmd.read_refine_cmd(in_ty, in_node); BOOST_CHECK(in_ty == out_ty); BOOST_CHECK(in_node == out_node); - L(boost::format("refine_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("refine_cmd test done, buffer was %d bytes\n") % buf.size()); } // done_cmd { - L(boost::format("checking i/o round trip on done_cmd\n")); + L(FL("checking i/o round trip on done_cmd\n")); netcmd out_cmd, in_cmd; size_t out_n_items(12), in_n_items(0); netcmd_item_type out_type(key_item), in_type(revision_item); @@ -763,12 +763,12 @@ in_cmd.read_done_cmd(in_type, in_n_items); BOOST_CHECK(in_n_items == out_n_items); BOOST_CHECK(in_type == out_type); - L(boost::format("done_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("done_cmd test done, buffer was %d bytes\n") % buf.size()); } // data_cmd { - L(boost::format("checking i/o round trip on data_cmd\n")); + L(FL("checking i/o round trip on data_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_id(raw_sha1("tuna is not yummy")), in_id; @@ -779,12 +779,12 @@ in_cmd.read_data_cmd(in_type, in_id, in_dat); BOOST_CHECK(in_id == out_id); BOOST_CHECK(in_dat == out_dat); - L(boost::format("data_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("data_cmd test done, buffer was %d bytes\n") % buf.size()); } // delta_cmd { - L(boost::format("checking i/o round trip on delta_cmd\n")); + L(FL("checking i/o round trip on delta_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_head(raw_sha1("your seat cusion can be reused")), in_head; @@ -799,13 +799,13 @@ BOOST_CHECK(in_head == out_head); BOOST_CHECK(in_base == out_base); BOOST_CHECK(in_delta == out_delta); - L(boost::format("delta_cmd test done, buffer was %d bytes\n") % buf.size()); + L(FL("delta_cmd test done, buffer was %d bytes\n") % buf.size()); } } catch (bad_decode & d) { - L(boost::format("bad decode exception: '%s'\n") % d.what); + L(FL("bad decode exception: '%s'\n") % d.what); throw; } } ============================================================ --- pch.hh d907c0f5e974b97e595f43f5d65abc65af76732a +++ pch.hh 99ec41067206a464d4793fe917599f5d51882839 @@ -18,7 +18,6 @@ #include #include // We have a local version of this to work around a bug in the MSVC debug checking. -#include "boost/format.hpp" #include #include #include ============================================================ --- sanity.cc eb02236fb3eb72ac83d3b4a30cadad147aec9895 +++ sanity.cc 5a79c408881d20bbe1df1081c51dfedf49bd8824 @@ -14,6 +14,7 @@ #include #include +#include #include #include "constants.hh" @@ -23,6 +24,7 @@ #include "ui.hh" using std::exception; +using std::locale; using std::logic_error; using std::ofstream; using std::ostream; @@ -118,14 +120,8 @@ } string -sanity::do_format(i18n_format const & i18nfmt, char const * file, int line) +sanity::do_format(format_base const & fmt, char const * file, int line) { - return do_format(i18nfmt.fmt, file, line); -} - -string -sanity::do_format(format const & fmt, char const * file, int line) -{ try { return fmt.str(); @@ -142,7 +138,7 @@ void -sanity::log(format const & fmt, +sanity::log(plain_format const & fmt, char const * file, int line) { string str = do_format(fmt, file, line); @@ -333,25 +329,119 @@ } -i18n_format::i18n_format(const char * localized_pattern) - : fmt(localized_pattern, get_user_locale()) +struct +format_base::impl { -} + format fmt; + ostringstream oss; -i18n_format::i18n_format(string const & localized_pattern) - : fmt(localized_pattern, get_user_locale()) + impl(impl const & other) : fmt(other.fmt) + {} + + impl & operator=(impl const & other) + { + if (&other != this) + { + fmt = other.fmt; + oss.str(string()); + } + return *this; + } + + impl(char const * pattern) + : fmt(pattern) + {} + impl(string const & pattern) + : fmt(pattern) + {} + impl(char const * pattern, locale const & loc) + : fmt(pattern, loc) + {} + impl(string const & pattern, locale const & loc) + : fmt(pattern, loc) + {} +}; + +format_base::format_base(format_base const & other) + : pimpl(other.pimpl ? new impl(*(other.pimpl)) : NULL) { + } -string -i18n_format::str() const +format_base & +format_base::operator=(format_base const & other) { - return fmt.str(); + if (&other != this) + { + impl * tmp = NULL; + + try + { + if (other.pimpl) + tmp = new impl(*(other.pimpl)); + } + catch (...) + { + if (tmp) + delete tmp; + } + + if (pimpl) + delete pimpl; + + pimpl = tmp; + } + return *this; } - + +format_base::format_base(char const * pattern) + : pimpl(new impl(pattern)) +{} + +format_base::format_base(std::string const & pattern) + : pimpl(new impl(pattern)) +{} + +format_base::format_base(char const * pattern, locale const & loc) + : pimpl(new impl(pattern, loc)) +{} + +format_base::format_base(string const & pattern, locale const & loc) + : pimpl(new impl(pattern, loc)) +{} + ostream & -operator<<(ostream & os, i18n_format const & fmt) +format_base::get_stream() { + return pimpl->oss; +} + +void +format_base::flush() +{ + pimpl->fmt % pimpl->oss.str(); + pimpl->oss.str(string()); +} + +std::string +format_base::str() const +{ + return pimpl->fmt.str(); +} + +i18n_format::i18n_format(const char * localized_pattern) + : format_base(localized_pattern, get_user_locale()) +{ +} + +i18n_format::i18n_format(std::string const & localized_pattern) + : format_base(localized_pattern, get_user_locale()) +{ +} + +ostream & +operator<<(ostream & os, format_base const & fmt) +{ return os << fmt.str(); } @@ -366,7 +456,7 @@ return i18n_format(ngettext(str1, strn, count)); } -boost::format FL(const char * str) +plain_format FL(const char * str) { - return boost::format(str); + return plain_format(str); } ============================================================ --- sanity.hh 3a383c56e35f90f08f81b3362f448521ad06904a +++ sanity.hh e56bf6cd3f576b4ce4ebb9937f4fdaa4ece13367 @@ -1,4 +1,3 @@ -// -*- mode: C++; c-file-style: "gnu"; indent-tabs-mode: nil -*- #ifndef __SANITY_HH__ #define __SANITY_HH__ @@ -9,21 +8,18 @@ #include "config.h" // Required for ENABLE_NLS +#include #include #include #include -#include -#include "boost/format.hpp" #include "boost/circular_buffer.hpp" #include "boost/current_function.hpp" #include "i18n.h" - +#include "paths.hh" #include "quick_alloc.hh" // to get the QA() macro -#include "paths.hh" - #ifdef __GNUC__ #define NORETURN __attribute__((noreturn)) #else @@ -45,6 +41,8 @@ class MusingI; +class format_base; +struct plain_format; struct i18n_format; struct sanity { @@ -69,7 +67,7 @@ bool clean_shutdown; std::vector musings; - void log(boost::format const & fmt, + void log(plain_format const & fmt, char const * file, int line); void progress(i18n_format const & fmt, char const * file, int line); @@ -89,36 +87,94 @@ void gasp(); private: - std::string do_format(i18n_format const & fmt, + std::string do_format(format_base const & fmt, char const * file, int line); - std::string do_format(boost::format const & fmt, - char const * file, int line); }; typedef std::runtime_error oops; extern sanity global_sanity; -struct i18n_format +// This hides boost::format from infecting every source file. Instead, we +// implement a single very small formatter. + +class +format_base { - boost::format fmt; +protected: + struct impl; + impl *pimpl; + + format_base() : pimpl(NULL) {} + format_base(format_base const & other); + format_base & operator=(format_base const & other); + explicit format_base(char const * pattern); + explicit format_base(std::string const & pattern); + explicit format_base(char const * pattern, std::locale const & loc); + explicit format_base(std::string const & pattern, std::locale const & loc); + std::ostream & get_stream(); + void flush(); + +public: + std::string str() const; +}; + + +struct +plain_format + : public format_base +{ + plain_format() + {} + + explicit plain_format(char const * pattern) + : format_base(pattern) + {} + + explicit plain_format(std::string const & pattern) + : format_base(pattern) + {} + + template plain_format & operator %(T const & t) + { + get_stream() << t; + flush(); + return *this; + } + + template plain_format & operator %(T & t) + { + get_stream() << t; + flush(); + return *this; + } +}; + + +struct +i18n_format + : public format_base +{ i18n_format() {} explicit i18n_format(const char * localized_pattern); explicit i18n_format(std::string const & localized_pattern); - std::string str() const; + template i18n_format & operator%(T const & t) { - fmt % t; + get_stream() << t; + flush(); return *this; } + template i18n_format & operator%(T & t) { - fmt % t; + get_stream() << t; + flush(); return *this; } }; -std::ostream & operator<<(std::ostream & os, i18n_format const & fmt); +std::ostream & operator<<(std::ostream & os, format_base const & fmt); // F is for when you want to build a boost formatter for display i18n_format F(const char * str); @@ -128,7 +184,7 @@ // FL is for when you want to build a boost formatter for the developers -- it // is not gettextified. Think of the L as "literal" or "log". -boost::format FL(const char * str); +plain_format FL(const char * str); // L is for logging, you can log all you want #define L(fmt) global_sanity.log(fmt, __FILE__, __LINE__) @@ -331,4 +387,13 @@ template <> void dump(std::string const & obj, std::string & out); +////////////////////////////////////////////////////////////////////////// +// Local Variables: +// mode: C++ +// 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: +////////////////////////////////////////////////////////////////////////// + #endif // __SANITY_HH__ ============================================================ --- ui.hh ffdc426cb8a9a6de1b8a7a09317df1fbb62f77ef +++ ui.hh 0f806f7ebf686e12e5a67297b39ffeb030abe2dc @@ -85,12 +85,11 @@ user_interface(); ~user_interface(); void warn(std::string const & warning); - void warn(boost::format const & fmt) { warn(fmt.str()); } + void warn(format_base const & fmt) { warn(fmt.str()); } void fatal(std::string const & warning); - void fatal(boost::format const & fmt) { warn(fmt.str()); } + void fatal(format_base const & fmt) { warn(fmt.str()); } void inform(std::string const & line); - void inform(boost::format const & fmt) { inform(fmt.str()); } - void inform(i18n_format const & fmt) { inform(fmt.str()); } + void inform(format_base const & fmt) { inform(fmt.str()); } void set_tick_trailer(std::string const & trailer); void set_tick_writer(tick_writer * t_writer); void ensure_clean_line(); ============================================================ --- unix/get_system_flavour.cc cbbb43edbaf647bf4005887684a98c94633d2cfb +++ unix/get_system_flavour.cc 3c68d38211c3c7f8c6e06eee7d9fbce40497b2fc @@ -13,7 +13,7 @@ Linux only knows 0 - as >0 is not an error condition there, relax a bit */ I(uname(&n) >= 0); - ident = (boost::format("%s %s %s %s") + ident = (FL("%s %s %s %s") % n.sysname % n.release % n.version ============================================================ --- xdelta.cc d884013d3dc309f7dfa6f3d4541adb2ba3ef981e +++ xdelta.cc 8953f76da8baf0622a089c476f8680bccbf43ac6 @@ -870,11 +870,11 @@ xdelta_randomly_delete(b); compute_delta(a, b, fdel); compute_delta(b, a, rdel); - L(boost::format("src %d, dst %d, fdel %d, rdel %d\n") + L(FL("src %d, dst %d, fdel %d, rdel %d\n") % a.size() % b.size()% fdel.size() % rdel.size()) ; if (fdel.size() == 0) { - L(boost::format("confirming src == dst and rdel == 0\n")); + L(FL("confirming src == dst and rdel == 0\n")); BOOST_CHECK(a == b); BOOST_CHECK(rdel.size() == 0); } @@ -882,7 +882,7 @@ { apply_delta(a, fdel, c); apply_delta(b, rdel, d); - L(boost::format("confirming dst1 %d, dst2 %d\n") % c.size() % d.size()); + L(FL("confirming dst1 %d, dst2 %d\n") % c.size() % d.size()); BOOST_CHECK(b == c); BOOST_CHECK(a == d); }