#
#
# patch "ChangeLog"
# from [35e34c28ec8501d85401273cd5a75829c775d545]
# to [850c931a795a24580e7fcf2e2ee0a710f502eac5]
#
# patch "adler32.hh"
# from [adf2c488c4b0062c31b89b0e7b31d0ce840d2e08]
# to [c00437287b948bba66b6195ef74749615512df46]
#
# patch "annotate.cc"
# from [7655d63779fde07e30bbd6b2b4a5c74378175a5d]
# to [7bc1472f79bea8bc5b5b2370e35d63b676dd6569]
#
# patch "annotate.hh"
# from [2c21ed973503781e799cb80b18ea83a3398010d1]
# to [e7a6458c2750aa879f7bb7612e15fa7e84931459]
#
# patch "app_state.cc"
# from [fe9a80dc99e8deb846577ba557e4e4a20addf1c0]
# to [a941f16101beb709145100ba58cc9726c7dacbf2]
#
# patch "app_state.hh"
# from [1e1011728a2da0db22589ac19fe9de5b00d08680]
# to [a6cba0558a4c377dda413b557c10781cd33668c1]
#
# patch "automate.cc"
# from [fb597bb9483f7531adbb6e2501188d74063bf60a]
# to [8b18ec025d8bd4fe2a1a100de6f4bc8243911933]
#
# patch "basic_io.cc"
# from [d7e7798e323fe76518a577010d4eef1f7639a0b1]
# to [a15ef15ce8808a455ee8f9a7edeeb2ba23eddc67]
#
# patch "basic_io.hh"
# from [c40999a46e70901ea3964b4c378d8cb368437dd2]
# to [a690f850ad0a49bd2309216008f8bf931bd0b017]
#
# patch "cert.cc"
# from [6e1ffc5b990cf82e6ee2a7d1492127b2f71aa105]
# to [00b0049d57be97e2f990812639b0d917913eaef2]
#
# patch "cert.hh"
# from [6ccf880b677340a2460ced453c93700b7bae07b3]
# to [442db182fbe3a8f3c1313ddcc34f911b05371f02]
#
# patch "charset.cc"
# from [f55e73d42872fbbf269b3cd9f41af9217030f1a6]
# to [fc0b370c50ee32b1bc3bb110e4181f3a841edbae]
#
# patch "cleanup.hh"
# from [a450ba2ba4311f0a298c1e102bd5c5f0c5fb2258]
# to [5af6a253b76166eafdaf7a6bb0b27b08469ca10e]
#
# patch "cmd.hh"
# from [76fe4ececf8426484d8a4aca7c54237c49ce6100]
# to [b3216c27888503db9b3d33aed451f013f54e240a]
#
# patch "cmd_automate.cc"
# from [37baff9dc561c7fad66b88559fda15b14f2a4f55]
# to [6f285920e44f4c8c2d262c08b7e06de1f4b4ae65]
#
# patch "cmd_db.cc"
# from [7403b1a1bb54a12e01dee5fcbbc3db7aaf8ba557]
# to [556cb1dad30d2b6ad3a50fd7951927afdf5ce6d2]
#
# patch "cmd_diff_log.cc"
# from [c2d375111f402eac0c82134f174627d88608dcb0]
# to [4d963e42f2b37a325e6afb0e3f0f9ee6995f2525]
#
# patch "cmd_files.cc"
# from [22b692fc7848cf47a7572d4df48b0ffeeaa56c5c]
# to [088fb68e4513fb18130184937b3bfcaf4e23155a]
#
# patch "cmd_key_cert.cc"
# from [4f07a55505d99f4a1680313d47e7a813a4bd1517]
# to [aea641cf1bcdfb372b147d99a5f908cca3c12188]
#
# patch "cmd_list.cc"
# from [5edf0ae19d13ccc9d25490eb64576bff4ad907ca]
# to [5b4ecf0d3b3fac90a4cb8eea9b30b31bc335d082]
#
# patch "cmd_merging.cc"
# from [6745bfc6317dad3cf1828d17600aca164accf0e5]
# to [3c99bc7044aba855f37df212ca11959ed6881bec]
#
# patch "cmd_netsync.cc"
# from [3679d67d1590ae6a8731ab565132cd148b427b0b]
# to [2b0b6da8e33bf1c3a5c7eec9de9218f20cbe1a80]
#
# patch "cmd_othervcs.cc"
# from [47651b6f63bd48be121a30eec4d1746238151fd2]
# to [f97235e360354ab14ae9749e45b274acfc30c35e]
#
# patch "cmd_ws_commit.cc"
# from [b334deaf56946d327559cb7db10fc82de170da5c]
# to [ed419208149db21c8a754df43d443c143b2e7544]
#
# patch "commands.cc"
# from [579d73cf72936f2493bfe1fa4cec133d42106469]
# to [534869eb75c5f57575dc842d1d7e24461b4a3a8c]
#
# patch "commands.hh"
# from [c6c8f7e3146a242c1578c35818116aba48e0d6a6]
# to [815d331acde28ddbd64107f92e52aad1f9f199f1]
#
# patch "constants.cc"
# from [b175c8ae9c808089d3e9f7216896be26714703db]
# to [e0fe679a5b53cdee258b2588fec97fece2ec632c]
#
# patch "constants.hh"
# from [e24a1a631a2717ee866ca20e5cb4ede9d2ba3d8a]
# to [eb79289a66344262b16a0fe67ec63b3979fe34f2]
#
# patch "crypto_tests.cc"
# from [5f2ad6110bb7f9a10978ede2c860ad44b24ffed0]
# to [70cc3f3681395ae674799976432b968d1f79ef52]
#
# patch "cset.cc"
# from [bf3abceb49091cfed0d14d02c1188d14378b8f6e]
# to [71b4052c7b0658142edd83e596cfaa8f3be18f2a]
#
# patch "cset.hh"
# from [2d06997a4c2475aa45550dbe967c09397575d908]
# to [6410b0b216aed5a227e15a4537ca08d5f673a81f]
#
# patch "cycle_detector.hh"
# from [624eaa84d3bc3281a0d6280cbecb1e654f0bc723]
# to [79f9f0af66246c9cb770c5e3b57172c8c1b4b6e9]
#
# patch "database.cc"
# from [77592832b55b0c42a0d4afb23875dc242d3d67b4]
# to [ae0895605e5a1b6745b3b034a2836f1ad0e8001e]
#
# patch "database.hh"
# from [1222e43cb9911d432296a70d25b51f53462afd7e]
# to [f2225237fc9dec0d6e9781c207b2375047c980ce]
#
# patch "database_check.cc"
# from [1354e4948560a3e9197df485a0d6d4208c7d442c]
# to [2df826436ffc2376ebf5d95a3b0159b02b9bd2ce]
#
# patch "database_check.hh"
# from [98374bcba5840ad01efdec5f36a0159568e124d7]
# to [7a319e994d382e74c3f6dceee3462a2a6bfe8153]
#
# patch "diff_patch.cc"
# from [b854d0d4444480e98b9ed8e2aa936d700de1cc22]
# to [f05f8aa967ed88dae6b96efecdf44c45f288537d]
#
# patch "diff_patch.hh"
# from [845e486548ebc492296e0a441557ad6ae96c741f]
# to [bd951a22eea247856e6f5971cadc165a82f56a3a]
#
# patch "enumerator.cc"
# from [e2ebd144f9f66f1dab7a5324c62e2f7d73eb4646]
# to [ec047b5f698ad0fb305210e16361c0008e010da4]
#
# patch "enumerator.hh"
# from [4f3ce29808f2bf2c0f65701e64ae379e369ab9fb]
# to [03863f83479e729dbcad98faee6140049f9e8768]
#
# patch "file_io.cc"
# from [7c50a2a9534b3e6a0f0f876f785b5a638d419f95]
# to [b7b388fa5f4935c5e91038513ca1366b172fe154]
#
# patch "globish.cc"
# from [409df5d1f8ff0ad46a144ed6f1344418185d54dc]
# to [febd0cd30ba4ec07bf0012a8f51081b953928132]
#
# patch "hash_map.hh"
# from [98827ec1d7ba91683c64e731820f434f022fdbe0]
# to [e2f34bc96b7ca591a50dc687cc42e3c84f8507a7]
#
# patch "hmac.cc"
# from [668380c352db46c0cefbababed90462db529f486]
# to [472764cfd31f8de5fa089b2ba56f399e52a69c67]
#
# patch "hmac.hh"
# from [e3082711a437a693ba707ca763e1c2f6755efaba]
# to [ad2e9fd10edb10a0c65839da6312ca71ce711c24]
#
# patch "inodeprint.cc"
# from [62b091111b84a22f6de804b3c9d37716e7a06169]
# to [adf50d2f722a8a5e13d28c8203162d6d0b7bba14]
#
# patch "inodeprint.hh"
# from [3db3005b0230aa489265417b80cba28a74dc406e]
# to [5854a71f0c57d01e06cb736bfb4edc66d34f40b2]
#
# patch "interner.hh"
# from [70ca14f55628cab86911c21d846931cb64d3319d]
# to [f80a165b21302d7384cac0c7564f06999bbe9c60]
#
# patch "key_store.cc"
# from [dcdebf60e129b121b78cc0f2c53e3c7a19cf69a9]
# to [489c4d61423a5d93788c13358311a6f710cf432f]
#
# patch "key_store.hh"
# from [6821800c3a5f562b7d8aa747e8b232e0b37a9bda]
# to [08c0ac89d69b00b55cccad9fde8ee2e30229e1f9]
#
# patch "keys.cc"
# from [3d835d4757415bf43f821941e2a37bdbc1c4f2db]
# to [a72e7d7009481fac53ef5086f2f2ccea4b14f5c6]
#
# patch "keys.hh"
# from [8ef7487642f3f7cc3e9bfa80ce88770467edac3d]
# to [55a0ad2a67a0c6f30b3fc16ac1dd9a904ebd400f]
#
# patch "lcs.cc"
# from [11c987c3b32ff3c1c860030dc298b5a5547fc2fa]
# to [5534a43bd5c14750bf13fde28cfc80b14af0e9fb]
#
# patch "lcs.hh"
# from [8fd9c138a9fb9baa870ebdf56723bb5ef189a081]
# to [dfdece3a1525237aa7ac5996a76cf0d64671e59f]
#
# patch "legacy.cc"
# from [cb7eb7d67ccf5f3b3d762c3889a90f1e17509222]
# to [fef9d94af73fe443c3ec75ae2a47c01ab826377f]
#
# patch "legacy.hh"
# from [4759323523ca05da97a2d525c629b3b0e446a674]
# to [ca42f4646c6f80ec2bf9f8d332efa8aebdd92f85]
#
# patch "localized_file_io.cc"
# from [a224f91ef63f02d73e12173351f918b30c526075]
# to [8d36617800f80f983c2e9be3724555b6c9eea95d]
#
# patch "localized_file_io.hh"
# from [9cdb8ca069e30a6dbf3e02d53337b4e2407e6bdd]
# to [92af84cfbe868c3cefbaf45bb479cc5f465e405a]
#
# patch "lua.cc"
# from [510492e0a3d30022cff1fcf325ddf6de32a899f4]
# to [e08614b229eb4cddd3a9820ea729d5cb33d58489]
#
# patch "lua.hh"
# from [54e0054144207e223df17764f6da0e6134cb6a02]
# to [6b805dfc204b315a49e7be86ad8f3ca8519ffdaa]
#
# patch "lua_hooks.cc"
# from [a61adade16562803f2118f96bdd2d5b2b8c391bd]
# to [f6958169c7ac3b2cba99da60c075dfd9f8f766d4]
#
# patch "lua_hooks.hh"
# from [4808b67b1e1cf6250e423ffd16d2153cba51ca78]
# to [5e33a2a94befbcd2969d80363fdfc8a09994565b]
#
# patch "main.cc"
# from [1b50bf9eefcb967254582b38a5a886f8ad09eea6]
# to [14ebc50eeeaf3248b88c1a79d45586ecb2e22f2d]
#
# patch "merge.cc"
# from [cc6860bdc2e1ba18713800ef24ceb08c605abab0]
# to [cb10f705835971e69ada0c322e42ab635f8388cb]
#
# patch "merge.hh"
# from [ba5196326f988aa8d857e7aa3b138ff17afbe06b]
# to [87e2852d5ba1ef5e8c0d615b70688223a1cb095c]
#
# patch "merkle_tree.cc"
# from [7011e2dbceb1d2e78db31c8c4570d443b383c639]
# to [888e9121fb11a391bc924b2da6fa186353f24cd3]
#
# patch "merkle_tree.hh"
# from [af2fed86c559da7f86f0d9a0f6189ab385ee8c08]
# to [21726c0cadb872365e5b32361d87d5c450a4e019]
#
# patch "mkstemp.cc"
# from [84c177af02e8c9cde94a596461bdc5d837512fd4]
# to [cbcbd1d3b07c4207bb3e474397a0b07a95f2f0d6]
#
# patch "monotone.cc"
# from [47ee3ca3d15e6e3a261fdaace69671e05f7cba01]
# to [33fac939423bd5f1f6286e2fddd4b546df8067bf]
#
# patch "mt_version.cc"
# from [936a7e6ad5c7ef202f0bdbc0f0bfc7ebc380ff27]
# to [672188a1ba9293f6cc3fa56411521403022b1644]
#
# patch "netcmd.cc"
# from [bd6ee0d97bdb27879e1d8342d6bc64899a6971e7]
# to [f344ffb3dcd799f0b4ec4c6796dbc5db9f1a64e7]
#
# patch "netcmd.hh"
# from [e290b45f5acb01bfe181832d4750275e05b2f98f]
# to [06cdc51d8a9a6eb0b38cc17b810ededb0121d5e1]
#
# patch "netio.hh"
# from [3177bc0e70e1d2333e7ffeee004b01f2d114ccfb]
# to [e37bb9cfb163aac2a2ac4e63a29f233bab47c9c0]
#
# patch "netsync.cc"
# from [790c8fceb436ee65f0ade641aefe3a60d10893d9]
# to [a65ecca750cb7342ee8ab24f152ea92ff208eba0]
#
# patch "netsync.hh"
# from [276fdfd34e38b36adc1a45d012792fd43db07a2c]
# to [7307b7f9d4053a98d543ff7068d2767689dcc249]
#
# patch "netxx_pipe.cc"
# from [bf56e7d54b7cd63656f6ec741a848d4df3e86bf8]
# to [6af839b4682d91c62c38d6393d83bb9f04f65177]
#
# patch "netxx_pipe.hh"
# from [720992e155fa3f850ed0c46aaa1d224e25c95efe]
# to [54d564cba3c9ca9952c6d739f2b3e5d279b7ed5c]
#
# patch "packet.cc"
# from [dfdefb2d2808183cd0312752b2ee1f840bace11c]
# to [cfef3e3f3868a9c41f6cce65f0a3325515de73df]
#
# patch "packet.hh"
# from [97e6723f3b4974aa36826b5391b2018870ad4eb3]
# to [287d928c5429c8c9d1c16a9fb4588eb9ec87001b]
#
# patch "parallel_iter.hh"
# from [a00fa825f37d7c08c98cdc99a45d7304c4e64fd2]
# to [686f6f5be905ac6b2b4b45eac9e3ce217096ce94]
#
# patch "paths.cc"
# from [cef87a9f72cc5011f93bb8bfa7d9ac6f6d0eeadd]
# to [48db23c7a770cf3743c971b3fd31431356e8b186]
#
# patch "paths.hh"
# from [b97148599d5823bd41c4be253a363dbaf64e2411]
# to [e084737c12b8cbff745ff1ea5b49092360edad43]
#
# patch "po/it.po"
# from [a548b1b52dc1b491a42cb4aa38355868a116512d]
# to [ee2152af52bae06b3db4e103b4082b18bf9f255b]
#
# patch "quick_alloc.hh"
# from [597049a62d0a2e6af7df0b19f4945ec7d6458727]
# to [2df81e1736db37f310079c13ac4ef7dd98d42980]
#
# patch "randomfile.hh"
# from [b1f6e5652eaa4a22cef5061e97930ad6ecb0ade7]
# to [00d68b5949086027d0005fa67a4a433802fb9990]
#
# patch "rcs_file.cc"
# from [e6ecf0169b282a6f96e278227893eef9ca10680e]
# to [7e9f91d6c2d5dd3012ad17ea84b7545e28fc48f4]
#
# patch "rcs_file.hh"
# from [be175e779bb2c3dfb0a22a72013d1c25523cbe2d]
# to [7cf27d862430efb640e00330ab59226d4feb6538]
#
# patch "rcs_import.cc"
# from [45f1588e753d5220aa502425e5c32500f3069d7c]
# to [7f7c2ab405b7b8d5758d74713c510fc567191c0f]
#
# patch "refiner.cc"
# from [f2f64fe6722f3501ce1fea2d85516818070151e2]
# to [e286ca0e353379af8a9b3ebf4c0fbf8fd6679e9e]
#
# patch "refiner.hh"
# from [785a738e8476f63f8f8b0c5ecfee085dbd764ade]
# to [cb3b7386d2d3c0836382814daebb8ff4074cf04e]
#
# patch "restrictions.cc"
# from [d7c60923a328aefb9a8429ecb6654586ce31a3f9]
# to [7419cd1cb2303f5a839b67594d6de2943a57309c]
#
# patch "restrictions.hh"
# from [797c6f69647ff3a63870f7870b88353840cf9200]
# to [2559135fa63540e2fe96c33eb01cf846bcb8519e]
#
# patch "revision.cc"
# from [8b358213321192d8a1f65992915ed1b20dd2cbbe]
# to [201081607e581bf1fcf2416486399d2840189617]
#
# patch "revision.hh"
# from [f31cef31d418dc6585a24fc61267b9ff47b0cdf5]
# to [e765cc1218de6df527126268ea5aa8569812e4a0]
#
# patch "roster.cc"
# from [fde433622561c188f726b4b591388c070cc1e391]
# to [2bf3101b93e77a6c51c1267d799220a69a2f5a9d]
#
# patch "roster.hh"
# from [5ff1e7a09081ccdf029648256e717075140eba34]
# to [0dcd64e317aa7842ea2529178f98782569c060c5]
#
# patch "roster_merge.cc"
# from [ff845578375e028041eb8731d2f870ebfcad9eeb]
# to [08c28631640c674a9f6da7b5915786ee6afe27fc]
#
# patch "roster_merge.hh"
# from [6d06c48935d0fb8f0058b3392facca870d8912c7]
# to [481dde9bcf40c4ba63e24f36758fece7b0c18b2b]
#
# patch "safe_map.hh"
# from [b41faf022ccd9f384f6a58f58372cec23e9899d4]
# to [1cf84b0e0943f513d935dc30b5a1f3d0cea63783]
#
# patch "sanity.cc"
# from [eb9f4d9b41e1e2342303e4a618fe5481c10c1eae]
# to [f61b26fbfbb19efc4f9f4f6860d4fafbca57dcb7]
#
# patch "sanity.hh"
# from [be515df1539fe9df44d44091a19e7d3b22927bdf]
# to [675bca26fedbc70535f81d4e3ca66b87527c344e]
#
# patch "schema_migration.cc"
# from [3b14626a3cf5917254ec38dc54edd63b03a2c6f2]
# to [692358550bd9c536ef97ae69eb8893daf3dfb880]
#
# patch "selectors.cc"
# from [6e4fa17b861b28cc469b4adcdcdc58206ab2d654]
# to [ebc515a9552d1eb547de8b220e33eeec2e1059ff]
#
# patch "simplestring_xform.cc"
# from [dcf9e39b1a9c1bb565447a90f6068bdf82a7ee68]
# to [b48839ca2a3f88b7db657c8aaf5a1fd58a29e1f6]
#
# patch "simplestring_xform.hh"
# from [5226320784043474c9f5fd799b8e86ca2f070d8d]
# to [ba15cb86a7300ac69a921bf855a8b8587cf748f9]
#
# patch "smap.hh"
# from [d4acf13bff4208cfe2d87cb93fcb182a290d77f8]
# to [a7675c8e99c425c7ed3531189f8efd74d4eac41a]
#
# patch "tester.cc"
# from [cee71a1f004e66cdd9447c23f1c16f9bfdb0c246]
# to [285226d2e10fb2785ff38afedec7f1c256321ec2]
#
# patch "transforms.cc"
# from [a4754b188afa931450b7dc5b49d077a5a39e8073]
# to [cbf74915e0e547291ea34f948331114d3859383d]
#
# patch "txt2c.cc"
# from [85a07a8bc034fbd6be456d6d5028ba26f362303a]
# to [1298b1829b7a8d0d1c1881913f4f3d407ed850fe]
#
# patch "ui.cc"
# from [cd43c58d97f3b15c45109e37c1fdad43ba84284a]
# to [61e835372390db1152c2b34a71dbba52e27881f5]
#
# patch "ui.hh"
# from [0f806f7ebf686e12e5a67297b39ffeb030abe2dc]
# to [ff05469e55ddf9a1773f13104f61ba27d8820d57]
#
# patch "unit_tests.cc"
# from [5d04490cb15e14a015830a4061607e7985d6e9a6]
# to [dbf88f87be0394902e8c2ddb827c080a95e3361e]
#
# patch "update.cc"
# from [a6ab1750719839bd9da8ac0db8c9181b60167890]
# to [d27699ab18a2f417a8c154d329c2328b92d8750a]
#
# patch "update.hh"
# from [f2eabe7487e1b3b6892cc490575fe271d2c0e675]
# to [e30e90bf8b5165dbcac0041953ed9c0ee20273c1]
#
# patch "uri.cc"
# from [bee5841639bfb4eb75f876c0113d32a2501e313f]
# to [bb529301045c715375306d7577c190a32b8abc82]
#
# patch "vocab.cc"
# from [cd9e884668636ad1bb7cd1607d5d2fd0015fd307]
# to [b709a27fe572e529cafa55bbb31dde0eaddfb6cd]
#
# patch "vocab.hh"
# from [d39554c722d3487a36bbab7cb996e89435153a29]
# to [cac208eacc144d4a80801643162e3e1d235824df]
#
# patch "vocab_terms.hh"
# from [5442a9adf37051de74795ca8d6f5b25ed92ab301]
# to [1db914a9c7154295844d74eb2650ea52fe160a82]
#
# patch "work.cc"
# from [9e2f2b5bf64d0d0b40ce813e21cfd194cdca64d0]
# to [b60e9e0bdf1b336ccc569e0aa8f493118413b9b4]
#
# patch "work.hh"
# from [021506c51a9be289cdffa8872a694b0e9b266c74]
# to [516b8168864623e72df409a791516b2e76e88a84]
#
# patch "xdelta.cc"
# from [a532e5e2f722fc479b28d09deae78cfdc5938368]
# to [4badced7bdde6de4a2c6b89d47503e88979603b3]
#
# patch "xdelta.hh"
# from [a6335a827b6d8ef7d7123d2cf7bacc83c63ead47]
# to [5699839f590c4ce2585dc0ff89429437c59099e9]
#
============================================================
--- ChangeLog 35e34c28ec8501d85401273cd5a75829c775d545
+++ ChangeLog 850c931a795a24580e7fcf2e2ee0a710f502eac5
@@ -1,3 +1,10 @@
+2006-06-03 Lapo Luchini
+
+ * *.cc *.hh: removed extra "\n" from translatable strings.
+ removed trailing spaces.
+
+ * po/it.po: Updated to the new newline-less strings.
+
2006-06-03 Matthew Gregan
* win32/os_strerror.cc (os_strerror): Trim trailing newlines from
============================================================
--- adler32.hh adf2c488c4b0062c31b89b0e7b31d0ce840d2e08
+++ adler32.hh c00437287b948bba66b6195ef74749615512df46
@@ -13,7 +13,7 @@
#include
#include "numeric_vocab.hh"
-struct
+struct
adler32
{
u32 s1, s2, len;
@@ -42,8 +42,8 @@
--len;
}
- adler32()
- : s1(1), s2(0), len(0), mask(widen(0xffff))
+ adler32()
+ : s1(1), s2(0), len(0), mask(widen(0xffff))
{}
adler32(u8 const * ch, std::string::size_type count)
============================================================
--- annotate.cc 7655d63779fde07e30bbd6b2b4a5c74378175a5d
+++ annotate.cc 7bc1472f79bea8bc5b5b2370e35d63b676dd6569
@@ -47,7 +47,7 @@
class annotate_lineage_mapping;
-class annotate_context
+class annotate_context
{
public:
annotate_context(file_id fid, app_state & app);
@@ -105,7 +105,7 @@
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(file_data const & data);
@@ -150,7 +150,7 @@
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_,
@@ -175,39 +175,39 @@
};
-class lineage_merge_node
+class lineage_merge_node
{
public:
typedef shared_ptr splm;
lineage_merge_node(lineage_merge_node const & m)
- : work(m.work),
- incoming_edges(m.incoming_edges),
+ : 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),
+ : work(wu),
+ incoming_edges(incoming),
completed_edges(1)
{}
- void merge(splm incoming,
+ 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;
+ bool iscomplete() const
+ {
+ I(completed_edges <= incoming_edges);
+ return incoming_edges == completed_edges;
}
- annotate_node_work get_work() const
- {
- I(iscomplete());
- return work;
+ annotate_node_work get_work() const
+ {
+ I(iscomplete());
+ return work;
}
private:
@@ -248,7 +248,7 @@
shared_ptr
annotate_context::initial_lineage() const
{
- shared_ptr
+ shared_ptr
res(new annotate_lineage_mapping(file_lines));
return res;
}
@@ -268,26 +268,26 @@
inserter(credit_lines, credit_lines.begin()));
set::const_iterator i;
- for (i = credit_lines.begin(); i != credit_lines.end(); i++)
+ for (i = credit_lines.begin(); i != credit_lines.end(); i++)
{
I(*i < annotations.size());
- if (annotations[*i] == nullid)
+ 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
+ }
+ else
{
- //L(FL("evaluate LEAVING annotations[%d] -> %s\n")
+ //L(FL("evaluate LEAVING annotations[%d] -> %s")
// % *i % annotations[*i]);
}
}
-
+
copied_lines.clear();
touched_lines.clear();
}
@@ -295,7 +295,7 @@
void
annotate_context::set_copied(int index)
{
- //L(FL("annotate_context::set_copied %d\n") % index);
+ //L(FL("annotate_context::set_copied %d") % index);
if (index == -1)
return;
@@ -307,7 +307,7 @@
void
annotate_context::set_touched(int index)
{
- //L(FL("annotate_context::set_touched %d\n") % index);
+ //L(FL("annotate_context::set_touched %d") % index);
if (index == -1)
return;
@@ -329,12 +329,12 @@
{
revision_id null_id;
- for (size_t i=0; i::const_iterator j = equivalent_lines.find(i);
- if (j == equivalent_lines.end())
+ if (j == equivalent_lines.end())
{
L(FL("annotate_equivalent_lines unable to find "
"equivalent for line %d\n") % i);
@@ -389,14 +389,14 @@
void
annotate_context::build_revisions_to_annotations
-(app_state & app,
+(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();
+ for (vector::const_iterator i = annotations.begin();
i != annotations.end(); i++)
{
seen.insert(*i);
@@ -405,17 +405,17 @@
size_t max_note_length = 0;
// build revision -> annotation string mapping
- for (set::const_iterator i = seen.begin();
+ 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,
+ string author(cert_string_value(certs, author_cert_name,
true, false, "@< "));
- string date(cert_string_value(certs, date_cert_name,
+ string date(cert_string_value(certs, date_cert_name,
true, false, "T"));
string result;
@@ -426,14 +426,14 @@
result.append(date);
result.append(": ");
- max_note_length = ((result.size() > max_note_length)
- ? result.size()
+ 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();
+ for (map::iterator i = revs_to_notations.begin();
i != revs_to_notations.end(); i++)
{
size_t l = i->second.size();
@@ -464,15 +464,15 @@
if (global_sanity.brief)
{
if (lastid == annotations[i])
- cout << empty_note << ": "
+ cout << empty_note << ": "
<< file_lines[i] << endl;
else
- cout << revs_to_notations[annotations[i]]
+ cout << revs_to_notations[annotations[i]]
<< file_lines[i] << endl;
lastid = annotations[i];
}
else
- cout << annotations[i] << ": "
+ cout << annotations[i] << ": "
<< file_lines[i] << endl;
}
}
@@ -496,7 +496,7 @@
/*
bool
-annotate_lineage_mapping::equal_interned
+annotate_lineage_mapping::equal_interned
(annotate_lineage_mapping const & rhs) const
{
bool result = true;
@@ -509,9 +509,9 @@
}
size_t limit = min(file_interned.size(), rhs.file_interned.size());
- for (size_t i=0; i::const_iterator i;
- for (count=0, i = lines.begin(); i != lines.end(); i++, count++)
+ for (count=0, i = lines.begin(); i != lines.end(); i++, count++)
{
file_interned.push_back(in.intern(*i));
mapping.push_back(count);
@@ -551,7 +551,7 @@
file_data const & parent_data) const
{
bool verbose = false;
- shared_ptr
+ shared_ptr
parent_lineage(new annotate_lineage_mapping(parent_data));
vector lcs;
@@ -560,7 +560,7 @@
file_interned.end(),
parent_lineage->file_interned.begin(),
parent_lineage->file_interned.end(),
- min(file_interned.size(),
+ min(file_interned.size(),
parent_lineage->file_interned.size()),
back_inserter(lcs));
@@ -569,8 +569,8 @@
"file_lines.size() == %d, "
"parent.file_lines.size() == %d, "
"lcs.size() == %d\n")
- % file_interned.size()
- % parent_lineage->file_interned.size()
+ % file_interned.size()
+ % parent_lineage->file_interned.size()
% lcs.size());
// do the copied lines thing for our annotate_context
@@ -578,38 +578,38 @@
lcs_src_lines.resize(lcs.size());
size_t i, j;
i = j = 0;
- while (i < file_interned.size() && j < lcs.size())
+ 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")
+ L(FL("%s file_interned[%d]: %ld\tlcs[%d]: %ld\tmapping[%d]: %ld")
% parent_rev % i % file_interned[i] % j % lcs[j] % i % mapping[i]);
-
- if (file_interned[i] == lcs[j])
+
+ if (file_interned[i] == lcs[j])
{
acp->set_copied(mapping[i]);
lcs_src_lines[j] = mapping[i];
j++;
- }
- else
+ }
+ else
{
acp->set_touched(mapping[i]);
}
-
+
i++;
}
if (verbose)
- L(FL("loop ended with i: %d, j: %d, lcs.size(): %d\n")
+ L(FL("loop ended with i: %d, j: %d, lcs.size(): %d")
% i % j % lcs.size());
I(j == lcs.size());
// set touched for the rest of the lines in the file
- while (i < file_interned.size())
+ 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 "
@@ -619,30 +619,30 @@
while (i < parent_lineage->file_interned.size() && j < lcs.size())
{
- if (parent_lineage->file_interned[i] == lcs[j])
+ if (parent_lineage->file_interned[i] == lcs[j])
{
parent_lineage->mapping[i] = lcs_src_lines[j];
j++;
- }
- else
+ }
+ else
{
parent_lineage->mapping[i] = -1;
}
if (verbose)
- L(FL("mapping[%d] -> %d\n") % i % parent_lineage->mapping[i]);
-
+ L(FL("mapping[%d] -> %d") % 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())
+ 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]);
+ L(FL("mapping[%d] -> %d") % i % parent_lineage->mapping[i]);
i++;
}
-
+
return parent_lineage;
}
@@ -655,15 +655,15 @@
I(mapping.size() == other.mapping.size());
//I(equal_interned(other)); // expensive check
- for (size_t i=0; i= 0)
mapping[i] = other.mapping[i];
- if (mapping[i] >= 0 && other.mapping[i] >= 0)
+ if (mapping[i] >= 0 && other.mapping[i] >= 0)
{
//I(mapping[i] == other.mapping[i]);
- if (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
@@ -681,7 +681,7 @@
(shared_ptr acp) const
{
vector::const_iterator i;
- for (i=mapping.begin(); i != mapping.end(); i++)
+ for (i=mapping.begin(); i != mapping.end(); i++)
{
acp->set_touched(*i);
}
@@ -693,7 +693,7 @@
(shared_ptr acp) const
{
vector::const_iterator i;
- for (i=mapping.begin(); i != mapping.end(); i++)
+ for (i=mapping.begin(); i != mapping.end(); i++)
{
acp->set_copied(*i);
}
@@ -709,7 +709,7 @@
map const & paths_to_nodes,
map & pending_merge_nodes)
{
- L(FL("do_annotate_node for node %s\n") % work_unit.revision);
+ L(FL("do_annotate_node for node %s") % work_unit.revision);
I(nodes_complete.find(work_unit.revision) == nodes_complete.end());
// nodes_seen.insert(make_pair(work_unit.revision, work_unit.lineage));
@@ -718,14 +718,14 @@
app.db.get_roster(work_unit.revision, roster, markmap);
marking_t marks;
- map::const_iterator mmi =
+ 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")
+ L(FL("found empty content-mark set at rev %s")
% work_unit.revision);
work_unit.lineage->credit_mapped_lines(work_unit.annotations);
work_unit.annotations->evaluate(work_unit.revision);
@@ -762,7 +762,7 @@
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")
% parent_revision % work_unit.revision);
I(!(work_unit.revision == parent_revision));
@@ -770,16 +770,16 @@
if (!parent_roster.has_node(work_unit.fid))
{
- L(FL("file added in %s, continuing\n") % work_unit.revision);
+ L(FL("file added in %s, continuing") % work_unit.revision);
added_in_parent_count++;
continue;
}
// The node was live in the parent, so this represents a delta.
- file_t file_in_child =
+ file_t file_in_child =
downcast_to_file_t(roster.get_node(work_unit.fid));
- file_t file_in_parent =
+ file_t file_in_parent =
downcast_to_file_t(parent_roster.get_node(work_unit.fid));
shared_ptr parent_lineage;
@@ -795,9 +795,9 @@
{
file_data data;
app.db.get_file_version(file_in_parent->content, data);
- L(FL("building parent lineage for parent file %s\n")
+ L(FL("building parent lineage for parent file %s")
% file_in_parent->content);
- parent_lineage
+ parent_lineage
= work_unit.lineage->build_parent_lineage(work_unit.annotations,
parent_revision,
data);
@@ -843,33 +843,33 @@
// 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")
% 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
// % parent_revision); lmn->second.dump();
- if (lmn->second.iscomplete())
+ 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())
{
work_unit.lineage->credit_mapped_lines(work_unit.annotations);
}
-
+
work_unit.annotations->evaluate(work_unit.revision);
nodes_complete.insert(work_unit.revision);
}
void
-find_ancestors(app_state & app,
- revision_id rid,
+find_ancestors(app_state & app,
+ revision_id rid,
map & paths_to_nodes)
{
vector frontier;
@@ -885,7 +885,7 @@
for (set::const_iterator i = parents.begin();
i != parents.end(); ++i)
{
- map::iterator found
+ map::iterator found
= paths_to_nodes.find(*i);
if (found == paths_to_nodes.end())
@@ -905,13 +905,13 @@
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")
+ L(FL("annotating file %s with content %s in revision %s")
% file_node->self % file_node->content % rid);
- shared_ptr
+ shared_ptr
acp(new annotate_context(file_node->content, app));
- shared_ptr lineage
+ shared_ptr lineage
= acp->initial_lineage();
set nodes_complete;
@@ -921,7 +921,7 @@
// build node work unit
deque nodes_to_process;
- annotate_node_work workunit(acp, lineage, rid, file_node->self);
+ 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));
@@ -931,7 +931,7 @@
{
annotate_node_work work = nodes_to_process.front();
nodes_to_process.pop_front();
- do_annotate_node(work, app, nodes_to_process, nodes_complete,
+ do_annotate_node(work, app, nodes_to_process, nodes_complete,
paths_to_nodes, pending_merge_nodes);
++(*revs_ticker);
}
============================================================
--- annotate.hh 2c21ed973503781e799cb80b18ea83a3398010d1
+++ annotate.hh e7a6458c2750aa879f7bb7612e15fa7e84931459
@@ -15,7 +15,7 @@
#include "revision.hh"
#include "app_state.hh"
-void
+void
do_annotate(app_state &app, file_t file_node, revision_id rid);
#endif // defined __ANNOTATE_HH__
============================================================
--- app_state.cc fe9a80dc99e8deb846577ba557e4e4a20addf1c0
+++ app_state.cc a941f16101beb709145100ba58cc9726c7dacbf2
@@ -40,19 +40,19 @@
static string const key_option("key");
static string const keydir_option("keydir");
-app_state::app_state()
- : branch_name(""), db(system_path()),
+app_state::app_state()
+ : branch_name(""), db(system_path()),
keys(this), recursive(false),
stdhooks(true), rcfiles(true), diffs(false),
- no_merges(false), set_default(false),
+ no_merges(false), set_default(false),
verbose(false), date_set(false),
search_root(current_root_path()),
- depth(-1), last(-1), next(-1),
+ 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),
+ execute(false), bind_address(""), bind_port(""),
+ bind_stdio(false), use_transport_auth(true),
missing(false), unknown(false),
- confdir(get_default_confdir()),
+ confdir(get_default_confdir()),
have_set_key_dir(false), no_files(false)
{
db.set_app(this);
@@ -82,10 +82,10 @@
void
app_state::allow_workspace()
{
- L(FL("initializing from directory %s\n") % fs::initial_path().string());
+ L(FL("initializing from directory %s") % fs::initial_path().string());
found_workspace = find_and_go_to_workspace(search_root);
- if (found_workspace)
+ if (found_workspace)
{
// We read the options, but we don't process them here. That's
// done with process_options().
@@ -95,7 +95,7 @@
{
bookkeeping_path dump_path;
get_local_dump_path(dump_path);
- L(FL("setting dump path to %s\n") % dump_path);
+ L(FL("setting dump path to %s") % 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.
@@ -105,7 +105,7 @@
load_rcfiles();
}
-void
+void
app_state::process_options()
{
if (found_workspace) {
@@ -124,15 +124,15 @@
if (branch_name().empty() && !options[branch_option]().empty())
branch_name = options[branch_option];
- L(FL("branch name is '%s'\n") % branch_name());
+ L(FL("branch name is '%s'") % branch_name());
if (!options[key_option]().empty())
- internalize_rsa_keypair_id(options[key_option],
+ internalize_rsa_keypair_id(options[key_option],
signing_key);
}
}
-void
+void
app_state::require_workspace(string const & explanation)
{
N(found_workspace,
@@ -141,21 +141,21 @@
write_options();
}
-void
+void
app_state::create_workspace(system_path const & new_dir)
{
N(!new_dir.empty(), F("invalid directory ''"));
- L(FL("creating workspace in %s\n") % new_dir);
-
+ L(FL("creating workspace in %s") % new_dir);
+
mkdir_p(new_dir);
go_to_workspace(new_dir);
N(!directory_exists(bookkeeping_root),
- F("monotone bookkeeping directory '%s' already exists in '%s'\n")
+ F("monotone bookkeeping directory '%s' already exists in '%s'\n")
% bookkeeping_root % new_dir);
- L(FL("creating bookkeeping directory '%s' for workspace in '%s'\n")
+ L(FL("creating bookkeeping directory '%s' for workspace in '%s'")
% bookkeeping_root % new_dir);
mkdir_p(bookkeeping_root);
@@ -172,7 +172,7 @@
load_rcfiles();
}
-void
+void
app_state::set_database(system_path const & filename)
{
if (!filename.empty()) db.set_filename(filename);
@@ -180,7 +180,7 @@
options[database_option] = filename.as_internal();
}
-void
+void
app_state::set_key_dir(system_path const & filename)
{
if (!filename.empty())
@@ -192,7 +192,7 @@
options[keydir_option] = filename.as_internal();
}
-void
+void
app_state::set_branch(utf8 const & branch)
{
branch_name = branch();
@@ -212,7 +212,7 @@
}
}
-void
+void
app_state::set_signing_key(utf8 const & key)
{
internalize_rsa_keypair_id(key, signing_key);
@@ -220,7 +220,7 @@
options[key_option] = key;
}
-void
+void
app_state::add_key_to_push(utf8 const & key)
{
rsa_keypair_id k;
@@ -228,7 +228,7 @@
keys_to_push.push_back(k);
}
-void
+void
app_state::set_root(system_path const & path)
{
require_path_is_directory
@@ -236,7 +236,7 @@
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);
+ L(FL("set search root to %s") % search_root);
}
void
@@ -268,7 +268,7 @@
}
catch (exception &e)
{
- N(false, F("failed to parse date string '%s': %s")
+ N(false, F("failed to parse date string '%s': %s")
% d % e.what());
}
}
@@ -439,7 +439,7 @@
}
}
-void
+void
app_state::write_options()
{
bookkeeping_path o_path;
============================================================
--- app_state.hh 1e1011728a2da0db22589ac19fe9de5b00d08680
+++ app_state.hh a6cba0558a4c377dda413b557c10781cd33668c1
@@ -88,7 +88,7 @@
// Set if the value of the flag was explicitly given on the command
// line.
- std::map explicit_option_map;
+ std::map explicit_option_map;
void set_is_explicit_option (int option_id);
bool is_explicit_option(int option_id) const;
@@ -98,7 +98,7 @@
// called.
std::map,
+ std::pair,
boost::shared_ptr > > signers;
std::map,
============================================================
--- automate.cc fb597bb9483f7531adbb6e2501188d74063bf60a
+++ automate.cc 8b18ec025d8bd4fe2a1a100de6f4bc8243911933
@@ -68,7 +68,7 @@
{
if (args.size() != 0)
throw usage(help_name);
-
+
output << interface_version << endl;
}
@@ -258,7 +258,7 @@
// a filename was given, if it has attributes, print them
split_path path;
file_path_external(idx(args,0)).split(path);
-
+
if (current.has_node(path))
{
node_t n = current.get_node(path);
@@ -386,10 +386,10 @@
app.db.get_revision_ids(leaves);
multimap graph;
app.db.get_revision_ancestry(graph);
- for (multimap::const_iterator
+ for (multimap::const_iterator
i = graph.begin(); i != graph.end(); ++i)
leaves.erase(i->first);
- for (set::const_iterator i = leaves.begin();
+ for (set::const_iterator i = leaves.begin();
i != leaves.end(); ++i)
output << (*i).inner()() << endl;
}
@@ -466,7 +466,7 @@
// The first would indicate that 07804171823d963f78d6a0ff1763d694dd74ff40
// was a root node; the second would indicate that it had one parent, and
// the third would indicate that it had two parents, i.e., was a merge.
-//
+//
// The output as a whole is alphabetically sorted; additionally, the parents
// within each line are alphabetically sorted.
// Error conditions: None.
@@ -497,7 +497,7 @@
j->second.insert(i->first);
}
- for (map >::const_iterator
+ for (map >::const_iterator
i = child_to_parents.begin();
i != child_to_parents.end(); ++i)
{
@@ -508,7 +508,7 @@
output << endl;
}
}
-
+
// Name: select
// Arguments:
// 1: selector
@@ -555,20 +555,20 @@
struct inventory_item
{
// pre/post rearrangement state
- enum pstate
- { UNCHANGED_PATH, ADDED_PATH, DROPPED_PATH, RENAMED_PATH }
+ enum pstate
+ { UNCHANGED_PATH, ADDED_PATH, DROPPED_PATH, RENAMED_PATH }
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;
inventory_item():
- pre_state(UNCHANGED_PATH), post_state(UNCHANGED_PATH),
- node_state(UNCHANGED_NODE),
+ pre_state(UNCHANGED_PATH), post_state(UNCHANGED_PATH),
+ node_state(UNCHANGED_NODE),
pre_id(0), post_id(0) {}
};
@@ -579,15 +579,15 @@
static void
inventory_pre_state(inventory_map & inventory,
path_set const & paths,
- inventory_item::pstate pre_state,
+ inventory_item::pstate pre_state,
size_t rename_id)
{
for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++)
{
- L(FL("%d %d %s\n") % inventory[*i].pre_state % pre_state % file_path(*i));
+ L(FL("%d %d %s") % inventory[*i].pre_state % pre_state % file_path(*i));
I(inventory[*i].pre_state == inventory_item::UNCHANGED_PATH);
inventory[*i].pre_state = pre_state;
- if (rename_id != 0)
+ if (rename_id != 0)
{
I(inventory[*i].pre_id == 0);
inventory[*i].pre_id = rename_id;
@@ -598,16 +598,16 @@
static void
inventory_post_state(inventory_map & inventory,
path_set const & paths,
- inventory_item::pstate post_state,
+ inventory_item::pstate post_state,
size_t rename_id)
{
for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++)
{
- L(FL("%d %d %s\n") % inventory[*i].post_state
+ L(FL("%d %d %s") % 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)
+ if (rename_id != 0)
{
I(inventory[*i].post_id == 0);
inventory[*i].post_id = rename_id;
@@ -622,7 +622,7 @@
{
for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++)
{
- L(FL("%d %d %s\n") % inventory[*i].node_state
+ L(FL("%d %d %s") % inventory[*i].node_state
% node_state % file_path(*i));
I(inventory[*i].node_state == inventory_item::UNCHANGED_NODE);
inventory[*i].node_state = node_state;
@@ -638,7 +638,7 @@
static size_t rename_id = 1;
- for (rename_map::const_iterator i = renames.begin();
+ for (rename_map::const_iterator i = renames.begin();
i != renames.end(); i++)
{
old_name.clear();
@@ -647,9 +647,9 @@
old_name.insert(i->first);
new_name.insert(i->second);
- inventory_pre_state(inventory, old_name,
+ inventory_pre_state(inventory, old_name,
inventory_item::RENAMED_PATH, rename_id);
- inventory_post_state(inventory, new_name,
+ inventory_post_state(inventory, new_name,
inventory_item::RENAMED_PATH, rename_id);
rename_id++;
@@ -657,10 +657,10 @@
}
static void
-extract_added_file_paths(addition_map const & additions, path_set & paths)
+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);
}
@@ -692,7 +692,7 @@
// '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
+// 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
@@ -736,10 +736,10 @@
path_set nodes_added(cs.dirs_added);
extract_added_file_paths(cs.files_added, nodes_added);
- inventory_pre_state(inventory, cs.nodes_deleted,
+ 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_post_state(inventory, nodes_added,
inventory_item::ADDED_PATH, 0);
classify_roster_paths(curr, unchanged, changed, missing, app);
@@ -749,30 +749,30 @@
file_itemizer u(app, known, unknown, ignored, mask);
walk_tree(file_path(), u);
- inventory_node_state(inventory, unchanged,
+ inventory_node_state(inventory, unchanged,
inventory_item::UNCHANGED_NODE);
- inventory_node_state(inventory, changed,
+ inventory_node_state(inventory, changed,
inventory_item::PATCHED_NODE);
- inventory_node_state(inventory, missing,
+ inventory_node_state(inventory, missing,
inventory_item::MISSING_NODE);
- inventory_node_state(inventory, unknown,
+ inventory_node_state(inventory, unknown,
inventory_item::UNKNOWN_NODE);
- inventory_node_state(inventory, ignored,
+ 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();
+ for (inventory_map::const_iterator i = inventory.begin();
i != inventory.end(); ++i)
{
string path_suffix;
- if (curr.has_node(i->first))
+ if (curr.has_node(i->first))
{
// Explicitly skip the root dir for now. The trailing / dir
// format isn't going to work here.
@@ -785,7 +785,7 @@
path_suffix = "/";
}
- switch (i->second.pre_state)
+ switch (i->second.pre_state)
{
case inventory_item::UNCHANGED_PATH: output << " "; break;
case inventory_item::DROPPED_PATH: output << "D"; break;
@@ -793,7 +793,7 @@
default: I(false); // invalid pre_state
}
- switch (i->second.post_state)
+ switch (i->second.post_state)
{
case inventory_item::UNCHANGED_PATH: output << " "; break;
case inventory_item::RENAMED_PATH: output << "R"; break;
@@ -801,7 +801,7 @@
default: I(false); // invalid post_state
}
- switch (i->second.node_state)
+ switch (i->second.node_state)
{
case inventory_item::UNCHANGED_NODE: output << " "; break;
case inventory_item::PATCHED_NODE: output << "P"; break;
@@ -811,24 +811,24 @@
default: I(false); // invalid node_state
}
- output << " " << i->second.pre_id
- << " " << i->second.post_id
+ output << " " << i->second.pre_id
+ << " " << 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.
-
+
output << path_suffix;
output << endl;
}
}
-namespace
+namespace
{
- namespace syms
+ namespace syms
{
symbol const key("key");
symbol const signature("signature");
@@ -847,12 +847,12 @@
// Arguments:
// 1: a revision id
// Added in: 1.0
-// Purpose: Prints all certificates associated with the given revision
+// 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.
+// '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
@@ -882,9 +882,9 @@
throw usage(help_name);
vector certs;
-
+
transaction_guard guard(app.db, false);
-
+
revision_id rid(idx(args, 0)());
N(app.db.revision_exists(rid), F("No such revision %s") % rid);
hexenc ident(rid.inner());
@@ -895,17 +895,17 @@
certs.push_back(idx(ts, i).inner());
{
- set checked;
+ set checked;
for (size_t i = 0; i < certs.size(); ++i)
{
if (checked.find(idx(certs, i).key) == checked.end() &&
!app.db.public_key_exists(idx(certs, i).key))
- W(F("no public key '%s' found in database\n")
+ W(F("no public key '%s' found in database")
% idx(certs, i).key);
checked.insert(idx(certs, i).key);
}
}
-
+
// Make the output deterministic; this is useful for the test suite,
// in particular.
sort(certs.begin(), certs.end());
@@ -916,7 +916,7 @@
{
basic_io::stanza st;
cert_status status = check_cert(app, idx(certs, i));
- cert_value tv;
+ cert_value tv;
cert_name name = idx(certs, i).name();
set signers;
@@ -925,7 +925,7 @@
rsa_keypair_id keyid = idx(certs, i).key();
signers.insert(keyid);
- bool trusted =
+ bool trusted =
app.lua.hook_get_revision_cert_trust(signers, ident,
name, tv);
@@ -959,7 +959,7 @@
// Name: get_revision
// Arguments:
-// 1: a revision id (optional, determined from the workspace if
+// 1: a revision id (optional, determined from the workspace if
// non-existant)
// Added in: 1.0
@@ -968,11 +968,11 @@
// 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
+// All stanzas are formatted by basic_io. Stanzas are separated
+// by a blank line. Values will be escaped, '\' to '\\' and
// '"' to '\"'.
//
-// Possible values of this first value are along with an ordered list of
+// Possible values of this first value are along with an ordered list of
// basic_io formatted stanzas that will be provided are:
//
// 'format_version'
@@ -1039,7 +1039,7 @@
revision_id old_revision_id;
revision_set rev;
- app.require_workspace();
+ app.require_workspace();
get_base_and_current_roster_shape(old_roster, new_roster, nis, app);
update_current_roster_from_filesystem(new_roster, app);
@@ -1057,7 +1057,7 @@
app.db.get_revision(ident, dat);
}
- L(FL("dumping revision %s\n") % ident);
+ L(FL("dumping revision %s") % ident);
output.write(dat.inner()().data(), dat.inner()().size());
}
@@ -1108,8 +1108,8 @@
revision_id old_revision_id, new_revision_id;
revision_set rev;
temp_node_id_source nis;
-
- app.require_workspace();
+
+ app.require_workspace();
get_base_and_current_roster_shape(old_roster, new_roster, nis, app);
update_current_roster_from_filesystem(new_roster, app);
@@ -1132,11 +1132,11 @@
// There is one basic_io stanza for each file or directory in the
// manifest.
//
-// All stanzas are formatted by basic_io. Stanzas are separated
-// by a blank line. Values will be escaped, '\' to '\\' and
+// All stanzas are formatted by basic_io. Stanzas are separated
+// by a blank line. Values will be escaped, '\' to '\\' and
// '"' to '\"'.
//
-// Possible values of this first value are along with an ordered list of
+// Possible values of this first value are along with an ordered list of
// basic_io formatted stanzas that will be provided are:
//
// 'format_version'
@@ -1180,7 +1180,7 @@
{
revision_id old_revision_id;
- app.require_workspace();
+ app.require_workspace();
get_base_and_current_roster_shape(old_roster, new_roster, nis, app);
update_current_roster_from_filesystem(new_roster, app);
}
@@ -1194,7 +1194,7 @@
calculate_ident(new_roster, mid);
write_manifest_of_roster(new_roster, dat);
- L(FL("dumping manifest %s\n") % mid);
+ L(FL("dumping manifest %s") % mid);
output.write(dat.inner()().data(), dat.inner()().size());
}
@@ -1207,7 +1207,7 @@
//
// Output format: The file contents are output without modification.
//
-// Error conditions: If the file id specified is unknown or invalid prints
+// 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_get_file(vector args,
@@ -1223,7 +1223,7 @@
F("no file version %s found in database") % ident);
file_data dat;
- L(FL("dumping file %s\n") % ident);
+ L(FL("dumping file %s") % ident);
app.db.get_file_version(ident, dat);
output.write(dat.inner()().data(), dat.inner()().size());
}
@@ -1282,7 +1282,7 @@
revision_id r_id(idx(args, 0)());
vector< revision > certs;
-
+
N(app.db.revision_exists(r_id),
F("no such revision '%s'") % r_id);
app.db.get_revision_certs(r_id, certs);
@@ -1313,7 +1313,7 @@
file_id f_id(idx(args, 0)());
file_data f_data;
-
+
N(app.db.file_version_exists(f_id),
F("no such file '%s'") % f_id);
app.db.get_file_version(f_id, f_data);
@@ -1345,7 +1345,7 @@
file_id f_old_id(idx(args, 0)());
file_id f_new_id(idx(args, 1)());
file_data f_old_data, f_new_data;
-
+
N(app.db.file_version_exists(f_old_id),
F("no such revision '%s'") % f_old_id);
N(app.db.file_version_exists(f_new_id),
@@ -1483,9 +1483,9 @@
static ssize_t automate_stdio_read(int d, void *buf, size_t nbytes)
{
ssize_t rv;
-
+
rv = read(d, buf, nbytes);
-
+
E(rv >= 0, F("read from client failed with error code: %d") % rv);
return rv;
}
@@ -1652,7 +1652,7 @@
{
keypair kp;
hexenc privhash, pubhash;
- app.keys.get_key_pair(*i, kp);
+ app.keys.get_key_pair(*i, kp);
key_hash_code(*i, kp.pub, pubhash);
key_hash_code(*i, kp.priv, privhash);
items[(*i)()].get<0>() = pubhash;
============================================================
--- basic_io.cc d7e7798e323fe76518a577010d4eef1f7639a0b1
+++ basic_io.cc a15ef15ce8808a455ee8f9a7edeeb2ba23eddc67
@@ -30,7 +30,7 @@
void basic_io::input_source::err(string const & s)
{
L(FL("error in %s:%d:%d:E: %s") % name % line % col % s);
- throw logic_error((F("error in %s:%d:%d:E: %s")
+ throw logic_error((F("error in %s:%d:%d:E: %s")
% name % line % col % s).str());
}
@@ -40,7 +40,7 @@
in.err(s);
}
-string
+string
basic_io::escape(string const & s)
{
string escaped;
@@ -75,8 +75,8 @@
indent = k().size();
}
-void basic_io::stanza::push_hex_triple(symbol const & k,
- string const & n,
+void basic_io::stanza::push_hex_triple(symbol const & k,
+ string const & n,
hexenc const & v)
{
entries.push_back(make_pair(k, escape(n) + " " + "[" + v() + "]"));
@@ -114,7 +114,7 @@
indent = k().size();
}
-void basic_io::stanza::push_str_triple(symbol const & k,
+void basic_io::stanza::push_str_triple(symbol const & k,
string const & n,
string const & v)
{
@@ -126,7 +126,7 @@
string basic_io::printer::buf;
-basic_io::printer::printer()
+basic_io::printer::printer()
{
buf.clear();
}
============================================================
--- basic_io.hh c40999a46e70901ea3964b4c378d8cb368437dd2
+++ basic_io.hh a690f850ad0a49bd2309216008f8bf931bd0b017
@@ -36,7 +36,7 @@
TOK_NONE
} token_type;
- struct
+ struct
input_source
{
size_t line, col;
@@ -46,20 +46,20 @@
int lookahead;
char c;
input_source(std::string const & in, std::string const & nm)
- : line(1), col(1), in(in), curr(in.begin()),
+ : line(1), col(1), in(in), curr(in.begin()),
name(nm), lookahead(0), c('\0')
{}
- inline void peek()
- {
+ inline void peek()
+ {
if (LIKELY(curr != in.end()))
- lookahead = *curr;
+ lookahead = *curr;
else
lookahead = EOF;
}
- inline void advance()
- {
+ inline void advance()
+ {
if (LIKELY(curr != in.end()))
{
c = *curr;
@@ -71,14 +71,14 @@
++line;
}
}
- peek();
+ peek();
}
void err(std::string const & s);
};
struct
tokenizer
- {
+ {
input_source & in;
std::string::const_iterator begin;
std::string::const_iterator end;
@@ -91,7 +91,7 @@
begin = in.curr;
end = begin;
}
-
+
inline void advance()
{
in.advance();
@@ -106,7 +106,7 @@
inline token_type get_token(std::string & val)
{
in.peek();
-
+
while (true)
{
if (UNLIKELY(in.lookahead == EOF))
@@ -136,7 +136,7 @@
in.err("non-hex character in hex string");
advance();
}
-
+
store(val);
if (UNLIKELY(static_cast(in.lookahead) != ']'))
@@ -163,13 +163,13 @@
// So first, store what we have *before* the escape.
store(val);
-
+
// Then skip over the escape backslash.
in.advance();
// Make sure it's an escape we recognize.
- if (UNLIKELY(!(static_cast(in.lookahead) == '"'
- ||
+ if (UNLIKELY(!(static_cast(in.lookahead) == '"'
+ ||
static_cast(in.lookahead) == '\\')))
in.err("unrecognized character escape");
@@ -185,10 +185,10 @@
if (UNLIKELY(static_cast(in.lookahead) == '\\'))
{
// Skip over any further escape marker.
- in.advance();
+ in.advance();
if (UNLIKELY
- (!(static_cast(in.lookahead) == '"'
- ||
+ (!(static_cast(in.lookahead) == '"'
+ ||
static_cast(in.lookahead) == '\\')))
in.err("unrecognized character escape");
}
@@ -199,18 +199,18 @@
if (static_cast(in.lookahead) != '"')
in.err("string did not end with '\"'");
in.advance();
-
+
return basic_io::TOK_STRING;
}
advance();
}
-
+
store(val);
if (UNLIKELY(static_cast(in.lookahead) != '"'))
in.err("string did not end with '\"'");
in.advance();
-
+
return basic_io::TOK_STRING;
}
else
@@ -221,24 +221,24 @@
std::string escape(std::string const & s);
- struct
+ struct
stanza
{
stanza();
- size_t indent;
+ 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,
+ 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,
+ 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);
};
- struct
+ struct
printer
{
static std::string buf;
@@ -255,13 +255,13 @@
token.reserve(128);
advance();
}
-
+
std::string token;
token_type ttype;
void err(std::string const & s);
std::string tt2str(token_type tt);
-
+
inline void advance()
{
ttype = tok.get_token(token);
@@ -270,37 +270,37 @@
inline void eat(token_type want)
{
if (ttype != want)
- err("wanted "
+ err("wanted "
+ tt2str(want)
+ ", got "
+ tt2str(ttype)
- + (token.empty()
- ? std::string("")
+ + (token.empty()
+ ? std::string("")
: (std::string(" with value ") + token)));
advance();
}
-
+
inline void str() { eat(basic_io::TOK_STRING); }
inline void sym() { eat(basic_io::TOK_SYMBOL); }
inline void hex() { eat(basic_io::TOK_HEX); }
-
+
inline void str(std::string & v) { v = token; str(); }
inline void sym(std::string & v) { v = token; sym(); }
inline void hex(std::string & v) { v = token; hex(); }
inline bool symp() { return ttype == basic_io::TOK_SYMBOL; }
- inline bool symp(symbol const & val)
+ inline bool symp(symbol const & val)
{
return ttype == basic_io::TOK_SYMBOL && token == val();
}
inline void esym(symbol const & val)
{
if (!(ttype == basic_io::TOK_SYMBOL && token == val()))
- err("wanted symbol '"
+ err("wanted symbol '"
+ val() +
+ "', got "
+ tt2str(ttype)
- + (token.empty()
- ? std::string("")
+ + (token.empty()
+ ? std::string("")
: (std::string(" with value ") + token)));
advance();
}
============================================================
--- cert.cc 6e1ffc5b990cf82e6ee2a7d1492127b2f71aa105
+++ cert.cc 00b0049d57be97e2f990812639b0d917913eaef2
@@ -56,25 +56,25 @@
// FIXME: the bogus-cert family of functions is ridiculous
// and needs to be replaced, or at least factored.
-struct
+struct
bogus_cert_p
{
app_state & app;
bogus_cert_p(app_state & a) : app(a) {};
-
+
bool cert_is_bogus(cert const & c) const
{
cert_status status = check_cert(app, c);
if (status == cert_ok)
{
- L(FL("cert ok\n"));
+ L(FL("cert ok"));
return false;
}
else if (status == cert_bad)
{
string txt;
cert_signable_text(c, txt);
- W(F("ignoring bad signature by '%s' on '%s'\n") % c.key() % txt);
+ W(F("ignoring bad signature by '%s' on '%s'") % c.key() % txt);
return true;
}
else
@@ -82,24 +82,24 @@
I(status == cert_unknown);
string txt;
cert_signable_text(c, txt);
- W(F("ignoring unknown signature by '%s' on '%s'\n") % c.key() % txt);
+ W(F("ignoring unknown signature by '%s' on '%s'") % c.key() % txt);
return true;
}
}
- bool operator()(revision const & c) const
+ bool operator()(revision const & c) const
{
return cert_is_bogus(c.inner());
}
- bool operator()(manifest const & c) const
+ bool operator()(manifest const & c) const
{
return cert_is_bogus(c.inner());
}
};
-void
+void
erase_bogus_certs(vector< manifest > & certs,
app_state & app)
{
@@ -139,20 +139,20 @@
get<1>(i->first),
decoded_value))
{
- L(FL("trust function liked %d signers of %s cert on manifest %s\n")
+ L(FL("trust function liked %d signers of %s cert on manifest %s")
% i->second.first->size() % get<1>(i->first) % get<0>(i->first));
tmp_certs.push_back(*(i->second.second));
}
else
{
- W(F("trust function disliked %d signers of %s cert on manifest %s\n")
+ W(F("trust function disliked %d signers of %s cert on manifest %s")
% i->second.first->size() % get<1>(i->first) % get<0>(i->first));
}
}
certs = tmp_certs;
}
-void
+void
erase_bogus_certs(vector< revision > & certs,
app_state & app)
{
@@ -192,13 +192,13 @@
get<1>(i->first),
decoded_value))
{
- L(FL("trust function liked %d signers of %s cert on revision %s\n")
+ L(FL("trust function liked %d signers of %s cert on revision %s")
% i->second.first->size() % get<1>(i->first) % get<0>(i->first));
tmp_certs.push_back(*(i->second.second));
}
else
{
- W(F("trust function disliked %d signers of %s cert on revision %s\n")
+ W(F("trust function disliked %d signers of %s cert on revision %s")
% i->second.first->size() % get<1>(i->first) % get<0>(i->first));
}
}
@@ -208,7 +208,7 @@
// cert-managing routines
-cert::cert()
+cert::cert()
{}
cert::cert(hexenc const & ident,
@@ -218,7 +218,7 @@
: ident(ident), name(name), value(value), key(key)
{}
-cert::cert(hexenc const & ident,
+cert::cert(hexenc const & ident,
cert_name const & name,
base64 const & value,
rsa_keypair_id const & key,
@@ -226,23 +226,23 @@
: ident(ident), name(name), value(value), key(key), sig(sig)
{}
-bool
+bool
cert::operator<(cert const & other) const
{
return (ident < other.ident)
|| ((ident == other.ident) && name < other.name)
- || (((ident == other.ident) && name == other.name)
- && value < other.value)
- || ((((ident == other.ident) && name == other.name)
+ || (((ident == other.ident) && name == other.name)
+ && value < other.value)
+ || ((((ident == other.ident) && name == other.name)
&& value == other.value) && key < other.key)
- || (((((ident == other.ident) && name == other.name)
+ || (((((ident == other.ident) && name == other.name)
&& value == other.value) && key == other.key) && sig < other.sig);
}
-bool
+bool
cert::operator==(cert const & other) const
{
- return
+ return
(ident == other.ident)
&& (name == other.name)
&& (value == other.value)
@@ -251,24 +251,24 @@
}
// netio support
-
-void
+
+void
read_cert(string const & in, cert & t)
{
size_t pos = 0;
- id hash = extract_substring(in, pos,
- constants::merkle_hash_length_in_bytes,
+ id hash = extract_substring(in, pos,
+ constants::merkle_hash_length_in_bytes,
"cert hash");
- id ident = extract_substring(in, pos,
- constants::merkle_hash_length_in_bytes,
+ id ident = extract_substring(in, pos,
+ constants::merkle_hash_length_in_bytes,
"cert ident");
string name, val, key, sig;
extract_variable_length_string(in, name, pos, "cert name");
extract_variable_length_string(in, val, pos, "cert val");
extract_variable_length_string(in, key, pos, "cert key");
extract_variable_length_string(in, sig, pos, "cert sig");
- assert_end_of_buffer(in, pos, "cert");
-
+ assert_end_of_buffer(in, pos, "cert");
+
hexenc hid;
base64 bval;
base64 bsig;
@@ -293,9 +293,9 @@
t = tmp;
}
-void
+void
write_cert(cert const & t, string & out)
-{
+{
string name, key;
hexenc hash;
id ident_decoded, hash_decoded;
@@ -316,15 +316,15 @@
insert_variable_length_string(sig_decoded(), out);
}
-void
+void
cert_signable_text(cert const & t,
string & out)
{
out = (FL("address@hidden:%s]") % t.name % t.ident % remove_ws(t.value())).str();
- L(FL("cert: signable text %s\n") % out);
+ L(FL("cert: signable text %s") % out);
}
-void
+void
cert_hash_code(cert const & t, hexenc & out)
{
string tmp(t.ident()
@@ -371,7 +371,7 @@
}
}
-void
+void
calculate_cert(app_state & app, cert & t)
{
string signed_text;
@@ -385,7 +385,7 @@
make_signature(app, t.key, kp.priv, signed_text, t.sig);
}
-cert_status
+cert_status
check_cert(app_state & app, cert const & t)
{
@@ -437,7 +437,7 @@
if (app.lua.hook_get_branch_key(branch, key))
return;
}
-
+
vector all_privkeys;
app.keys.get_keys(all_privkeys);
N(!all_privkeys.empty(), F("you have no private key to make signatures with\n"
@@ -445,10 +445,10 @@
N(all_privkeys.size() == 1,
F("you have multiple private keys\n"
"pick one to use for signatures by adding '-k' to your command"));
- key = all_privkeys[0];
+ key = all_privkeys[0];
}
-void
+void
guess_branch(revision_id const & ident,
app_state & app,
cert_value & branchname)
@@ -468,20 +468,20 @@
app.db.get_revision_certs(ident, branch, certs);
erase_bogus_certs(certs, app);
- N(certs.size() != 0,
+ N(certs.size() != 0,
F("no branch certs found for revision %s, "
"please provide a branch name") % ident);
-
+
N(certs.size() == 1,
F("multiple branch certs found for revision %s, "
"please provide a branch name") % ident);
-
+
decode_base64(certs[0].inner().value, branchname);
app.set_branch(branchname());
}
}
-void
+void
make_simple_cert(hexenc const & id,
cert_name const & nm,
cert_value const & cv,
@@ -497,7 +497,7 @@
c = t;
}
-static void
+static void
put_simple_revision_cert(revision_id const & id,
cert_name const & nm,
cert_value const & val,
@@ -510,8 +510,8 @@
pc.consume_revision_cert(cc);
}
-void
-cert_revision_in_branch(revision_id const & rev,
+void
+cert_revision_in_branch(revision_id const & rev,
cert_value const & branchname,
app_state & app,
packet_consumer & pc)
@@ -520,7 +520,7 @@
branchname, app, pc);
}
-void
+void
get_branch_heads(cert_value const & branchname,
app_state & app,
set & heads)
@@ -554,8 +554,8 @@
string const testresult_cert_name = "testresult";
-void
-cert_revision_date_time(revision_id const & m,
+void
+cert_revision_date_time(revision_id const & m,
boost::posix_time::ptime t,
app_state & app,
packet_consumer & pc)
@@ -564,38 +564,38 @@
put_simple_revision_cert(m, date_cert_name, val, app, pc);
}
-void
-cert_revision_date_time(revision_id const & m,
+void
+cert_revision_date_time(revision_id const & m,
time_t t,
app_state & app,
packet_consumer & pc)
{
// make sure you do all your CVS conversions by 2038!
- boost::posix_time::ptime tmp(boost::gregorian::date(1970,1,1),
+ boost::posix_time::ptime tmp(boost::gregorian::date(1970,1,1),
boost::posix_time::seconds(static_cast(t)));
cert_revision_date_time(m, tmp, app, pc);
}
-void
-cert_revision_date_now(revision_id const & m,
+void
+cert_revision_date_now(revision_id const & m,
app_state & app,
packet_consumer & pc)
{
cert_revision_date_time(m, boost::posix_time::second_clock::universal_time(), app, pc);
}
-void
-cert_revision_author(revision_id const & m,
+void
+cert_revision_author(revision_id const & m,
string const & author,
app_state & app,
packet_consumer & pc)
{
- put_simple_revision_cert(m, author_cert_name,
- author, app, pc);
+ put_simple_revision_cert(m, author_cert_name,
+ author, app, pc);
}
-void
-cert_revision_author_default(revision_id const & m,
+void
+cert_revision_author_default(revision_id const & m,
app_state & app,
packet_consumer & pc)
{
@@ -609,39 +609,39 @@
cert_revision_author(m, author, app, pc);
}
-void
-cert_revision_tag(revision_id const & m,
+void
+cert_revision_tag(revision_id const & m,
string const & tagname,
app_state & app,
packet_consumer & pc)
{
- put_simple_revision_cert(m, tag_cert_name,
- tagname, app, pc);
+ put_simple_revision_cert(m, tag_cert_name,
+ tagname, app, pc);
}
-void
-cert_revision_changelog(revision_id const & m,
+void
+cert_revision_changelog(revision_id const & m,
string const & changelog,
app_state & app,
packet_consumer & pc)
{
- put_simple_revision_cert(m, changelog_cert_name,
- changelog, app, pc);
+ put_simple_revision_cert(m, changelog_cert_name,
+ changelog, app, pc);
}
-void
-cert_revision_comment(revision_id const & m,
+void
+cert_revision_comment(revision_id const & m,
string const & comment,
app_state & app,
packet_consumer & pc)
{
- put_simple_revision_cert(m, comment_cert_name,
- comment, app, pc);
+ put_simple_revision_cert(m, comment_cert_name,
+ comment, app, pc);
}
-void
-cert_revision_testresult(revision_id const & r,
+void
+cert_revision_testresult(revision_id const & r,
string const & results,
app_state & app,
packet_consumer & pc)
@@ -660,10 +660,10 @@
else
throw informative_failure("could not interpret test results, tried '0/1' 'yes/no', 'true/false', 'pass/fail'");
- put_simple_revision_cert(r, testresult_cert_name, lexical_cast(passed), app, pc);
+ put_simple_revision_cert(r, testresult_cert_name, lexical_cast(passed), app, pc);
}
-
+
#ifdef BUILD_UNIT_TESTS
#include "unit_tests.hh"
============================================================
--- cert.hh 6ccf880b677340a2460ced453c93700b7bae07b3
+++ cert.hh 442db182fbe3a8f3c1313ddcc34f911b05371f02
@@ -80,13 +80,13 @@
extern std::string const branch_cert_name;
-void
-cert_revision_in_branch(revision_id const & ctx,
+void
+cert_revision_in_branch(revision_id const & ctx,
cert_value const & branchname,
app_state & app,
packet_consumer & pc);
-void
+void
get_branch_heads(cert_value const & branchname,
app_state & app,
std::set & heads);
@@ -99,7 +99,7 @@
void
get_user_key(rsa_keypair_id & key, app_state & app);
-void
+void
guess_branch(revision_id const & id,
app_state & app,
cert_value & branchname);
@@ -111,54 +111,54 @@
extern std::string const comment_cert_name;
extern std::string const testresult_cert_name;
-void
-cert_revision_date_now(revision_id const & m,
+void
+cert_revision_date_now(revision_id const & m,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_date_time(revision_id const & m,
+void
+cert_revision_date_time(revision_id const & m,
boost::posix_time::ptime t,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_date_time(revision_id const & m,
+void
+cert_revision_date_time(revision_id const & m,
time_t time,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_author(revision_id const & m,
+void
+cert_revision_author(revision_id const & m,
std::string const & author,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_author_default(revision_id const & m,
+void
+cert_revision_author_default(revision_id const & m,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_tag(revision_id const & m,
+void
+cert_revision_tag(revision_id const & m,
std::string const & tagname,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_changelog(revision_id const & m,
+void
+cert_revision_changelog(revision_id const & m,
std::string const & changelog,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_comment(revision_id const & m,
+void
+cert_revision_comment(revision_id const & m,
std::string const & comment,
app_state & app,
packet_consumer & pc);
-void
-cert_revision_testresult(revision_id const & m,
+void
+cert_revision_testresult(revision_id const & m,
std::string const & results,
app_state & app,
packet_consumer & pc);
============================================================
--- charset.cc f55e73d42872fbbf269b3cd9f41af9217030f1a6
+++ charset.cc fc0b370c50ee32b1bc3bb110e4181f3a841edbae
@@ -17,7 +17,7 @@
// general character code conversion routines
-static string
+static string
system_charset()
{
char const * locale_charset_name = stringprep_locale_charset ();
@@ -26,17 +26,17 @@
return sys_charset;
}
-void
+void
charset_convert(string const & src_charset,
string const & dst_charset,
- string const & src,
+ string const & src,
string & dst)
{
if (src_charset == dst_charset)
dst = src;
else
{
- L(FL("converting %d bytes from %s to %s\n") % src.size()
+ L(FL("converting %d bytes from %s to %s") % src.size()
% src_charset % dst_charset);
char * converted = stringprep_convert(src.c_str(),
dst_charset.c_str(),
@@ -49,7 +49,7 @@
}
}
-void
+void
system_to_utf8(external const & ext, utf8 & utf)
{
string out;
@@ -71,7 +71,7 @@
// A UTF-8 escape: consume the full escape.
++i;
++sz;
- while (i != u.end()
+ while (i != u.end()
&& (static_cast(*i) & static_cast(0x80))
&& (!(static_cast(*i) & static_cast(0x40))))
++i;
@@ -143,7 +143,7 @@
}
// this function must be fast. do not make it slow.
-void
+void
utf8_to_system(utf8 const & utf, string & ext)
{
if (system_charset_is_utf8())
@@ -155,7 +155,7 @@
charset_convert("UTF-8", system_charset(), utf(), ext);
}
-void
+void
utf8_to_system(utf8 const & utf, external & ext)
{
string out;
@@ -246,7 +246,7 @@
return true;
}
-static string
+static string
decode_idna_error(int err)
{
switch (static_cast(err))
@@ -266,11 +266,11 @@
return "unknown error";
}
-void
+void
ace_to_utf8(ace const & a, utf8 & utf)
{
char *out = NULL;
- L(FL("converting %d bytes from IDNA ACE to UTF-8\n") % a().size());
+ L(FL("converting %d bytes from IDNA ACE to UTF-8") % a().size());
int res = idna_to_unicode_8z8z(a().c_str(), &out, IDNA_USE_STD3_ASCII_RULES);
N(res == IDNA_SUCCESS || res == IDNA_NO_ACE_PREFIX,
F("error converting %d UTF-8 bytes to IDNA ACE: %s")
@@ -280,11 +280,11 @@
free(out);
}
-void
+void
utf8_to_ace(utf8 const & utf, ace & a)
{
char *out = NULL;
- L(FL("converting %d bytes from UTF-8 to IDNA ACE\n") % utf().size());
+ L(FL("converting %d bytes from UTF-8 to IDNA ACE") % utf().size());
int res = idna_to_ascii_8z(utf().c_str(), &out, IDNA_USE_STD3_ASCII_RULES);
N(res == IDNA_SUCCESS,
F("error converting %d UTF-8 bytes to IDNA ACE: %s")
@@ -294,7 +294,7 @@
free(out);
}
-void
+void
internalize_cert_name(utf8 const & utf, cert_name & c)
{
ace a;
@@ -302,7 +302,7 @@
c = a();
}
-void
+void
internalize_cert_name(external const & ext, cert_name & c)
{
utf8 utf;
@@ -310,25 +310,25 @@
internalize_cert_name(utf, c);
}
-void
+void
externalize_cert_name(cert_name const & c, utf8 & utf)
{
ace_to_utf8(ace(c()), utf);
}
-void
+void
externalize_cert_name(cert_name const & c, external & ext)
{
utf8 utf;
externalize_cert_name(c, utf);
- utf8_to_system(utf, ext);
+ utf8_to_system(utf, ext);
}
-void
+void
internalize_rsa_keypair_id(utf8 const & utf, rsa_keypair_id & key)
{
string tmp;
- typedef boost::tokenizer >
+ typedef boost::tokenizer >
tokenizer;
char_separator sep("", ".@", boost::keep_empty_tokens);
tokenizer tokens(utf(), sep);
@@ -349,7 +349,7 @@
key = tmp;
}
-void
+void
internalize_rsa_keypair_id(external const & ext, rsa_keypair_id & key)
{
utf8 utf;
@@ -357,11 +357,11 @@
internalize_rsa_keypair_id(utf, key);
}
-void
+void
externalize_rsa_keypair_id(rsa_keypair_id const & key, utf8 & utf)
{
string tmp;
- typedef boost::tokenizer >
+ typedef boost::tokenizer >
tokenizer;
char_separator sep("", ".@", boost::keep_empty_tokens);
tokenizer tokens(key(), sep);
@@ -383,7 +383,7 @@
utf = tmp;
}
-void
+void
externalize_rsa_keypair_id(rsa_keypair_id const & key, external & ext)
{
utf8 utf;
@@ -391,7 +391,7 @@
utf8_to_system(utf, ext);
}
-void
+void
internalize_var_domain(utf8 const & utf, var_domain & d)
{
ace a;
@@ -399,7 +399,7 @@
d = a();
}
-void
+void
internalize_var_domain(external const & ext, var_domain & d)
{
utf8 utf;
@@ -407,18 +407,18 @@
internalize_var_domain(utf, d);
}
-void
+void
externalize_var_domain(var_domain const & d, utf8 & utf)
{
ace_to_utf8(ace(d()), utf);
}
-void
+void
externalize_var_domain(var_domain const & d, external & ext)
{
utf8 utf;
externalize_var_domain(d, utf);
- utf8_to_system(utf, ext);
+ utf8_to_system(utf, ext);
}
@@ -429,7 +429,7 @@
#define IDNA_ACE_PREFIX "xn--"
#define IDNA_SUCCESS 0
-struct
+struct
idna
{
char *name;
@@ -588,7 +588,7 @@
IDNA_SUCCESS, IDNA_SUCCESS},
};
-static void
+static void
check_idna_encoding()
{
putenv("CHARSET=UTF-8");
@@ -598,8 +598,8 @@
BOOST_CHECKPOINT("IDNA language: " + string(idna_vec[i].name));
size_t p, q;
- char *uc = stringprep_ucs4_to_utf8(idna_vec[i].in,
- idna_vec[i].inlen,
+ char *uc = stringprep_ucs4_to_utf8(idna_vec[i].in,
+ idna_vec[i].inlen,
&p, &q);
utf8 utf = string(uc);
utf8 tutf;
@@ -608,7 +608,7 @@
ace a = string(idna_vec[i].out);
ace tace;
utf8_to_ace(utf, tace);
- L(FL("ACE-encoded %s: '%s'\n") % idna_vec[i].name % tace());
+ L(FL("ACE-encoded %s: '%s'") % idna_vec[i].name % tace());
BOOST_CHECK(lowercase(a()) == lowercase(tace()));
ace_to_utf8(a, tutf);
BOOST_CHECK(lowercase(utf()) == lowercase(tutf()));
@@ -844,7 +844,7 @@
}
-void
+void
add_charset_tests(test_suite * suite)
{
I(suite);
============================================================
--- cleanup.hh a450ba2ba4311f0a298c1e102bd5c5f0c5fb2258
+++ cleanup.hh 5af6a253b76166eafdaf7a6bb0b27b08469ca10e
@@ -14,12 +14,12 @@
T ptr;
R (* cleanup)(T);
explicit cleanup_ptr(T p, R (*c)(T)) : ptr(p), cleanup(c) {}
- ~cleanup_ptr()
+ ~cleanup_ptr()
{
if (cleanup && ptr)
cleanup(ptr);
}
- T operator()()
+ T operator()()
{
return ptr;
}
============================================================
--- cmd.hh 76fe4ececf8426484d8a4aca7c54237c49ce6100
+++ cmd.hh b3216c27888503db9b3d33aed451f013f54e240a
@@ -24,7 +24,7 @@
};
extern const no_opts OPT_NONE;
- struct command
+ struct command
{
// NB: these strings are stred _un_translated
// because we cannot translate them until after main starts, by which time
@@ -46,7 +46,7 @@
};
};
-std::string
+std::string
get_stdin();
std::string
@@ -54,20 +54,20 @@
revision_id const & id);
void
-complete(app_state & app,
+complete(app_state & app,
std::string const & str,
revision_id & completion,
bool must_exist=true);
-void
-complete(app_state & app,
+void
+complete(app_state & app,
std::string const & str,
std::set & completion,
bool must_exist=true);
template
-static void
-complete(app_state & app,
+static void
+complete(app_state & app,
std::string const & str,
ID & completion)
{
@@ -90,8 +90,8 @@
err += (i->inner()() + "\n");
N(completions.size() == 1, i18n_format(err));
}
- completion = *(completions.begin());
- P(F("expanded partial id '%s' to '%s'\n")
+ completion = *(completions.begin());
+ P(F("expanded partial id '%s' to '%s'")
% str % completion);
}
============================================================
--- cmd_automate.cc 37baff9dc561c7fad66b88559fda15b14f2a4f55
+++ cmd_automate.cc 6f285920e44f4c8c2d262c08b7e06de1f4b4ae65
@@ -35,7 +35,7 @@
"packet_for_fdata FILEID\n"
"packet_for_fdelta OLD_FILE NEW_FILE\n"
"keys\n"),
- N_("automation interface"),
+ N_("automation interface"),
OPT_NONE)
{
if (args.size() == 0)
============================================================
--- cmd_db.cc 7403b1a1bb54a12e01dee5fcbbc3db7aaf8ba557
+++ cmd_db.cc 556cb1dad30d2b6ad3a50fd7951927afdf5ce6d2
@@ -32,7 +32,7 @@
app.db.delete_existing_rev_and_certs(ident);
}
-CMD(db, N_("database"),
+CMD(db, N_("database"),
N_("init\n"
"info\n"
"version\n"
@@ -46,7 +46,7 @@
"check\n"
"changesetify\n"
"rosterify\n"
- "set_epoch BRANCH EPOCH\n"),
+ "set_epoch BRANCH EPOCH\n"),
N_("manipulate database state"),
OPT_DROP_ATTR)
{
@@ -149,7 +149,7 @@
F("non-hex digits in partial id"));
if (idx(args, 0)() == "revision")
- {
+ {
set completions;
app.db.complete(idx(args, 1)(), completions);
for (set::const_iterator i = completions.begin();
@@ -181,6 +181,6 @@
}
}
else
- throw usage(name);
+ throw usage(name);
}
============================================================
--- cmd_diff_log.cc c2d375111f402eac0c82134f174627d88608dcb0
+++ cmd_diff_log.cc 4d963e42f2b37a325e6afb0e3f0f9ee6995f2525
@@ -38,7 +38,7 @@
void print(ostream & os, size_t max_cols) const;
};
-changes_summary::changes_summary(void)
+changes_summary::changes_summary(void)
{
}
@@ -53,30 +53,30 @@
// are not really sensible to union; they refer to different trees
// so mixing them up in a single set is potentially ambiguous.
- copy(c.nodes_deleted.begin(), c.nodes_deleted.end(),
+ copy(c.nodes_deleted.begin(), c.nodes_deleted.end(),
inserter(cs.nodes_deleted, cs.nodes_deleted.begin()));
- copy(c.files_added.begin(), c.files_added.end(),
+ copy(c.files_added.begin(), c.files_added.end(),
inserter(cs.files_added, cs.files_added.begin()));
- copy(c.dirs_added.begin(), c.dirs_added.end(),
+ copy(c.dirs_added.begin(), c.dirs_added.end(),
inserter(cs.dirs_added, cs.dirs_added.begin()));
- copy(c.nodes_renamed.begin(), c.nodes_renamed.end(),
+ copy(c.nodes_renamed.begin(), c.nodes_renamed.end(),
inserter(cs.nodes_renamed, cs.nodes_renamed.begin()));
- copy(c.deltas_applied.begin(), c.deltas_applied.end(),
+ copy(c.deltas_applied.begin(), c.deltas_applied.end(),
inserter(cs.deltas_applied, cs.deltas_applied.begin()));
- copy(c.attrs_cleared.begin(), c.attrs_cleared.end(),
+ copy(c.attrs_cleared.begin(), c.attrs_cleared.end(),
inserter(cs.attrs_cleared, cs.attrs_cleared.begin()));
- copy(c.attrs_set.begin(), c.attrs_set.end(),
+ copy(c.attrs_set.begin(), c.attrs_set.end(),
inserter(cs.attrs_set, cs.attrs_set.begin()));
}
-static void
-print_indented_set(ostream & os,
+static void
+print_indented_set(ostream & os,
path_set const & s,
size_t max_cols)
{
@@ -89,7 +89,7 @@
if (cols > 8 && cols + str.size() + 1 >= max_cols)
{
cols = 8;
- os << "\n" << " ";
+ os << "\n" << " ";
}
os << " " << str;
cols += str.size() + 1;
@@ -106,7 +106,7 @@
os << "Deleted entries:" << "\n";
print_indented_set(os, cs.nodes_deleted, max_cols);
}
-
+
if (! cs.nodes_renamed.empty())
{
os << "Renamed entries:" << "\n";
@@ -163,7 +163,7 @@
app_state & app,
bool new_is_archived)
{
- for (map >::const_iterator
+ for (map >::const_iterator
i = cs.deltas_applied.begin();
i != cs.deltas_applied.end(); ++i)
{
@@ -202,7 +202,7 @@
}
}
-static void
+static void
dump_diffs(cset const & cs,
app_state & app,
bool new_is_archived,
@@ -213,7 +213,7 @@
// 60 is somewhat arbitrary, but less than 80
string patch_sep = string(60, '=');
- for (map::const_iterator
+ for (map::const_iterator
i = cs.files_added.begin();
i != cs.files_added.end(); ++i)
{
@@ -223,7 +223,7 @@
cout << patch_sep << "\n";
data unpacked;
vector lines;
-
+
if (new_is_archived)
{
file_data dat;
@@ -235,17 +235,17 @@
read_localized_data(file_path(i->first),
unpacked, app.lua);
}
-
+
if (guess_binary(unpacked()))
cout << "# " << file_path(i->first) << " is binary\n";
else
- {
+ {
split_into_lines(unpacked(), lines);
if (! lines.empty())
{
- 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());
+ cout << (FL("--- %s\t%s") % file_path(i->first) % i->second)
+ << (FL("+++ %s\t%s") % file_path(i->first) % i->second)
+ << (FL("@@ -0,0 +1,%d @@") % lines.size());
for (vector::const_iterator j = lines.begin();
j != lines.end(); ++j)
{
@@ -257,14 +257,14 @@
map reverse_rename_map;
- for (map::const_iterator
+ for (map::const_iterator
i = cs.nodes_renamed.begin();
i != cs.nodes_renamed.end(); ++i)
{
reverse_rename_map.insert(make_pair(i->second, i->first));
}
- for (map >::const_iterator
+ for (map >::const_iterator
i = cs.deltas_applied.begin();
i != cs.deltas_applied.end(); ++i)
{
@@ -276,10 +276,10 @@
vector old_lines, new_lines;
cout << patch_sep << "\n";
-
+
app.db.get_file_version(delta_entry_src(i), f_old);
data_old = f_old.inner();
-
+
if (new_is_archived)
{
file_data f_new;
@@ -288,11 +288,11 @@
}
else
{
- read_localized_data(file_path(delta_entry_path(i)),
+ read_localized_data(file_path(delta_entry_path(i)),
data_new, app.lua);
}
-
- if (guess_binary(data_new()) ||
+
+ if (guess_binary(data_new()) ||
guess_binary(data_old()))
cout << "# " << file_path(delta_entry_path(i)) << " is binary\n";
else
@@ -309,8 +309,8 @@
if (re != reverse_rename_map.end())
src_path = re->second;
- make_diff(file_path(src_path).as_internal(),
- file_path(dst_path).as_internal(),
+ make_diff(file_path(src_path).as_internal(),
+ file_path(dst_path).as_internal(),
delta_entry_src(i),
delta_entry_dst(i),
old_lines, new_lines,
@@ -319,7 +319,7 @@
}
}
-static void
+static void
dump_diffs(cset const & cs,
app_state & app,
bool new_is_archived,
@@ -329,7 +329,7 @@
dump_diffs(cs, app, new_is_archived, type, dummy);
}
-CMD(diff, N_("informative"), N_("[PATH]..."),
+CMD(diff, N_("informative"), N_("[PATH]..."),
N_("show current diffs on stdout.\n"
"If one revision is given, the diff between the workspace and\n"
"that revision is shown. If two revisions are given, the diff between\n"
@@ -391,7 +391,7 @@
// N(r_new.edges.size() == 1, F("current revision has no ancestor"));
restriction mask(args, app.exclude_patterns, old_roster, new_roster, app);
-
+
update_current_roster_from_filesystem(new_roster, mask, app);
make_restricted_csets(old_roster, new_roster, included, excluded, mask);
check_restricted_cset(old_roster, included);
@@ -416,12 +416,12 @@
app.db.get_roster(r_new_id, new_roster);
restriction mask(args, app.exclude_patterns, old_roster, new_roster, app);
-
+
// FIXME: this is *possibly* a UI bug, insofar as we
// look at the restriction name(s) you provided on the command
// line in the context of new and old, *not* the working copy.
// One way of "fixing" this is to map the filenames on the command
- // line to node_ids, and then restrict based on those. This
+ // line to node_ids, and then restrict based on those. This
// might be more intuitive; on the other hand it would make it
// impossible to restrict to paths which are dead in the working
// copy but live between old and new. So ... no rush to "fix" it;
@@ -429,14 +429,14 @@
//
// let the discussion begin...
//
- // - "map filenames on the command line to node_ids" needs to be done
+ // - "map filenames on the command line to node_ids" needs to be done
// in the context of some roster, possibly the working copy base or
// the current working copy (or both)
- // - diff with two --revision's may be done with no working copy
- // - some form of "peg" revision syntax for paths that would allow
+ // - diff with two --revision's may be done with no working copy
+ // - some form of "peg" revision syntax for paths that would allow
// for each path to specify which revision it is relevant to is
// probably the "right" way to go eventually. something like address@hidden
- // (which fails for paths with @'s in them) or possibly //rev/file
+ // (which fails for paths with @'s in them) or possibly //rev/file
// since versioned paths are required to be relative.
make_restricted_csets(old_roster, new_roster, included, excluded, mask);
@@ -449,14 +449,14 @@
throw usage(name);
}
-
+
data summary;
write_cset(included, summary);
vector lines;
split_into_lines(summary(), lines);
cout << "# " << "\n";
- if (summary().size() > 0)
+ if (summary().size() > 0)
{
cout << header.str() << "# " << "\n";
for (vector::iterator i = lines.begin(); i != lines.end(); ++i)
@@ -548,7 +548,7 @@
else
{
for (vector::const_iterator i = app.revision_selectors.begin();
- i != app.revision_selectors.end(); i++)
+ i != app.revision_selectors.end(); i++)
{
set rids;
complete(app, (*i)(), rids);
@@ -559,7 +559,7 @@
}
restriction mask(app);
-
+
if (args.size() > 0)
{
// User wants to trace only specific files
@@ -568,7 +568,7 @@
if (app.revision_selectors.size() == 0)
get_base_and_current_roster_shape(old_roster, new_roster, nis, app);
else
- app.db.get_roster(first_rid, new_roster);
+ app.db.get_roster(first_rid, new_roster);
// FIXME_RESTRICTIONS: should this add paths from the rosters of all selected revs?
mask = restriction(args, app.exclude_patterns, old_roster, new_roster, app);
@@ -594,10 +594,10 @@
while(! frontier.empty() && (last == -1 || last > 0) && (next == -1 || next > 0))
{
set next_frontier;
-
+
for (set::const_iterator i = frontier.begin();
i != frontier.end(); ++i)
- {
+ {
revision_id rid = *i;
bool print_this = mask.empty();
@@ -616,14 +616,14 @@
// TODO: stop if the restriction is pre-dated by the current roster
// i.e. the restriction's nodes are not born in the current roster
roster_t roster;
- app.db.get_roster(rid, roster);
+ app.db.get_roster(rid, roster);
set nodes_modified;
select_nodes_modified_by_rev(rid, rev, roster,
- nodes_modified,
+ nodes_modified,
app);
-
- for (set::const_iterator n = nodes_modified.begin();
+
+ for (set::const_iterator n = nodes_modified.begin();
n != nodes_modified.end(); ++n)
{
if (!roster.has_node(*n))
@@ -631,7 +631,7 @@
// include all deleted nodes
print_this = true;
}
- else if (mask.includes(roster, *n))
+ else if (mask.includes(roster, *n))
{
print_this = true;
if (app.diffs)
@@ -648,20 +648,20 @@
{
set children;
app.db.get_revision_children(rid, children);
- copy(children.begin(), children.end(),
+ copy(children.begin(), children.end(),
inserter(next_frontier, next_frontier.end()));
}
else // work backwards by default
{
set parents;
app.db.get_revision_parents(rid, parents);
- copy(parents.begin(), parents.end(),
+ copy(parents.begin(), parents.end(),
inserter(next_frontier, next_frontier.end()));
}
if (app.no_merges && rev.is_merge_node())
print_this = false;
-
+
if (print_this)
{
if (global_sanity.brief)
@@ -714,7 +714,7 @@
for (edge_map::const_iterator e = rev.edges.begin();
e != rev.edges.end(); ++e)
{
- dump_diffs(edge_changes(e), app, true, unified_diff,
+ dump_diffs(edge_changes(e), app, true, unified_diff,
diff_paths, !mask.empty());
}
}
============================================================
--- cmd_files.cc 22b692fc7848cf47a7572d4df48b0ffeeaa56c5c
+++ cmd_files.cc 088fb68e4513fb18130184937b3bfcaf4e23155a
@@ -23,11 +23,11 @@
file_id f_id;
file_data f_data(s);
-
+
calculate_ident (f_data, f_id);
-
+
packet_db_writer dbw(app);
- dbw.consume_file_data(f_id, f_data);
+ dbw.consume_file_data(f_id, f_data);
}
CMD(fmerge, N_("debug"), N_(" "),
@@ -60,7 +60,7 @@
split_into_lines(right.inner()(), right_lines);
N(merge3(anc_lines, left_lines, right_lines, merged_lines), F("merge failed"));
copy(merged_lines.begin(), merged_lines.end(), ostream_iterator(cout, "\n"));
-
+
}
CMD(annotate, N_("informative"), N_("PATH"),
@@ -81,13 +81,13 @@
if (app.revision_selectors.size() == 0)
get_revision_id(rid);
- else
+ else
complete(app, idx(app.revision_selectors, 0)(), rid);
N(!null_id(rid), F("no revision for file '%s' in database") % file);
N(app.db.revision_exists(rid), F("no such revision '%s'") % rid);
- L(FL("annotate file file_path '%s'\n") % file);
+ L(FL("annotate file file_path '%s'") % file);
// find the version of the file requested
roster_t roster;
@@ -98,7 +98,7 @@
N(is_file_t(node), F("'%s' in revision '%s' is not a file") % file % rid);
file_t file_node = downcast_to_file_t(node);
- L(FL("annotate for file_id %s\n") % file_node->self);
+ L(FL("annotate for file_id %s") % file_node->self);
do_annotate(app, file_node, rid);
}
@@ -119,7 +119,7 @@
{
dat = get_stdin();
}
-
+
hexenc ident;
calculate_ident(dat, ident);
cout << ident << "\n";
@@ -141,7 +141,7 @@
revision_id rid;
if (app.revision_selectors.size() == 0)
get_revision_id(rid);
- else
+ else
complete(app, idx(app.revision_selectors, 0)(), rid);
N(app.db.revision_exists(rid), F("no such revision '%s'") % rid);
@@ -155,14 +155,14 @@
roster_t roster;
marking_map marks;
app.db.get_roster(rid, roster, marks);
- N(roster.has_node(sp), F("no file '%s' found in revision '%s'\n") % fp % rid);
+ N(roster.has_node(sp), F("no file '%s' found in revision '%s'") % fp % rid);
node_t node = roster.get_node(sp);
- N((!null_node(node->self) && is_file_t(node)), F("no file '%s' found in revision '%s'\n") % fp % rid);
+ N((!null_node(node->self) && is_file_t(node)), F("no file '%s' found in revision '%s'") % fp % rid);
file_t file_node = downcast_to_file_t(node);
- file_id ident = file_node->content;
+ file_id ident = file_node->content;
file_data dat;
- L(FL("dumping file '%s'\n") % ident);
+ L(FL("dumping file '%s'") % ident);
app.db.get_file_version(ident, dat);
cout.write(dat.inner()().data(), dat.inner()().size());
============================================================
--- cmd_key_cert.cc 4f07a55505d99f4a1680313d47e7a813a4bd1517
+++ cmd_key_cert.cc aea641cf1bcdfb372b147d99a5f908cca3c12188
@@ -31,7 +31,7 @@
}
N(!exists, F("key '%s' already exists") % ident);
-
+
keypair kp;
P(F("generating key-pair '%s'") % ident);
generate_key_pair(app.lua, ident, kp);
@@ -42,7 +42,7 @@
CMD(dropkey, N_("key and cert"), N_("KEYID"), N_("drop a public and private key"), OPT_NONE)
{
bool key_deleted = false;
-
+
if (args.size() != 1)
throw usage(name);
@@ -53,7 +53,7 @@
transaction_guard guard(app.db);
if (app.db.public_key_exists(ident))
{
- P(F("dropping public key '%s' from database\n") % ident);
+ P(F("dropping public key '%s' from database") % ident);
app.db.delete_public_key(ident);
key_deleted = true;
}
@@ -63,7 +63,7 @@
if (app.keys.key_pair_exists(ident))
{
- P(F("dropping key pair '%s' from keystore\n") % ident);
+ P(F("dropping key pair '%s' from keystore") % ident);
app.keys.delete_key(ident);
key_deleted = true;
}
@@ -94,7 +94,7 @@
change_key_passphrase(app.lua, ident, key.priv);
app.keys.delete_key(ident);
app.keys.put_key_pair(ident, key);
- P(F("passphrase changed\n"));
+ P(F("passphrase changed"));
}
CMD(cert, N_("key and cert"), N_("REVISION CERTNAME [CERTVAL]"),
@@ -109,13 +109,13 @@
revision_id rid;
complete(app, idx(args, 0)(), rid);
ident = rid.inner();
-
+
cert_name name;
internalize_cert_name(idx(args, 1), name);
rsa_keypair_id key;
get_user_key(key, app);
-
+
cert_value val;
if (args.size() == 3)
val = cert_value(idx(args, 2)());
@@ -144,10 +144,10 @@
revision_id rid;
complete(app, idx(args, 0)(), rid, false);
hexenc ident(rid.inner());
-
+
cert_name name;
internalize_cert_name(idx(args, 1), name);
-
+
cert_value value(idx(args, 2)());
set signers;
@@ -157,8 +157,8 @@
internalize_rsa_keypair_id(idx(args, i), keyid);
signers.insert(keyid);
}
-
-
+
+
bool trusted = app.lua.hook_get_revision_cert_trust(signers, ident,
name, value);
@@ -192,7 +192,7 @@
}
-CMD(testresult, N_("review"), N_("ID (pass|fail|true|false|yes|no|1|0)"),
+CMD(testresult, N_("review"), N_("ID (pass|fail|true|false|yes|no|1|0)"),
N_("note the results of running a test on a revision"), OPT_NONE)
{
if (args.size() != 2)
@@ -205,19 +205,19 @@
}
-CMD(approve, N_("review"), N_("REVISION"),
+CMD(approve, N_("review"), N_("REVISION"),
N_("approve of a particular revision"),
OPT_BRANCH_NAME)
{
if (args.size() != 1)
- throw usage(name);
+ throw usage(name);
revision_id r;
complete(app, idx(args, 0)(), r);
packet_db_writer dbw(app);
cert_value branchname;
guess_branch(r, app, branchname);
- N(app.branch_name() != "", F("need --branch argument for approval"));
+ N(app.branch_name() != "", F("need --branch argument for approval"));
cert_revision_in_branch(r, app.branch_name(), app, dbw);
}
@@ -231,10 +231,10 @@
if (args.size() == 2)
comment = idx(args, 1)();
else
- N(app.lua.hook_edit_comment("", "", comment),
+ N(app.lua.hook_edit_comment("", "", comment),
F("edit comment failed"));
-
- N(comment.find_first_not_of(" \r\t\n") != string::npos,
+
+ N(comment.find_first_not_of("\n\r\t ") != string::npos,
F("empty comment"));
revision_id r;
============================================================
--- cmd_list.cc 5edf0ae19d13ccc9d25490eb64576bff4ad907ca
+++ cmd_list.cc 5b4ecf0d3b3fac90a4cb8eea9b30b31bc335d082
@@ -26,16 +26,16 @@
using std::string;
using std::vector;
-static void
+static void
ls_certs(string const & name, app_state & app, vector const & args)
{
if (args.size() != 1)
throw usage(name);
vector certs;
-
+
transaction_guard guard(app.db, false);
-
+
revision_id ident;
complete(app, idx(args, 0)(), ident);
vector< revision > ts;
@@ -44,7 +44,7 @@
certs.push_back(idx(ts, i).inner());
{
- set checked;
+ set checked;
for (size_t i = 0; i < certs.size(); ++i)
{
if (checked.find(idx(certs, i).key) == checked.end() &&
@@ -54,7 +54,7 @@
checked.insert(idx(certs, i).key);
}
}
-
+
// Make the output deterministic; this is useful for the test suite, in
// particular.
sort(certs.begin(), certs.end());
@@ -77,7 +77,7 @@
for (size_t i = 0; i < certs.size(); ++i)
{
cert_status status = check_cert(app, idx(certs, i));
- cert_value tv;
+ cert_value tv;
decode_base64(idx(certs, i).value, tv);
string washed;
if (guess_binary(tv()))
@@ -113,10 +113,10 @@
% stat
% idx(certs, i).name()
% idx(lines, 0));
-
+
for (size_t i = 1; i < lines.size(); ++i)
cout << (i18n_format(extra_str) % idx(lines, i));
- }
+ }
if (certs.size() > 0)
cout << "\n";
@@ -148,7 +148,7 @@
for (vector::const_iterator i = pubs.begin();
i != pubs.end(); i++)
pubkeys[*i] = true;
-
+
bool all_in_db = true;
for (vector::const_iterator i = privkeys.begin();
i != privkeys.end(); i++)
@@ -172,7 +172,7 @@
bool indb = i->second;
if (indb)
- app.db.get_key(keyid, pub_encoded);
+ app.db.get_key(keyid, pub_encoded);
else
{
keypair kp;
@@ -198,7 +198,7 @@
{
keypair kp;
hexenc hash_code;
- app.keys.get_key_pair(*i, kp);
+ app.keys.get_key_pair(*i, kp);
key_hash_code(*i, kp.priv, hash_code);
cout << hash_code << " " << *i << "\n";
}
@@ -209,13 +209,13 @@
privkeys.size() == 0)
{
if (args.size() == 0)
- P(F("no keys found\n"));
+ P(F("no keys found"));
else
- W(F("no keys found matching '%s'\n") % idx(args, 0)());
+ W(F("no keys found matching '%s'") % idx(args, 0)());
}
}
-static void
+static void
ls_branches(string name, app_state & app, vector const & args)
{
utf8 inc("*");
@@ -235,7 +235,7 @@
cout << idx(names, i) << "\n";
}
-static void
+static void
ls_epochs(string name, app_state & app, vector const & args)
{
map epochs;
@@ -255,13 +255,13 @@
++i)
{
map::const_iterator j = epochs.find(cert_value((*i)()));
- N(j != epochs.end(), F("no epoch for branch %s\n") % *i);
+ N(j != epochs.end(), F("no epoch for branch %s") % *i);
cout << j->second << " " << j->first << "\n";
}
- }
+ }
}
-static void
+static void
ls_tags(string name, app_state & app, vector const & args)
{
vector< revision > certs;
@@ -277,11 +277,11 @@
decode_base64(c.value, name);
sorted_vals.insert(make_pair(name, make_pair(c.ident, c.key)));
}
- for (set > >::const_iterator i = sorted_vals.begin();
i != sorted_vals.end(); ++i)
{
- cout << i->first << " "
+ cout << i->first << " "
<< i->second.first << " "
<< i->second.second << "\n";
}
@@ -384,7 +384,7 @@
get_base_and_current_roster_shape(old_roster, new_roster, nis, app);
restriction mask(args, app.exclude_patterns, old_roster, new_roster, app);
-
+
update_current_roster_from_filesystem(new_roster, mask, app);
make_restricted_csets(old_roster, new_roster, included, excluded, mask);
check_restricted_cset(old_roster, included);
@@ -399,7 +399,7 @@
if (mask.includes(*i))
files.insert(file_path(*i));
}
- for (map::const_iterator
+ for (map::const_iterator
i = included.nodes_renamed.begin();
i != included.nodes_renamed.end(); ++i)
{
@@ -420,7 +420,7 @@
files.insert(file_path(i->first));
}
for (map >::const_iterator
- i = included.deltas_applied.begin(); i != included.deltas_applied.end();
+ i = included.deltas_applied.begin(); i != included.deltas_applied.end();
++i)
{
if (mask.includes(i->first))
============================================================
--- cmd_merging.cc 6745bfc6317dad3cf1828d17600aca164accf0e5
+++ cmd_merging.cc 3c99bc7044aba855f37df212ca11959ed6881bec
@@ -20,7 +20,7 @@
using boost::shared_ptr;
-struct update_source
+struct update_source
: public file_content_source
{
map & temporary_store;
@@ -77,7 +77,7 @@
calculate_ident(r_working, r_working_id);
I(r_working.edges.size() == 1);
r_old_id = edge_old_revision(r_working.edges.begin());
- make_roster_for_base_plus_cset(r_old_id,
+ make_roster_for_base_plus_cset(r_old_id,
edge_changes(r_working.edges.begin()),
r_working_id,
working_roster, working_mm, nis, app);
@@ -113,19 +113,19 @@
}
notify_if_multiple_heads(app);
-
+
if (r_old_id == r_chosen_id)
{
- P(F("already up to date at %s\n") % r_old_id);
+ P(F("already up to date at %s") % r_old_id);
// do still switch the workspace branch, in case they have used
// update to switch branches.
if (!app.branch_name().empty())
app.make_branch_sticky();
return;
}
-
- P(F("selected update target %s\n") % r_chosen_id);
+ P(F("selected update target %s") % r_chosen_id);
+
bool switched_branch = false;
{
// figure out which branches the target is in
@@ -134,7 +134,7 @@
erase_bogus_certs(certs, app);
set< utf8 > branches;
- for (vector< revision >::const_iterator i = certs.begin();
+ for (vector< revision >::const_iterator i = certs.begin();
i != certs.end(); i++)
{
cert_value b;
@@ -153,7 +153,7 @@
{
// multiple non-matching branchnames
string branch_list;
- for (set::const_iterator i = branches.begin();
+ for (set::const_iterator i = branches.begin();
i != branches.end(); i++)
branch_list += "\n " + (*i)();
N(false, F("target revision is in multiple branches:%s\n\n"
@@ -178,8 +178,8 @@
app.db.get_roster(r_chosen_id, chosen_roster, chosen_mm);
- set
- working_uncommon_ancestors,
+ set
+ working_uncommon_ancestors,
chosen_uncommon_ancestors;
if (is_ancestor(r_old_id, r_chosen_id, app))
@@ -188,7 +188,7 @@
target_mm = chosen_mm;
r_target_id = r_chosen_id;
app.db.get_uncommon_ancestors(r_old_id, r_chosen_id,
- working_uncommon_ancestors,
+ working_uncommon_ancestors,
chosen_uncommon_ancestors);
}
else
@@ -198,7 +198,7 @@
// just pick something, all that's important is that it not
// match the work revision or any ancestors of the base revision.
r_target_id = revision_id(hexenc("5432100000000000000000000500000000000000"));
- make_roster_for_base_plus_cset(r_old_id,
+ make_roster_for_base_plus_cset(r_old_id,
transplant,
r_target_id,
target_roster, target_mm, nis, app);
@@ -211,9 +211,9 @@
working_uncommon_ancestors.insert(r_working_id);
- // Now merge the working roster with the chosen target.
+ // Now merge the working roster with the chosen target.
- roster_merge_result result;
+ roster_merge_result result;
roster_merge(working_roster, working_mm, working_uncommon_ancestors,
target_roster, target_mm, chosen_uncommon_ancestors,
result);
@@ -233,7 +233,7 @@
// we have the following
//
// old --> working
- // | |
+ // | |
// V V
// chosen --> merged
//
@@ -241,10 +241,10 @@
// - working is based on old and includes the workspace's changes
// - chosen is the revision we're updating to and will end up in _MTN/revision
// - merged is the merge of working and chosen
- //
- // we apply the working to merged cset to the workspace
+ //
+ // we apply the working to merged cset to the workspace
// and write the cset from chosen to merged changeset in _MTN/work
-
+
cset update, remaining;
make_cset(working_roster, merged_roster, update);
make_cset(target_roster, merged_roster, remaining);
@@ -254,15 +254,15 @@
// write_cset(update, t1);
// write_cset(remaining, t2);
// write_manifest_of_roster(merged_roster, t3);
- // P(F("updating workspace with [[[\n%s\n]]]\n") % t1);
- // P(F("leaving residual work [[[\n%s\n]]]\n") % t2);
- // P(F("merged roster [[[\n%s\n]]]\n") % t3);
+ // P(F("updating workspace with [[[\n%s\n]]]") % t1);
+ // P(F("leaving residual work [[[\n%s\n]]]") % t2);
+ // P(F("merged roster [[[\n%s\n]]]") % t3);
// }
update_source fsource(wca.temporary_store, app);
editable_working_tree ewt(app, fsource);
update.apply_to(ewt);
-
+
// small race condition here...
// nb: we write out r_chosen, not r_new, because the revision-on-disk
// is the basis of the workspace, not the workspace itself.
@@ -273,7 +273,7 @@
}
if (switched_branch)
P(F("switched branch; next commit will use branch %s") % app.branch_name());
- P(F("updated to base revision %s\n") % r_chosen_id);
+ P(F("updated to base revision %s") % r_chosen_id);
put_work_cset(remaining);
update_any_attrs(app);
@@ -296,10 +296,10 @@
get_branch_heads(app.branch_name(), app, heads);
- N(heads.size() != 0, F("branch '%s' is empty\n") % app.branch_name);
+ N(heads.size() != 0, F("branch '%s' is empty") % app.branch_name);
if (heads.size() == 1)
{
- P(F("branch '%s' is already merged\n") % app.branch_name);
+ P(F("branch '%s' is already merged") % app.branch_name);
return;
}
@@ -307,18 +307,18 @@
revision_id left = *i;
revision_id ancestor;
size_t count = 1;
- P(F("starting with revision 1 / %d\n") % heads.size());
+ P(F("starting with revision 1 / %d") % heads.size());
for (++i; i != heads.end(); ++i, ++count)
{
revision_id right = *i;
- P(F("merging with revision %d / %d\n") % (count + 1) % heads.size());
- P(F("[source] %s\n") % left);
- P(F("[source] %s\n") % right);
+ P(F("merging with revision %d / %d") % (count + 1) % heads.size());
+ P(F("[source] %s") % left);
+ P(F("[source] %s") % right);
revision_id merged;
transaction_guard guard(app.db);
interactive_merge_and_store(left, right, merged, app);
-
+
// merged 1 edge; now we commit this, update merge source and
// try next one
@@ -328,15 +328,15 @@
string log = (FL("merge of %s\n"
" and %s\n") % left % right).str();
cert_revision_changelog(merged, log, app, dbw);
-
+
guard.commit();
- P(F("[merged] %s\n") % merged);
+ P(F("[merged] %s") % merged);
left = merged;
}
- P(F("note: your workspaces have not been updated\n"));
+ P(F("note: your workspaces have not been updated"));
}
-CMD(propagate, N_("tree"), N_("SOURCE-BRANCH DEST-BRANCH"),
+CMD(propagate, N_("tree"), N_("SOURCE-BRANCH DEST-BRANCH"),
N_("merge from one branch to another asymmetrically"),
OPT_DATE % OPT_AUTHOR % OPT_MESSAGE % OPT_MSGFILE)
{
@@ -347,7 +347,7 @@
process(app, "merge_into_dir", a);
}
-CMD(merge_into_dir, N_("tree"), N_("SOURCE-BRANCH DEST-BRANCH DIR"),
+CMD(merge_into_dir, N_("tree"), N_("SOURCE-BRANCH DEST-BRANCH DIR"),
N_("merge one branch into a subdirectory in another branch"),
OPT_DATE % OPT_AUTHOR % OPT_MESSAGE % OPT_MSGFILE)
{
@@ -376,7 +376,7 @@
// if dir is not the empty string, rename the root of N1 to have the name
// 'dir' in the merged tree. (ie, it has name "basename(dir)", and its
// parent node is "N2.get_node(dirname(dir))")
-
+
set src_heads, dst_heads;
if (args.size() != 3)
@@ -385,29 +385,29 @@
get_branch_heads(idx(args, 0)(), app, src_heads);
get_branch_heads(idx(args, 1)(), app, dst_heads);
- N(src_heads.size() != 0, F("branch '%s' is empty\n") % idx(args, 0)());
- N(src_heads.size() == 1, F("branch '%s' is not merged\n") % idx(args, 0)());
+ N(src_heads.size() != 0, F("branch '%s' is empty") % idx(args, 0)());
+ N(src_heads.size() == 1, F("branch '%s' is not merged") % idx(args, 0)());
- N(dst_heads.size() != 0, F("branch '%s' is empty\n") % idx(args, 1)());
- N(dst_heads.size() == 1, F("branch '%s' is not merged\n") % idx(args, 1)());
+ N(dst_heads.size() != 0, F("branch '%s' is empty") % idx(args, 1)());
+ N(dst_heads.size() == 1, F("branch '%s' is not merged") % idx(args, 1)());
set::const_iterator src_i = src_heads.begin();
set::const_iterator dst_i = dst_heads.begin();
-
- P(F("propagating %s -> %s\n") % idx(args,0) % idx(args,1));
- P(F("[source] %s\n") % *src_i);
- P(F("[target] %s\n") % *dst_i);
+ P(F("propagating %s -> %s") % idx(args,0) % idx(args,1));
+ P(F("[source] %s") % *src_i);
+ P(F("[target] %s") % *dst_i);
+
// check for special cases
if (*src_i == *dst_i || is_ancestor(*src_i, *dst_i, app))
{
- P(F("branch '%s' is up-to-date with respect to branch '%s'\n")
+ P(F("branch '%s' is up-to-date with respect to branch '%s'")
% idx(args, 1)() % idx(args, 0)());
- P(F("no action taken\n"));
+ P(F("no action taken"));
}
else if (is_ancestor(*dst_i, *src_i, app))
{
- P(F("no merge necessary; putting %s in branch '%s'\n")
+ P(F("no merge necessary; putting %s in branch '%s'")
% (*src_i) % idx(args, 1)());
transaction_guard guard(app.db);
packet_db_writer dbw(app);
@@ -492,8 +492,8 @@
cert_revision_changelog(merged, log_message, app, dbw);
- guard.commit();
- P(F("[merged] %s\n") % merged);
+ guard.commit();
+ P(F("[merged] %s") % merged);
}
}
@@ -511,7 +511,7 @@
complete(app, idx(args, 0)(), left);
complete(app, idx(args, 1)(), right);
branch = idx(args, 2)();
-
+
N(!(left == right),
F("%s and %s are the same revision, aborting") % left % right);
N(!is_ancestor(left, right, app),
@@ -520,26 +520,26 @@
F("%s is already an ancestor of %s") % right % left);
// Somewhat redundant, but consistent with output of plain "merge" command.
- P(F("[source] %s\n") % left);
- P(F("[source] %s\n") % right);
+ P(F("[source] %s") % left);
+ P(F("[source] %s") % right);
revision_id merged;
transaction_guard guard(app.db);
interactive_merge_and_store(left, right, merged, app);
-
+
packet_db_writer dbw(app);
-
+
cert_revision_in_branch(merged, branch, app, dbw);
-
+
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);
-
- guard.commit();
- P(F("[merged] %s\n") % merged);
+
+ guard.commit();
+ P(F("[merged] %s") % merged);
}
CMD(show_conflicts, N_("informative"), N_("REV REV"), N_("Show what conflicts would need to be resolved to merge the given revisions."),
@@ -560,7 +560,7 @@
app.db.get_roster(r_id, r_roster, r_marking);
set l_uncommon_ancestors, r_uncommon_ancestors;
app.db.get_uncommon_ancestors(l_id, r_id,
- l_uncommon_ancestors,
+ l_uncommon_ancestors,
r_uncommon_ancestors);
roster_merge_result result;
roster_merge(l_roster, l_marking, l_uncommon_ancestors,
@@ -588,13 +588,13 @@
get_branch_heads(app.branch_name(), app, heads);
if (heads.size() == 0)
- P(F("branch '%s' is empty\n") % app.branch_name);
+ P(F("branch '%s' is empty") % app.branch_name);
else if (heads.size() == 1)
- P(F("branch '%s' is currently merged:\n") % app.branch_name);
+ P(F("branch '%s' is currently merged:") % app.branch_name);
else
- P(F("branch '%s' is currently unmerged:\n") % app.branch_name);
-
- for (set::const_iterator i = heads.begin();
+ P(F("branch '%s' is currently unmerged:") % app.branch_name);
+
+ for (set::const_iterator i = heads.begin();
i != heads.end(); ++i)
cout << describe_revision(app, *i) << "\n";
}
@@ -608,11 +608,11 @@
revision_id rid;
complete(app, idx(args, 0)(), rid);
-
+
roster_t roster;
marking_map mm;
app.db.get_roster(rid, roster, mm);
-
+
roster_data dat;
write_roster_and_marking(roster, mm, dat);
cout << dat;
============================================================
--- cmd_netsync.cc 3679d67d1590ae6a8731ab565132cd148b427b0b
+++ cmd_netsync.cc 2b0b6da8e33bf1c3a5c7eec9de9218f20cbe1a80
@@ -37,7 +37,7 @@
if (use_defaults
&& (!app.db.var_exists(default_server_key) || app.set_default))
{
- P(F("setting default server to %s\n") % addr);
+ P(F("setting default server to %s") % addr);
app.db.set_var(default_server_key, var_value(addr()));
}
}
@@ -49,7 +49,7 @@
var_value addr_value;
app.db.get_var(default_server_key, addr_value);
addr = utf8(addr_value());
- L(FL("using default server address: %s\n") % addr);
+ L(FL("using default server address: %s") % addr);
}
}
@@ -64,13 +64,13 @@
if (use_defaults &&
(!app.db.var_exists(default_include_pattern_key) || app.set_default))
{
- P(F("setting default branch include pattern to '%s'\n") % include_pattern);
+ P(F("setting default branch include pattern to '%s'") % include_pattern);
app.db.set_var(default_include_pattern_key, var_value(include_pattern()));
}
if (use_defaults &&
(!app.db.var_exists(default_exclude_pattern_key) || app.set_default))
{
- P(F("setting default branch exclude pattern to '%s'\n") % exclude_pattern);
+ P(F("setting default branch exclude pattern to '%s'") % exclude_pattern);
app.db.set_var(default_exclude_pattern_key, var_value(exclude_pattern()));
}
}
@@ -82,7 +82,7 @@
var_value pattern_value;
app.db.get_var(default_include_pattern_key, pattern_value);
include_pattern = utf8(pattern_value());
- L(FL("using default branch include pattern: '%s'\n") % include_pattern);
+ L(FL("using default branch include pattern: '%s'") % include_pattern);
if (app.db.var_exists(default_exclude_pattern_key))
{
app.db.get_var(default_exclude_pattern_key, pattern_value);
@@ -90,7 +90,7 @@
}
else
exclude_pattern = utf8("");
- L(FL("excluding: %s\n") % exclude_pattern);
+ L(FL("excluding: %s") % exclude_pattern);
}
}
@@ -106,7 +106,7 @@
app.signing_key = key;
run_netsync_protocol(client_voice, source_role, addr,
- include_pattern, exclude_pattern, app);
+ include_pattern, exclude_pattern, app);
}
CMD(pull, N_("network"), N_("[ADDRESS[:PORTNUMBER] [PATTERN]]"),
@@ -117,10 +117,10 @@
process_netsync_args(name, args, addr, include_pattern, exclude_pattern, true, false, app);
if (app.signing_key() == "")
- P(F("doing anonymous pull; use -kKEYNAME if you need authentication\n"));
-
+ P(F("doing anonymous pull; use -kKEYNAME if you need authentication"));
+
run_netsync_protocol(client_voice, sink_role, addr,
- include_pattern, exclude_pattern, app);
+ include_pattern, exclude_pattern, app);
}
CMD(sync, N_("network"), N_("[ADDRESS[:PORTNUMBER] [PATTERN]]"),
@@ -135,7 +135,7 @@
app.signing_key = key;
run_netsync_protocol(client_voice, source_and_sink_role, addr,
- include_pattern, exclude_pattern, app);
+ include_pattern, exclude_pattern, app);
}
@@ -200,5 +200,5 @@
utf8 dummy_addr, include_pattern, exclude_pattern;
process_netsync_args(name, args, dummy_addr, include_pattern, exclude_pattern, false, true, app);
run_netsync_protocol(server_voice, source_and_sink_role, app.bind_address,
- include_pattern, exclude_pattern, app);
+ include_pattern, exclude_pattern, app);
}
============================================================
--- cmd_othervcs.cc 47651b6f63bd48be121a30eec4d1746238151fd2
+++ cmd_othervcs.cc f97235e360354ab14ae9749e45b274acfc30c35e
@@ -12,7 +12,7 @@
{
if (args.size() < 1)
throw usage(name);
-
+
for (vector::const_iterator i = args.begin();
i != args.end(); ++i)
{
============================================================
--- cmd_ws_commit.cc b334deaf56946d327559cb7db10fc82de170da5c
+++ cmd_ws_commit.cc ed419208149db21c8a754df43d443c143b2e7544
@@ -21,8 +21,8 @@
using boost::shared_ptr;
-static void
-get_log_message_interactively(revision_set const & cs,
+static void
+get_log_message_interactively(revision_set const & cs,
app_state & app,
string & log_message)
{
@@ -41,8 +41,8 @@
F("edit of log message failed"));
}
-CMD(revert, N_("workspace"), N_("[PATH]..."),
- N_("revert file(s), dir(s) or entire workspace (\".\")"),
+CMD(revert, N_("workspace"), N_("[PATH]..."),
+ N_("revert file(s), dir(s) or entire workspace (\".\")"),
OPT_DEPTH % OPT_EXCLUDE % OPT_MISSING)
{
if (args.size() < 1)
@@ -53,7 +53,7 @@
cset included, excluded;
app.require_workspace();
-
+
vector includes;
vector excludes;
@@ -69,7 +69,7 @@
L(FL("no missing files in restriction."));
return;
}
-
+
for (path_set::const_iterator i = missing.begin(); i != missing.end(); i++)
{
file_path fp(*i);
@@ -103,7 +103,7 @@
split_path sp;
old_roster.get_name(nid, sp);
file_path fp(sp);
-
+
if (!mask.includes(old_roster, nid))
continue;
@@ -115,19 +115,19 @@
hexenc ident;
calculate_ident(fp, ident, app.lua);
// don't touch unchanged files
- if (ident == f->content.inner())
+ if (ident == f->content.inner())
continue;
}
-
+
P(F("reverting %s") % fp);
- L(FL("reverting %s to [%s]\n") % fp % f->content);
-
+ L(FL("reverting %s to [%s]") % fp % f->content);
+
N(app.db.file_version_exists(f->content),
F("no file version %s found in database for %s")
% f->content % fp);
-
+
file_data dat;
- L(FL("writing file %s to %s\n")
+ L(FL("writing file %s to %s")
% f->content % fp);
app.db.get_file_version(f->content, dat);
write_localized_data(fp, dat.inner(), app.lua);
@@ -152,7 +152,7 @@
maybe_update_inodeprints(app);
}
-CMD(disapprove, N_("review"), N_("REVISION"),
+CMD(disapprove, N_("review"), N_("REVISION"),
N_("disapprove of a particular revision"),
OPT_BRANCH_NAME)
{
@@ -165,13 +165,13 @@
complete(app, idx(args, 0)(), r);
app.db.get_revision(r, rev);
- N(rev.edges.size() == 1,
+ N(rev.edges.size() == 1,
F("revision '%s' has %d changesets, cannot invert\n") % r % rev.edges.size());
cert_value branchname;
guess_branch(r, app, branchname);
- N(app.branch_name() != "", F("need --branch argument for disapproval"));
-
+ N(app.branch_name() != "", F("need --branch argument for disapproval"));
+
edge_entry const & old_edge (*rev.edges.begin());
app.db.get_revision_manifest(edge_old_revision(old_edge),
rev_inverse.new_manifest);
@@ -193,8 +193,8 @@
write_revision_set(rev_inverse, rdat);
calculate_ident(rdat, inv_id);
dbw.consume_revision_data(inv_id, rdat);
-
- cert_revision_in_branch(inv_id, branchname, app, dbw);
+
+ 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, (FL("disapproval of revision '%s'") % r).str(), app, dbw);
@@ -225,7 +225,7 @@
paths.insert(sp);
}
- bool add_recursive = !app.unknown;
+ bool add_recursive = !app.unknown;
perform_additions(paths, app, add_recursive);
}
@@ -254,7 +254,7 @@
ALIAS(rm, drop);
-CMD(rename, N_("workspace"),
+CMD(rename, N_("workspace"),
N_("SRC DEST\n"
"SRC1 [SRC2 [...]] DEST_DIR"),
N_("rename entries in the workspace"),
@@ -262,7 +262,7 @@
{
if (args.size() < 2)
throw usage(name);
-
+
app.require_workspace();
file_path dst_path = file_path_external(args.back());
@@ -326,27 +326,27 @@
{
I(rev.edges.size() == 1);
cset const & cs = edge_changes(rev.edges.begin());
-
+
for (path_set::const_iterator i = cs.nodes_deleted.begin();
- i != cs.nodes_deleted.end(); ++i)
+ i != cs.nodes_deleted.end(); ++i)
cout << "dropped " << *i << "\n";
- for (map::const_iterator
+ for (map::const_iterator
i = cs.nodes_renamed.begin();
- i != cs.nodes_renamed.end(); ++i)
- cout << "renamed " << i->first << "\n"
+ i != cs.nodes_renamed.end(); ++i)
+ cout << "renamed " << i->first << "\n"
<< " to " << i->second << "\n";
for (path_set::const_iterator i = cs.dirs_added.begin();
- i != cs.dirs_added.end(); ++i)
+ i != cs.dirs_added.end(); ++i)
cout << "added " << *i << "\n";
for (map::const_iterator i = cs.files_added.begin();
- i != cs.files_added.end(); ++i)
+ i != cs.files_added.end(); ++i)
cout << "added " << i->first << "\n";
- for (map >::const_iterator
- i = cs.deltas_applied.begin(); i != cs.deltas_applied.end(); ++i)
+ for (map >::const_iterator
+ i = cs.deltas_applied.begin(); i != cs.deltas_applied.end(); ++i)
cout << "patched " << i->first << "\n";
}
else
@@ -403,7 +403,7 @@
{
P(F("branch %s has multiple heads:") % app.branch_name);
for (set::const_iterator i = heads.begin(); i != heads.end(); ++i)
- P(i18n_format(" %s\n") % describe_revision(app, *i));
+ P(i18n_format(" %s") % describe_revision(app, *i));
P(F("choose one with '%s checkout -r'") % app.prog_name);
E(false, F("branch %s has multiple heads") % app.branch_name);
}
@@ -415,7 +415,7 @@
complete(app, idx(app.revision_selectors, 0)(), ident);
N(app.db.revision_exists(ident),
F("no such revision '%s'") % ident);
-
+
cert_value b;
guess_branch(ident, app, b);
@@ -423,30 +423,30 @@
cert_value branch_name(app.branch_name());
base64 branch_encoded;
encode_base64(branch_name, branch_encoded);
-
+
vector< revision > certs;
app.db.get_revision_certs(ident, branch_cert_name, branch_encoded, certs);
-
- L(FL("found %d %s branch certs on revision %s\n")
+
+ L(FL("found %d %s branch certs on revision %s")
% certs.size()
% app.branch_name
% ident);
-
- N(certs.size() != 0, F("revision %s is not a member of branch %s\n")
+
+ N(certs.size() != 0, F("revision %s is not a member of branch %s")
% ident % app.branch_name);
}
app.create_workspace(dir);
-
+
file_data data;
roster_t ros;
marking_map mm;
-
+
put_revision_id(ident);
-
- L(FL("checking out revision %s to directory %s\n") % ident % dir);
+
+ L(FL("checking out revision %s to directory %s") % ident % dir);
app.db.get_roster(ident, ros, mm);
-
+
node_map const & nodes = ros.all_nodes();
for (node_map::const_iterator i = nodes.begin(); i != nodes.end(); ++i)
{
@@ -468,9 +468,9 @@
N(app.db.file_version_exists(file->content),
F("no file %s found in database for %s")
% file->content % path);
-
+
file_data dat;
- L(FL("writing file %s to %s\n")
+ L(FL("writing file %s to %s")
% file->content % path);
app.db.get_file_version(file->content, dat);
write_localized_data(path, dat.inner(), app.lua);
@@ -484,7 +484,7 @@
ALIAS(co, checkout)
-CMD(attr, N_("workspace"), N_("set PATH ATTR VALUE\nget PATH [ATTR]\ndrop PATH [ATTR]"),
+CMD(attr, N_("workspace"), N_("set PATH ATTR VALUE\nget PATH [ATTR]\ndrop PATH [ATTR]"),
N_("set, get or drop file attributes"),
OPT_NONE)
{
@@ -497,7 +497,7 @@
app.require_workspace();
get_base_and_current_roster_shape(old_roster, new_roster, nis, app);
-
+
file_path path = file_path_external(idx(args,1));
split_path sp;
path.split(sp);
@@ -531,7 +531,7 @@
{
attr_key a_key = idx(args, 2)();
N(node->attrs.find(a_key) != node->attrs.end(),
- F("Path '%s' does not have attribute '%s'\n")
+ F("Path '%s' does not have attribute '%s'\n")
% path % a_key);
node->attrs[a_key] = make_pair(false, "");
}
@@ -562,7 +562,7 @@
else if (args.size() == 3)
{
attr_key a_key = idx(args, 2)();
- full_attr_map_t::const_iterator i = node->attrs.find(a_key);
+ full_attr_map_t::const_iterator i = node->attrs.find(a_key);
if (i != node->attrs.end() && i->second.first)
cout << path << " : " << i->first << "=" << i->second.second << "\n";
else
@@ -571,15 +571,15 @@
else
throw usage(name);
}
- else
+ else
throw usage(name);
}
-CMD(commit, N_("workspace"), N_("[PATH]..."),
+CMD(commit, N_("workspace"), N_("[PATH]..."),
N_("commit workspace to database"),
- OPT_BRANCH_NAME % OPT_MESSAGE % OPT_MSGFILE % OPT_DATE %
+ OPT_BRANCH_NAME % OPT_MESSAGE % OPT_MSGFILE % OPT_DATE %
OPT_AUTHOR % OPT_DEPTH % OPT_EXCLUDE)
{
string log_message("");
@@ -609,8 +609,8 @@
calculate_ident(restricted_rev, restricted_rev_id);
- N(restricted_rev.is_nontrivial(), F("no changes to commit\n"));
-
+ N(restricted_rev.is_nontrivial(), F("no changes to commit"));
+
cert_value branchname;
I(restricted_rev.edges.size() == 1);
@@ -618,24 +618,24 @@
get_branch_heads(app.branch_name(), app, heads);
unsigned int old_head_size = heads.size();
- if (app.branch_name() != "")
+ if (app.branch_name() != "")
branchname = app.branch_name();
- else
+ else
guess_branch(edge_old_revision(restricted_rev.edges.begin()), app, branchname);
- P(F("beginning commit on branch '%s'\n") % branchname);
+ P(F("beginning commit on branch '%s'") % branchname);
L(FL("new manifest '%s'\n"
"new revision '%s'\n")
% restricted_rev.new_manifest
% restricted_rev_id);
process_commit_message_args(log_message_given, log_message, app);
-
+
N(!(log_message_given && has_contents_user_log()),
F("_MTN/log is non-empty and log message was specified on command line\n"
"perhaps move or delete _MTN/log,\n"
"or remove --message/--message-file from the command line?"));
-
+
if (!log_message_given)
{
// this call handles _MTN/log
@@ -643,7 +643,7 @@
// we only check for empty log messages when the user entered them
// interactively. Consensus was that if someone wanted to explicitly
// type --message="", then there wasn't any reason to stop them.
- N(log_message.find_first_not_of(" \r\t\n") != string::npos,
+ N(log_message.find_first_not_of("\n\r\t ") != string::npos,
F("empty log message; commit canceled"));
// we save interactively entered log messages to _MTN/log, so if
// something goes wrong, the next commit will pop up their old log
@@ -663,7 +663,7 @@
app.lua.hook_validate_commit_message(log_message, new_manifest_text,
message_validated, reason);
- N(message_validated, F("log message rejected: %s\n") % reason);
+ N(message_validated, F("log message rejected: %s") % reason);
{
transaction_guard guard(app.db);
@@ -671,12 +671,12 @@
if (app.db.revision_exists(restricted_rev_id))
{
- W(F("revision %s already in database\n") % restricted_rev_id);
+ W(F("revision %s already in database") % restricted_rev_id);
}
else
{
// new revision
- L(FL("inserting new revision %s\n") % restricted_rev_id);
+ L(FL("inserting new revision %s") % restricted_rev_id);
I(restricted_rev.edges.size() == 1);
edge_map::const_iterator edge = restricted_rev.edges.begin();
@@ -694,12 +694,12 @@
if (app.db.file_version_exists(new_content))
{
- L(FL("skipping file delta %s, already in database\n")
+ L(FL("skipping file delta %s, already in database")
% delta_entry_dst(i));
}
else if (app.db.file_version_exists(old_content))
{
- L(FL("inserting delta %s -> %s\n")
+ L(FL("inserting delta %s -> %s")
% old_content % new_content);
file_data old_data;
data new_data;
@@ -713,8 +713,8 @@
% path);
delta del;
diff(old_data.inner(), new_data, del);
- dbw.consume_file_delta(old_content,
- new_content,
+ dbw.consume_file_delta(old_content,
+ new_content,
file_delta(del));
}
else
@@ -729,7 +729,7 @@
file_path path(i->first);
file_id new_content = i->second;
- L(FL("inserting full version %s\n") % new_content);
+ L(FL("inserting full version %s") % new_content);
data new_data;
read_localized_data(path, new_data, app.lua);
// sanity check
@@ -745,8 +745,8 @@
revision_data rdat;
write_revision_set(restricted_rev, rdat);
dbw.consume_revision_data(restricted_rev_id, rdat);
-
- cert_revision_in_branch(restricted_rev_id, branchname, app, dbw);
+
+ cert_revision_in_branch(restricted_rev_id, branchname, app, dbw);
if (app.date_set)
cert_revision_date_time(restricted_rev_id, app.date, app, dbw);
else
@@ -758,21 +758,21 @@
cert_revision_changelog(restricted_rev_id, log_message, app, dbw);
guard.commit();
}
-
+
// small race condition here...
put_work_cset(excluded);
put_revision_id(restricted_rev_id);
- P(F("committed revision %s\n") % restricted_rev_id);
-
+ P(F("committed revision %s") % restricted_rev_id);
+
blank_user_log();
get_branch_heads(app.branch_name(), app, heads);
if (heads.size() > old_head_size && old_head_size > 0) {
P(F("note: this revision creates divergence\n"
- "note: you may (or may not) wish to run '%s merge'")
+ "note: you may (or may not) wish to run '%s merge'")
% app.prog_name);
}
-
+
update_any_attrs(app);
maybe_update_inodeprints(app);
============================================================
--- commands.cc 579d73cf72936f2493bfe1fa4cec133d42106469
+++ commands.cc 534869eb75c5f57575dc842d1d7e24461b4a3a8c
@@ -32,7 +32,7 @@
// we might expose this blunt command interface to scripting someday. but
// not today.
-namespace commands
+namespace commands
{
using std::map;
// This must be a pointer.
@@ -73,7 +73,7 @@
};
};
-namespace commands
+namespace commands
{
using std::endl;
using std::greater;
@@ -88,11 +88,11 @@
}
- string complete_command(string const & cmd)
+ string complete_command(string const & cmd)
{
if (cmd.length() == 0 || (*cmds).find(cmd) != (*cmds).end()) return cmd;
- L(FL("expanding command '%s'\n") % cmd);
+ L(FL("expanding command '%s'") % cmd);
vector matched;
@@ -111,10 +111,10 @@
F("unknown command '%s'\n") % cmd);
// one matched command
- if (matched.size() == 1)
+ if (matched.size() == 1)
{
string completed = *matched.begin();
- L(FL("expanded command to '%s'") % completed);
+ L(FL("expanded command to '%s'") % completed);
return completed;
}
@@ -165,7 +165,7 @@
{
sorted.push_back(i->second);
}
-
+
sort(sorted.begin(), sorted.end(), greater());
string curr_group;
@@ -205,7 +205,7 @@
{
if ((*cmds).find(cmd) != (*cmds).end())
{
- L(FL("executing command '%s'\n") % cmd);
+ L(FL("executing command '%s'") % cmd);
// at this point we process the data from _MTN/options if
// the command needs it.
@@ -217,7 +217,7 @@
}
else
{
- P(F("unknown command '%s'\n") % cmd);
+ P(F("unknown command '%s'") % cmd);
return 1;
}
}
@@ -242,11 +242,11 @@
{
if (args.size() < 1)
throw usage("");
-
+
string full_cmd = complete_command(idx(args, 0)());
if ((*cmds).find(full_cmd) == (*cmds).end())
throw usage("");
-
+
throw usage(full_cmd);
}
@@ -281,7 +281,7 @@
{
split_path sp;
new_roster.get_name(nid, sp);
- file_path fp(sp);
+ file_path fp(sp);
hexenc ip;
if (inodeprint_file(fp, ip))
ipm_new.insert(inodeprint_entry(fp, ip));
@@ -294,7 +294,7 @@
write_inodeprints(dat);
}
-string
+string
get_stdin()
{
char buf[constants::bufsz];
@@ -345,8 +345,8 @@
}
-void
-complete(app_state & app,
+void
+complete(app_state & app,
string const & str,
set & completion,
bool must_exist)
@@ -369,7 +369,7 @@
vector >
sels(selectors::parse_selector(str, app));
- P(F("expanding selection '%s'\n") % str);
+ P(F("expanding selection '%s'") % str);
// we jam through an "empty" selection on sel_ident type
set completions;
@@ -383,13 +383,13 @@
i != completions.end(); ++i)
{
pair::const_iterator, bool> p = completion.insert(revision_id(*i));
- P(F("expanded to '%s'\n") % *(p.first));
+ P(F("expanded to '%s'") % *(p.first));
}
}
void
-complete(app_state & app,
+complete(app_state & app,
string const & str,
revision_id & completion,
bool must_exist)
@@ -437,7 +437,7 @@
// can't have both a --message and a --message-file ...
N(app.message().length() == 0 || app.message_file().length() == 0,
F("--message and --message-file are mutually exclusive"));
-
+
if (app.is_explicit_option(OPT_MESSAGE))
{
log_message = app.message();
============================================================
--- commands.hh c6c8f7e3146a242c1578c35818116aba48e0d6a6
+++ commands.hh 815d331acde28ddbd64107f92e52aad1f9f199f1
@@ -17,7 +17,7 @@
class app_state;
class utf8;
-struct usage
+struct usage
{
usage(std::string const & w) : which(w) {}
std::string which;
============================================================
--- constants.cc b175c8ae9c808089d3e9f7216896be26714703db
+++ constants.cc e0fe679a5b53cdee258b2588fec97fece2ec632c
@@ -21,11 +21,11 @@
size_t const automate_stdio_size = 1024;
// number of bits in an RSA key we use
- size_t const keylen = 1024;
+ size_t const keylen = 1024;
// number of seconds in window, in which to consider CVS commits equivalent
// if they have otherwise compatible contents (author, changelog)
- time_t const cvs_window = 60 * 5;
+ time_t const cvs_window = 60 * 5;
// size of a line of database traffic logging, beyond which lines will be
// truncated.
@@ -46,18 +46,18 @@
size_t const log_line_sz = 0x300;
// all the ASCII characters (bytes) which are legal in a packet.
- char const * const legal_packet_bytes =
+ char const * const legal_packet_bytes =
// LDH characters
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789"
+ "0123456789"
"-"
// extra base64 codes
"+/="
// separators
"address@hidden"
// whitespace
- " \r\n\t"
+ " \r\n\t"
;
string const regex_legal_packet_bytes("([a-zA-Z0-9+/=[:space:]]+)");
@@ -79,13 +79,13 @@
// label separators
".@"
;
-
+
// all the ASCII characters (bytes) which can occur in cert names
char const * const legal_cert_name_bytes =
// LDH characters
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789"
+ "0123456789"
"-"
;
@@ -96,7 +96,7 @@
// LDH characters
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789"
+ "0123456789"
"-"
// other non-shell, non-selector metacharacters allowed in (unquoted) local
// parts by RFC2821/RFC2822. The full list is !#$%&'*+-/=?^_`|{}~.
@@ -109,12 +109,12 @@
// all the ASCII characters (bytes) which are illegal in a (file|local)_path
- char const illegal_path_bytes_arr[33] =
- {
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ char const illegal_path_bytes_arr[33] =
+ {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x7f, 0x00
}
;
@@ -146,7 +146,7 @@
BOOST_STATIC_ASSERT((merkle_bitmap_length_in_bits % 8) == 0);
u8 const netcmd_current_protocol_version = 6;
-
+
size_t const netcmd_minimum_bytes_to_bother_with_gzip = 0xfff;
size_t const netsync_session_key_length_in_bytes = 20; // 160 bits
============================================================
--- constants.hh e24a1a631a2717ee866ca20e5cb4ede9d2ba3d8a
+++ constants.hh eb79289a66344262b16a0fe67ec63b3979fe34f2
@@ -20,10 +20,10 @@
extern size_t const automate_stdio_size;
// number of bits in an RSA key we use
- extern size_t const keylen;
+ extern size_t const keylen;
// number of characters in a SHA1 id
- static size_t const idlen = 40;
+ static size_t const idlen = 40;
// number of characters in an encoded epoch
static size_t const epochlen = idlen;
@@ -33,7 +33,7 @@
// number of seconds in window, in which to consider CVS commits equivalent
// if they have otherwise compatible contents (author, changelog)
- extern time_t const cvs_window;
+ extern time_t const cvs_window;
// number of bytes in a password buffer. further bytes will be dropped.
static size_t const maxpasswd = 0xfff;
@@ -119,7 +119,7 @@
+ 1 // cmd code
+ 1); // smallest uleb possible
-
+
// largest command *payload* allowed in a netcmd
// in practice, this sets the size of the largest compressed file
static size_t const netcmd_payload_limit = 2 << 27;
============================================================
--- crypto_tests.cc 5f2ad6110bb7f9a10978ede2c860ad44b24ffed0
+++ crypto_tests.cc 70cc3f3681395ae674799976432b968d1f79ef52
@@ -1015,15 +1015,15 @@
"25f67e9875a90aee60bf1dc1b26c2750294aa7b7",
"8fa552efdcb67d98b5e0189144e99607f5a807fe" };
-static void
+static void
calculate_ident_test()
{
- // NIST checks all SHA implementations using a test system
+ // NIST checks all SHA implementations using a test system
// outlined in the SHA Verification System PDF obtained at
// http://csrc.nist.gov/cryptval/shs/SHAVS.pdf
// There are three tests outlined:
- // - Short Message Test: A small message is provided as
+ // - Short Message Test: A small message is provided as
// an input with a pre-computed digest. If the crypto
// module under test produces a HASH that matches the
// known digest, the test passes
@@ -1037,13 +1037,13 @@
//
// - Monte Carlo Test: This tests the usage of SHA in
// PRNGs. A known 'seed' is provided. This 'seed' is
- // hashed and used as input into the next iteration.
+ // hashed and used as input into the next iteration.
// This continues for 100,000 iterations. After every
// 1000 hashes, the computed hash is compared to a known
// one. If they match, the test succeeds.
- // This test has been updated to include a defined Short
+ // This test has been updated to include a defined Short
// Message test, and the Monte Carlo Test. The Long Message
// test has been dropped as suitable, pre-computed values, are
// not available. Also, instead of the expected 100,000
@@ -1058,21 +1058,21 @@
calculate_ident(input, output);
- //L(FL(" Input: %s\n") % input);
- //L(FL("Output: %s\n") % output);
+ //L(FL(" Input: %s") % input);
+ //L(FL("Output: %s") % output);
BOOST_CHECK(output() == ident);
L(FL("SHA Short Message Test: Passed\n\n"));
//SHA Monte Carlo Test
- //
+ //
//INPUT: Seed - A random seed n bits long
//
// for (j=0; j<100; j++) {
//
// MD0 = MD1 = MD2 = Seed;
- //
+ //
// for (i=3; i<1003; i++) {
// Mi = MDi-3 || MDi-2 || MDi-1;
// MDi = SHA(Mi);
@@ -1088,29 +1088,29 @@
string MD[1003];
- for (int j = 0; j < 1000; j++)
+ for (int j = 0; j < 1000; j++)
{
MD[0] = Seed;
MD[1] = Seed;
MD[2] = Seed;
- for (int i = 3; i < 1003; i++)
+ for (int i = 3; i < 1003; i++)
{
string messageString = MD[i - 3] + MD[i - 2] + MD[i - 1];
- // L(FL("messageString: %s\n") % messageString );
+ // L(FL("messageString: %s") % messageString );
data messageData(decode_hexenc(messageString));
- // L(FL("message: %s\n") % messageString );
+ // L(FL("message: %s") % messageString );
calculate_ident(messageData, output2);
- // L(FL("output: %s\n") % output2 );
+ // L(FL("output: %s") % output2 );
MD[i] = output2();
}
-
- L(FL(" %03d: %s\n") % j % output2 );
-
+
+ L(FL(" %03d: %s") % j % output2 );
+
BOOST_CHECK(output2() == expected_SHA_MCT[j]);
MD[j] = output2();
============================================================
--- cset.cc bf3abceb49091cfed0d14d02c1188d14378b8f6e
+++ cset.cc 71b4052c7b0658142edd83e596cfaa8f3be18f2a
@@ -49,7 +49,7 @@
I(false);
}
}
-
+
// no file+attr pair appears in both the "set" list and the "cleared" list
{
set >::const_iterator c = cs.attrs_cleared.begin();
@@ -70,8 +70,8 @@
bool
cset::empty() const
{
- return
- nodes_deleted.empty()
+ return
+ nodes_deleted.empty()
&& dirs_added.empty()
&& files_added.empty()
&& nodes_renamed.empty()
@@ -95,18 +95,18 @@
struct
detach
{
- detach(split_path const & src)
- : src_path(src),
- reattach(false)
+ detach(split_path const & src)
+ : src_path(src),
+ reattach(false)
{}
-
- detach(split_path const & src,
- split_path const & dst)
- : src_path(src),
- reattach(true),
- dst_path(dst)
+
+ detach(split_path const & src,
+ split_path const & dst)
+ : src_path(src),
+ reattach(true),
+ dst_path(dst)
{}
-
+
split_path src_path;
bool reattach;
split_path dst_path;
@@ -123,8 +123,8 @@
struct
attach
{
- attach(node_id n,
- split_path const & p)
+ attach(node_id n,
+ split_path const & p)
: node(n), path(p)
{}
@@ -140,7 +140,7 @@
}
};
-void
+void
cset::apply_to(editable_tree & t) const
{
// SPEEDUP?: use vectors and sort them once, instead of maintaining sorted
@@ -179,9 +179,9 @@
// bottom-up.
for (path_set::const_iterator i = nodes_deleted.begin();
- i != nodes_deleted.end(); ++i)
+ i != nodes_deleted.end(); ++i)
safe_insert(detaches, detach(*i));
-
+
for (map::const_iterator i = nodes_renamed.begin();
i != nodes_renamed.end(); ++i)
safe_insert(detaches, detach(i->first, i->second));
@@ -190,7 +190,7 @@
// Execute all the detaches, rescheduling the results of each detach
// for either attaching or dropping.
- for (set::const_iterator i = detaches.begin();
+ for (set::const_iterator i = detaches.begin();
i != detaches.end(); ++i)
{
node_id n = t.detach_node(i->src_path);
@@ -253,7 +253,7 @@
}
}
-void
+void
print_cset(basic_io::printer & printer,
cset const & cs)
{
@@ -335,7 +335,7 @@
file_path_internal(s).split(sp);
}
-void
+void
parse_cset(basic_io::parser & parser,
cset & cs)
{
@@ -346,13 +346,13 @@
split_path p1, p2;
MM(p1);
MM(p2);
-
+
split_path prev_path;
MM(prev_path);
pair prev_pair;
MM(prev_pair.first);
MM(prev_pair.second);
-
+
// we make use of the fact that a valid split_path is never empty
prev_path.clear();
while (parser.symp(syms::delete_node))
@@ -409,11 +409,11 @@
parser.hex(t1);
parser.esym(syms::to);
parser.hex(t2);
- safe_insert(cs.deltas_applied,
+ safe_insert(cs.deltas_applied,
make_pair(p1, make_pair(file_id(t1), file_id(t2))));
}
- prev_pair.first.clear();
+ prev_pair.first.clear();
while (parser.symp(syms::clear))
{
parser.sym();
@@ -426,7 +426,7 @@
safe_insert(cs.attrs_cleared, new_pair);
}
- prev_pair.first.clear();
+ prev_pair.first.clear();
while (parser.symp(syms::set))
{
parser.sym();
@@ -485,7 +485,7 @@
// the file has attr "attr_file=value_file", and the dir has
// "attr_dir=value_dir".
r = roster_t();
-
+
{
split_path sp;
file_path().split(sp);
@@ -508,7 +508,7 @@
static void
cset_written_test()
{
- {
+ {
L(FL("TEST: cset reading - operation misordering"));
// bad cset, add_dir should be before add_file
string s("delete \"foo\"\n"
@@ -715,9 +715,9 @@
cs.nodes_renamed.insert(make_pair(fish, womble));
cs.deltas_applied.insert(make_pair(womble, make_pair(f2, f3)));
cs.attrs_cleared.insert(make_pair(policeman, attr_key("yodel")));
- cs.attrs_set.insert(make_pair(make_pair(policeman,
+ cs.attrs_set.insert(make_pair(make_pair(policeman,
attr_key("axolotyl")), attr_value("fruitily")));
- cs.attrs_set.insert(make_pair(make_pair(policeman,
+ cs.attrs_set.insert(make_pair(make_pair(policeman,
attr_key("spin")), attr_value("capybara")));
data dat; MM(dat);
@@ -766,7 +766,7 @@
MM(r);
editable_roster_base tree(r, nis);
-
+
file_id f1(string("0000000000000000000000000000000000000001"));
file_id f2(string("0000000000000000000000000000000000000002"));
@@ -851,7 +851,7 @@
L(FL("TEST: set attr"));
setup_roster(r, f1, nis);
cset cs; MM(cs);
- cs.attrs_set.insert(make_pair(make_pair(foo_bar, attr_key("ping")),
+ cs.attrs_set.insert(make_pair(make_pair(foo_bar, attr_key("ping")),
attr_value("klang")));
BOOST_CHECK_NOT_THROW(cs.apply_to(tree), logic_error);
@@ -868,11 +868,11 @@
L(FL("TEST: clear attr file"));
setup_roster(r, f1, nis);
cset cs; MM(cs);
- cs.attrs_set.insert(make_pair(make_pair(foo_bar, attr_key("ping")),
+ cs.attrs_set.insert(make_pair(make_pair(foo_bar, attr_key("ping")),
attr_value("klang")));
cs.attrs_cleared.insert(make_pair(foo_bar, attr_key("attr_file")));
BOOST_CHECK_NOT_THROW(cs.apply_to(tree), logic_error);
- BOOST_CHECK((r.get_node(foo_bar))->attrs[attr_key("attr_file")]
+ BOOST_CHECK((r.get_node(foo_bar))->attrs[attr_key("attr_file")]
== make_pair(false, attr_value("")));
BOOST_CHECK(r.all_nodes().size() == 3);
}
@@ -881,7 +881,7 @@
{
L(FL("TEST: renaming at different levels"));
setup_roster(r, f1, nis);
- split_path quux_sub, foo_sub, foo_sub_deep, foo_subsub,
+ split_path quux_sub, foo_sub, foo_sub_deep, foo_subsub,
foo_subsub_deep, quux_bar, foo_bar,
quux_sub_thing, foo_sub_thing;
file_path_internal("quux/bar").split(quux_bar);
@@ -946,7 +946,7 @@
roster_t r;
MM(r);
editable_roster_base tree(r, nis);
-
+
file_id f1(string("0000000000000000000000000000000000000001"));
file_id f2(string("0000000000000000000000000000000000000002"));
@@ -1121,7 +1121,7 @@
roster_t r;
MM(r);
editable_roster_base tree(r, nis);
-
+
file_id f1(string("0000000000000000000000000000000000000001"));
split_path root, baz;
============================================================
--- cset.hh 2d06997a4c2475aa45550dbe967c09397575d908
+++ cset.hh 6410b0b216aed5a227e15a4537ca08d5f673a81f
@@ -37,8 +37,8 @@
virtual void attach_node(node_id nid, split_path const & dst) = 0;
// Modifying elements in-place
- virtual void apply_delta(split_path const & pth,
- file_id const & old_id,
+ virtual void apply_delta(split_path const & pth,
+ file_id const & old_id,
file_id const & new_id) = 0;
virtual void clear_attr(split_path const & pth,
attr_key const & name) = 0;
@@ -52,9 +52,9 @@
};
-// In-memory representation of a change set.
+// In-memory representation of a change set.
-struct cset
+struct cset
{
// Deletions.
path_set nodes_deleted;
@@ -84,25 +84,25 @@
&& attrs_set == other.attrs_set
;
}
-
+
void apply_to(editable_tree & t) const;
bool empty() const;
void clear();
};
-inline split_path const &
+inline split_path const &
delta_entry_path(std::map >::const_iterator i)
{
return i->first;
}
-inline file_id const &
+inline file_id const &
delta_entry_src(std::map >::const_iterator i)
{
return i->second.first;
}
-inline file_id const &
+inline file_id const &
delta_entry_dst(std::map >::const_iterator i)
{
return i->second.second;
@@ -111,14 +111,14 @@
namespace basic_io { struct printer; struct parser; }
-void
+void
print_cset(basic_io::printer & printer,
cset const & cs);
void
write_cset(cset const & cs, data & dat);
-void
+void
parse_cset(basic_io::parser & parser,
cset & cs);
============================================================
--- cycle_detector.hh 624eaa84d3bc3281a0d6280cbecb1e654f0bc723
+++ cycle_detector.hh 79f9f0af66246c9cb770c5e3b57172c8c1b4b6e9
@@ -16,13 +16,13 @@
template
struct cycle_detector
{
-
+
typedef std::vector< T > edge_vec;
typedef std::vector edge_map;
- typedef std::pair state;
typedef std::stack edge_stack;
-
+
edge_map edges;
edge_stack stk;
std::set global_in_edges;
@@ -39,8 +39,8 @@
src_edges.push_back(dst);
global_in_edges.insert(dst);
}
-
+
bool edge_makes_cycle(T const & src, T const & dst)
{
if (src == dst)
@@ -69,7 +69,7 @@
{
return true;
}
- if (val < edges.size() && ! edges.at(val).empty()
+ if (val < edges.size() && ! edges.at(val).empty()
&& visited.find(val) == visited.end())
{
visited.insert(val);
============================================================
--- database.cc 77592832b55b0c42a0d4afb23875dc242d3d67b4
+++ database.cc ae0895605e5a1b6745b3b034a2836f1ad0e8001e
@@ -75,7 +75,7 @@
int const any_rows = -1;
int const any_cols = -1;
-namespace
+namespace
{
struct query_param
{
@@ -93,17 +93,17 @@
};
return q;
}
-
+
query_param
blob(string const & blb)
{
- query_param q = {
+ query_param q = {
query_param::blob,
blb,
};
return q;
}
-
+
// track all open databases for close_all_databases() handler
set sql_contexts;
}
@@ -116,13 +116,13 @@
query()
{}
-
+
query & operator %(query_param const & qp)
{
args.push_back(qp);
return *this;
}
-
+
vector args;
string sql_cmd;
};
@@ -149,10 +149,10 @@
return same;
}
-void
+void
database::check_schema()
{
- string db_schema_id;
+ string db_schema_id;
calculate_schema_id (__sql, db_schema_id);
N (schema == db_schema_id,
F("layout of database %s doesn't match this version of monotone\n"
@@ -258,12 +258,12 @@
static void
-assert_sqlite3_ok(sqlite3 *s)
+assert_sqlite3_ok(sqlite3 *s)
{
int errcode = sqlite3_errcode(s);
if (errcode == SQLITE_OK) return;
-
+
const char * errmsg = sqlite3_errmsg(s);
// sometimes sqlite is not very helpful
@@ -289,7 +289,7 @@
F("sqlite error: %s\n%s") % errmsg % auxiliary_message);
}
-struct sqlite3 *
+struct sqlite3 *
database::sql(bool init, bool migrating_format)
{
if (! __sql)
@@ -325,14 +325,14 @@
return __sql;
}
-void
+void
database::initialize()
{
if (__sql)
throw oops("cannot initialize database while it is open");
require_path_is_nonexistent(filename,
- F("could not initialize database: %s: already exists")
+ F("could not initialize database: %s: already exists")
% filename);
system_path journal(filename.as_internal() + "-journal");
@@ -347,7 +347,7 @@
}
-struct
+struct
dump_request
{
dump_request() : sql(), out() {};
@@ -373,7 +373,7 @@
out << encode_hexenc(string(val,val+bytes));
out << "'";
}
- else
+ else
{
const unsigned char *val = sqlite3_column_text(stmt, i);
if (val == NULL)
@@ -392,10 +392,10 @@
}
}
}
- out << ");\n";
+ out << ");\n";
}
-static int
+static int
dump_table_cb(void *data, int n, char **vals, char **cols)
{
dump_request *dump = reinterpret_cast(data);
@@ -419,7 +419,7 @@
{
stepresult = sqlite3_step(stmt);
I(stepresult == SQLITE_DONE || stepresult == SQLITE_ROW);
- if (stepresult == SQLITE_ROW)
+ if (stepresult == SQLITE_ROW)
dump_row(*(dump->out), stmt, table_name);
}
while (stepresult == SQLITE_ROW);
@@ -429,7 +429,7 @@
return 0;
}
-static int
+static int
dump_index_cb(void *data, int n, char **vals, char **cols)
{
dump_request *dump = reinterpret_cast(data);
@@ -445,7 +445,7 @@
return 0;
}
-void
+void
database::dump(ostream & out)
{
// don't care about schema checking etc.
@@ -478,7 +478,7 @@
close();
}
-void
+void
database::load(istream & in)
{
string line;
@@ -511,7 +511,7 @@
}
-void
+void
database::debug(string const & sql, ostream & out)
{
results res;
@@ -540,7 +540,7 @@
}
}
-void
+void
database::info(ostream & out)
{
string id;
@@ -641,45 +641,45 @@
close();
}
-void
+void
database::ensure_open()
{
sqlite3 *s = sql();
I(s != NULL);
}
-void
+void
database::ensure_open_for_format_changes()
{
sqlite3 *s = sql(false, true);
I(s != NULL);
}
-database::~database()
+database::~database()
{
- L(FL("statement cache statistics\n"));
- L(FL("prepared %d statements\n") % statement_cache.size());
+ L(FL("statement cache statistics"));
+ L(FL("prepared %d statements") % statement_cache.size());
- for (map::const_iterator i = statement_cache.begin();
+ for (map::const_iterator i = statement_cache.begin();
i != statement_cache.end(); ++i)
- L(FL("%d executions of %s\n") % i->second.count % i->first);
+ L(FL("%d executions of %s") % i->second.count % i->first);
// trigger destructors to finalize cached statements
statement_cache.clear();
close();
}
-void
+void
database::execute(query const & query)
{
results res;
fetch(res, 0, 0, query);
}
-void
-database::fetch(results & res,
- int const want_cols,
- int const want_rows,
+void
+database::fetch(results & res,
+ int const want_cols,
+ int const want_rows,
query const & query)
{
int nrow;
@@ -690,7 +690,7 @@
res.resize(0);
map::iterator i = statement_cache.find(query.sql_cmd);
- if (i == statement_cache.end())
+ if (i == statement_cache.end())
{
statement_cache.insert(make_pair(query.sql_cmd, statement()));
i = statement_cache.find(query.sql_cmd);
@@ -699,16 +699,16 @@
const char * tail;
sqlite3_prepare(sql(), query.sql_cmd.c_str(), -1, i->second.stmt.paddr(), &tail);
assert_sqlite3_ok(sql());
- L(FL("prepared statement %s\n") % query.sql_cmd);
+ L(FL("prepared statement %s") % query.sql_cmd);
// no support for multiple statements here
- E(*tail == 0,
+ E(*tail == 0,
F("multiple statements in query: %s\n") % query.sql_cmd);
}
ncol = sqlite3_column_count(i->second.stmt());
- E(want_cols == any_cols || want_cols == ncol,
+ E(want_cols == any_cols || want_cols == ncol,
F("wanted %d columns got %d in query: %s\n") % want_cols % ncol % query.sql_cmd);
// bind parameters for this execution
@@ -720,7 +720,7 @@
// profiling finds this logging to be quite expensive
if (global_sanity.debug)
- L(FL("binding %d parameters for %s\n") % params % query.sql_cmd);
+ L(FL("binding %d parameters for %s") % params % query.sql_cmd);
for (int param = 1; param <= params; param++)
{
@@ -728,11 +728,11 @@
if (global_sanity.debug)
{
string log = query.args[param-1].data;
-
+
if (log.size() > constants::log_line_sz)
log = log.substr(0, constants::log_line_sz);
-
- L(FL("binding %d with value '%s'\n") % param % log);
+
+ L(FL("binding %d with value '%s'") % param % log);
}
switch (idx(query.args, param - 1).type)
@@ -753,28 +753,28 @@
default:
I(false);
}
-
+
assert_sqlite3_ok(sql());
}
// execute and process results
nrow = 0;
- for (rescode = sqlite3_step(i->second.stmt()); rescode == SQLITE_ROW;
+ for (rescode = sqlite3_step(i->second.stmt()); rescode == SQLITE_ROW;
rescode = sqlite3_step(i->second.stmt()))
{
vector row;
- for (int col = 0; col < ncol; col++)
+ for (int col = 0; col < ncol; col++)
{
const char * value = (const char*)sqlite3_column_blob(i->second.stmt(), col);
int bytes = sqlite3_column_bytes(i->second.stmt(), col);
- E(value, F("null result in query: %s\n") % query.sql_cmd);
+ E(value, F("null result in query: %s") % query.sql_cmd);
row.push_back(string(value, value + bytes));
- //L(FL("row %d col %d value='%s'\n") % nrow % col % value);
+ //L(FL("row %d col %d value='%s'") % nrow % col % value);
}
res.push_back(row);
}
-
+
if (rescode != SQLITE_DONE)
assert_sqlite3_ok(sql());
@@ -791,15 +791,15 @@
// general application-level logic
-void
+void
database::set_filename(system_path const & file)
{
I(!__sql);
filename = file;
}
-void
-database::begin_transaction(bool exclusive)
+void
+database::begin_transaction(bool exclusive)
{
if (transaction_level == 0)
{
@@ -820,26 +820,26 @@
}
-bool
+bool
database::have_pending_write(string const & tab, hexenc const & id)
{
return pending_writes.find(make_pair(tab, id)) != pending_writes.end();
}
-void
+void
database::load_pending_write(string const & tab, hexenc const & id, data & dat)
{
dat = safe_get(pending_writes, make_pair(tab, id));
}
-void
+void
database::cancel_pending_write(string const & tab, hexenc const & id)
{
safe_erase(pending_writes, make_pair(tab, id));
}
-void
-database::schedule_write(string const & tab,
+void
+database::schedule_write(string const & tab,
hexenc const & id,
data const & dat)
{
@@ -847,7 +847,7 @@
safe_insert(pending_writes, make_pair(make_pair(tab, id), dat));
}
-void
+void
database::commit_transaction()
{
if (transaction_level == 1)
@@ -863,7 +863,7 @@
transaction_level--;
}
-void
+void
database::rollback_transaction()
{
if (transaction_level == 1)
@@ -875,7 +875,7 @@
}
-bool
+bool
database::exists(hexenc const & ident,
string const & table)
{
@@ -890,7 +890,7 @@
}
-bool
+bool
database::delta_exists(hexenc const & ident,
string const & table)
{
@@ -906,7 +906,7 @@
results res;
query q("SELECT COUNT(*) FROM " + table);
fetch(res, one_col, one_row, q);
- return lexical_cast(res[0][0]);
+ return lexical_cast(res[0][0]);
}
unsigned long
@@ -942,7 +942,7 @@
}
void
-database::get_ids(string const & table, set< hexenc > & ids)
+database::get_ids(string const & table, set< hexenc > & ids)
{
results res;
query q("SELECT id FROM " + table);
@@ -954,7 +954,7 @@
}
}
-void
+void
database::get(hexenc const & ident,
data & dat,
string const & table)
@@ -981,7 +981,7 @@
dat = rdata_unpacked;
}
-void
+void
database::get_delta(hexenc const & ident,
hexenc const & base,
delta & del,
@@ -997,7 +997,7 @@
decode_gzip(del_packed, del);
}
-void
+void
database::put(hexenc const & ident,
data const & dat,
string const & table)
@@ -1012,13 +1012,13 @@
gzip dat_packed;
encode_gzip(dat, dat_packed);
-
+
string insert = "INSERT INTO " + table + " VALUES(?, ?)";
- execute(query(insert)
- % text(ident())
+ execute(query(insert)
+ % text(ident())
% blob(dat_packed()));
}
-void
+void
database::put_delta(hexenc const & ident,
hexenc const & base,
delta const & del,
@@ -1032,7 +1032,7 @@
encode_gzip(del, del_packed);
string insert = "INSERT INTO "+table+" VALUES(?, ?, ?)";
- execute(query(insert)
+ execute(query(insert)
% text(ident())
% text(base())
% blob(del_packed()));
@@ -1040,19 +1040,19 @@
// static ticker cache_hits("vcache hits", "h", 1);
-struct datasz
+struct datasz
{
unsigned long operator()(data const & t) { return t().size(); }
};
-static LRUCache, data, datasz>
+static LRUCache, data, datasz>
vcache(constants::db_version_cache_sz);
typedef vector< hexenc > version_path;
static void
-extend_path_if_not_cycle(string table_name,
- shared_ptr p,
+extend_path_if_not_cycle(string table_name,
+ shared_ptr p,
hexenc const & ext,
set< hexenc > & seen_nodes,
vector< shared_ptr > & next_paths)
@@ -1060,19 +1060,19 @@
for (version_path::const_iterator i = p->begin(); i != p->end(); ++i)
{
if ((*i)() == ext())
- throw oops("cycle in table '" + table_name + "', at node "
+ throw oops("cycle in table '" + table_name + "', at node "
+ (*i)() + " <- " + ext());
}
if (seen_nodes.find(ext) == seen_nodes.end())
- {
+ {
p->push_back(ext);
next_paths.push_back(p);
seen_nodes.insert(ext);
}
}
-void
+void
database::get_version(hexenc const & ident,
data & dat,
string const & data_table,
@@ -1107,8 +1107,8 @@
// node, so it much cheaper in terms of memory.
//
// we also maintain a cycle-detecting set, just to be safe
-
- L(FL("reconstructing %s in %s\n") % ident % delta_table);
+
+ L(FL("reconstructing %s in %s") % ident % delta_table);
I(delta_exists(ident, delta_table));
// Our reconstruction algorithm involves keeping a set of parallel
@@ -1117,7 +1117,7 @@
//
// On each iteration, we extend every active path by one step. If our
// extension involves a fork, we duplicate the path. If any path
- // contains a cycle, we fault.
+ // contains a cycle, we fault.
//
// If, by extending a path C, we enter a node which another path
// D has already seen, we kill path C. This avoids the possibility of
@@ -1129,7 +1129,7 @@
string delta_query = "SELECT base FROM " + delta_table + " WHERE id = ?";
{
- shared_ptr pth0 = shared_ptr