# # patch "ChangeLog" # from [ffb426b0773af917d0a4ee24c8abeeddf4244351] # to [15b5a7c02b727b014a94957cfbf468a2371d5af1] # # patch "change_set.cc" # from [c9554a69662fecf70ead4b8fec54eab5c355118a] # to [8721281fd257c827409baf2df2ec98e7883e0710] # # patch "database_check.cc" # from [1098ea2b6e2a53449fd89dd6ae815f42d4206cd4] # to [924b949941d72064a292451e72c28bfb2e80755c] # # patch "diff_patch.cc" # from [e798174667fdbb10359025f4b050b0b1c017705c] # to [c080a1bd6428d24243c0fc224414be6eb0fb7949] # # patch "monotone.texi" # from [b74fe7b8159ecb4f9eb34ed284a9fbeaebfee7d7] # to [17687a1f93e1694cb6433d5e878ce3a00c08cd7f] # # patch "netsync.cc" # from [04871c9d35e04f3f8ed0d10c6311c643c5f79df1] # to [98bb94f9c22a40bc6f826cad62737a7f9bfb9a04] # # patch "smap.hh" # from [8fb308c5059d3d572a078c96a6937ed989b425ec] # to [d4acf13bff4208cfe2d87cb93fcb182a290d77f8] # # patch "tests/t_database_check.at" # from [11b64267ef57980019f461ea1acca582d2cb989e] # to [3ea731d55685488c6dadb5580b4cd04dc130e855] # # patch "ui.cc" # from [f0e2ff249a83fa8a210f961d773ca560bb281592] # to [bf5397526968d5189f12fef56ecd4990f622beef] # --- ChangeLog +++ ChangeLog @@ -13,6 +13,39 @@ * tests/t_rename_dir_add_dir_with_old_name.at: New test. * testsuite.at: Add it. +2005-04-16 Matt Johnston + + * change_set.cc (compose_rearrangement): remove logging statements + that were using noticable CPU time. + +2005-04-15 Olivier Andrieu + + * diff_patch.cc(guess_binary): do not use '\x00' as first + character of a C string ... + +2005-04-15 Sebastian Spaeth + + * ui.cc: print byte progress to one decimal place + in k or M. + * netsync.cc: update dot ticker every 1024 bytes. + +2005-04-15 Matt Johnston + + * change_set.cc (confirm_proper_tree): use bitsets rather than maps + for tracking set membership. + * smap.hh: return reverse iterators properly, iterate over the vector + rather than self in ensure_sort() + +2005-04-14 Derek Scherger + + * database_check.cc (check_db): fail with N(...) when problems are + detected to exit with a non-zero status + +2005-04-14 Derek Scherger + + * monotone.texi (Informative): update description of 'diff' with + two revision arguments + 2005-04-14 Matthew Gregan * win32/process.cc: Fix build on MingW 3.2.0-rc[123] by adding --- change_set.cc +++ change_set.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "basic_io.hh" #include "change_set.hh" @@ -513,19 +514,30 @@ static void confirm_proper_tree(path_state const & ps) { - std::map confirmed; - I(ps.find(root_tid) == ps.end()); + if (ps.empty()) + return; + + I(ps.find(root_tid) == ps.end()); // Note that this find() also ensures + // sortedness of ps. + + tid min_tid = ps.begin()->first; + tid max_tid = ps.rbegin()->first; + size_t tid_range = max_tid - min_tid + 1; + + boost::dynamic_bitset<> confirmed(tid_range); + boost::dynamic_bitset<> ancs(tid_range); + for (path_state::const_iterator i = ps.begin(); i != ps.end(); ++i) { tid curr = i->first; path_item item = i->second; - std::map ancs; + ancs.reset(); - while (confirmed.find(curr) == confirmed.end()) + while (confirmed.test(curr - min_tid) == false) { sanity_check_path_item(item); - I(ancs.find(curr) == ancs.end()); - ancs.insert(std::make_pair(curr,true)); + I(ancs.test(curr - min_tid) == false); + ancs.set(curr - min_tid); if (path_item_parent(item) == root_tid) break; else @@ -542,10 +554,8 @@ I(path_item_type(item) == ptype_directory); } } - std::copy(ancs.begin(), ancs.end(), - inserter(confirmed, confirmed.begin())); + confirmed |= ancs; } - I(confirmed.find(root_tid) == confirmed.end()); } static void @@ -751,15 +761,19 @@ if (old_path == new_path) { + /* L(F("skipping preserved %s %d : '%s'\n") % (path_item_type(old_item) == ptype_directory ? "directory" : "file") % curr % old_path); + */ continue; } + /* L(F("analyzing %s %d : '%s' -> '%s'\n") % (path_item_type(old_item) == ptype_directory ? "directory" : "file") % curr % old_path % new_path); + */ if (null_name(path_item_name(old_item))) { --- database_check.cc +++ database_check.cc @@ -671,7 +671,8 @@ missing_keys; if (total > 0) - P(F("check complete: %d files; %d manifests; %d revisions; %d keys; %d certs; %d problems detected\n") + N(total == 0, + F("check complete: %d files; %d manifests; %d revisions; %d keys; %d certs; %d problems detected\n") % checked_files.size() % checked_manifests.size() % checked_revisions.size() --- diff_patch.cc +++ diff_patch.cc @@ -25,7 +25,8 @@ { // these do not occur in ASCII text files // FIXME: this heuristic is (a) crap and (b) hardcoded. fix both these. - if (s.find_first_of("\x00\x01\x02\x03\x04\x05\x06\x0e\x0f" + if (s.find_first_of('\x00') != string::npos || + s.find_first_of("\x01\x02\x03\x04\x05\x06\x0e\x0f" "\x10\x11\x12\x13\x14\x15\x16\x17\x18" "\x19\x1a\x1c\x1d\x1e\x1f") != string::npos) return true; --- monotone.texi +++ monotone.texi @@ -3612,9 +3612,7 @@ differences between the revision @var{id} and the current revision in the working copy. With two @option{--revision} options @command{diff} will print the differences between revisions @var{id1} and @var{id2}, -ignoring any working copy. Note that no @var{pathname...} arguments may -be specified to restrict the diff output in this case. Restrictions may -only be applied to the current, in-progress, working copy revision. +ignoring any working copy. In all cases, monotone will print a textual summary -- identical to the summary presented by @command{monotone status} -- of the logical @@ -3623,8 +3621,8 @@ a program processing the diff, such as @command{patch}. Specifying pathnames to the @command{diff} command restricts the set of -changes that are visible and results in only a partial diff of the -working copy. Changes to files not included in the specified set of +changes that are visible and results in only a partial diff between +two revisions. Changes to files not included in the specified set of pathnames will be ignored. From within a subdirectory of the working copy the @command{diff} --- netsync.cc +++ netsync.cc @@ -2897,8 +2897,8 @@ session sess(role, client_voice, collections, all_collections, app, address(), server.get_socketfd(), timeout); - sess.byte_in_ticker.reset(new ticker("bytes in", ">", 256, true)); - sess.byte_out_ticker.reset(new ticker("bytes out", "<", 256, true)); + sess.byte_in_ticker.reset(new ticker("bytes in", ">", 1024, true)); + sess.byte_out_ticker.reset(new ticker("bytes out", "<", 1024, true)); if (role == sink_role) { sess.cert_in_ticker.reset(new ticker("certs in", "c", 3)); --- smap.hh +++ smap.hh @@ -86,11 +86,11 @@ std::sort(vec.begin(), vec.end(), val_cmp); // make sure we don't have any duplicate entries const_iterator leader, lagged; - lagged = begin(); - leader = begin(); - I(leader != end()); + lagged = vec.begin(); + leader = vec.begin(); + I(leader != vec.end()); ++leader; - for (; leader != end(); ++lagged, ++leader) + for (; leader != vec.end(); ++lagged, ++leader) I(lagged->first != leader->first); damaged = false; } @@ -165,13 +165,13 @@ iterator begin() { return vec.begin(); } iterator end() { return vec.end(); } - iterator rbegin() { return vec.rbegin(); } - iterator rend() { return vec.rend(); } + reverse_iterator rbegin() { return vec.rbegin(); } + reverse_iterator rend() { return vec.rend(); } const_iterator begin() const { return vec.begin(); } const_iterator end() const { return vec.end(); } - const_iterator rbegin() const { return vec.rbegin(); } - const_iterator rend() const { return vec.rend(); } + const_reverse_iterator rbegin() const { return vec.rbegin(); } + const_reverse_iterator rend() const { return vec.rend(); } bool empty() const { return vec.empty(); } size_type size() const { return vec.size(); } --- tests/t_database_check.at +++ tests/t_database_check.at @@ -60,7 +60,7 @@ AT_CHECK(MONOTONE db execute "delete from files where id='$FILE2'", [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep 'database is good' stderr, [1], [ignore], [ignore]) AT_CHECK(grep 'problems detected' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '1 missing file' stderr, [0], [ignore], [ignore]) @@ -74,13 +74,13 @@ AT_CHECK(MONOTONE read < fileX, [], [ignore], [ignore]) AT_CHECK(MONOTONE read < manifestX, [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '1 unreferenced file' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '1 unreferenced manifest' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '7 missing files' stderr, [0], [ignore], [ignore]) AT_CHECK(MONOTONE db execute "delete from revision_ancestry", [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '2 mismatched parent' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '2 mismatched child' stderr, [0], [ignore], [ignore]) @@ -90,34 +90,34 @@ XDELTA_HH="68d15dc01398c7bb375b1a90fbb420bebef1bac7" AT_CHECK(MONOTONE db execute "insert into revision_ancestry values('$XDELTA_CC', '$XDELTA_HH')", [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '3 mismatched parent' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '3 mismatched child' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '2 missing revision' stderr, [0], [ignore], [ignore]) AT_CHECK(MONOTONE db execute "delete from manifest_deltas where id='$MAN1'", [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '1 missing manifest' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '3 revisions with bad history' stderr, [0], [ignore], [ignore]) AT_CHECK(MONOTONE db execute "delete from revisions where id='$REV1'", [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '3 missing revision' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '2 revisions with bad history' stderr, [0], [ignore], [ignore]) echo "$REV2:comment:this is a test:address@hidden:bogus sig" | sha1sum | read HASH AT_CHECK(MONOTONE db execute "insert into revision_certs values ('$HASH', '$REV2', 'comment', 'this is a test', 'address@hidden', 'bogus sig')", [], [ignore], [ignore]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '1 bad sig' stderr, [0], [ignore], [ignore]) AT_CHECK(MONOTONE db execute "delete from revision_certs where name = 'date'", [], [ignore], [stderr]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '2 missing certs' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '2 mismatched certs' stderr, [0], [ignore], [ignore]) AT_CHECK(MONOTONE db execute "delete from public_keys", [], [ignore], [stderr]) -AT_CHECK(MONOTONE db check --ticker=dot, [], [ignore], [stderr]) +AT_CHECK(MONOTONE db check --ticker=dot, [1], [ignore], [stderr]) AT_CHECK(grep '1 missing key' stderr, [0], [ignore], [ignore]) AT_CHECK(grep '10 unchecked signatures' stderr, [0], [ignore], [ignore]) --- ui.cc +++ ui.cc @@ -5,6 +5,7 @@ #include "transforms.hh" #include +#include #include // copyright (C) 2002, 2003 graydon hoare @@ -84,15 +85,28 @@ i != ui.tickers.end(); ++i) { string suffix; - int div = 1; + ostringstream disptick; if (i->second->kilocount && i->second->ticks >= 10000) - { - div = 1024; - suffix = "k"; + { // automatic unit conversion is enabled + float div; + if (i->second->ticks >= 1048576) { + // ticks >=1MB, use Mb + div = 1048576; + suffix = "M"; + } else { + // ticks <1MB, use kb + div = 1024; + suffix = "k"; + } + disptick << std::fixed << std::setprecision(1) << + (i->second->ticks / div); + } else { + // no automatic unit conversion. + disptick << i->second->ticks; } tickline += string(" [") - + i->first + ": " + lexical_cast(i->second->ticks / div) + + i->first + ": " + disptick.str() + suffix + "]"; }