# # patch "ChangeLog" # from [5f129d856c871d430b705130e5bb6e6eeb0602f7] # to [39da01767ad792d02384c35fccbb72872d28c39f] # # patch "commands.cc" # from [ef1e40d44efaad6efcf5ecef916b1d1488a3228a] # to [2546adbbe28ab041dcdbfeaf41afb0d5897e882c] # ======================================================================== --- ChangeLog 5f129d856c871d430b705130e5bb6e6eeb0602f7 +++ ChangeLog 39da01767ad792d02384c35fccbb72872d28c39f @@ -1,5 +1,12 @@ 2005-08-15 Nathaniel Smith + * commands.cc (fcommit): Remove. This command has never been + documented, tested, or maintained; it also doesn't avoid the use + of temporary files (which was supposed to be its purpose). Has it + ever actually been used...? + +2005-08-15 Nathaniel Smith + * lua.cc (hook_init_attributes): Do more logging; use begin() instead of starting iteration by hand. ======================================================================== --- commands.cc ef1e40d44efaad6efcf5ecef916b1d1488a3228a +++ commands.cc 2546adbbe28ab041dcdbfeaf41afb0d5897e882c @@ -1134,92 +1134,8 @@ ALIAS(mv, rename) // fload and fmerge are simple commands for debugging the line -// merger. fcommit is a helper for making single-file commits to monotone -// (such as automated processes might want to do). +// merger. -CMD(fcommit, "tree", "REVISION FILENAME [LOG_MESSAGE]", - "commit change to a single file", OPT_NONE) -{ - if (args.size() != 2 && args.size() != 3) - throw usage(name); - - file_id old_fid, new_fid; - revision_id old_rid, new_rid; - manifest_id old_mid, new_mid; - manifest_map old_man, new_man; - file_data old_fdata, new_fdata; - cert_value branchname; - revision_data rdata; - revision_set rev; - boost::shared_ptr cs(new change_set()); - - string log_message(""); - delta del; - file_path pth(idx(args, 1)()); - - transaction_guard guard(app.db); - packet_db_writer dbw(app); - - complete(app, idx(args, 0)(), old_rid); - - // find the old rev, manifest and file - app.db.get_revision_manifest(old_rid, old_mid); - app.db.get_manifest(old_mid, old_man); - manifest_map::const_iterator i = old_man.find(pth); - N(i != old_man.end(), - F("cannot find file %s revision %s") - % pth % old_rid); - - // fetch the new file input - string s = get_stdin(); - new_fdata = file_data(s); - calculate_ident(new_fdata, new_fid); - - // diff and store the file edge - old_fid = manifest_entry_id(i); - app.db.get_file_version(old_fid, old_fdata); - diff(old_fdata.inner(), new_fdata.inner(), del); - dbw.consume_file_delta(old_fid, new_fid, - file_delta(del)); - - // diff and store the manifest edge - new_man = old_man; - new_man[pth] = new_fid; - calculate_ident(new_man, new_mid); - diff(old_man, new_man, del); - dbw.consume_manifest_delta(old_mid, new_mid, - manifest_delta(del)); - - // build and store a changeset and revision - cs->apply_delta(pth, old_fid, new_fid); - rev.new_manifest = new_mid; - rev.edges.insert(std::make_pair(old_rid, - std::make_pair(old_mid, cs))); - calculate_ident(rev, new_rid); - write_revision_set(rev, rdata); - dbw.consume_revision_data(new_rid, rdata); - - // take care of any extra certs - guess_branch(old_rid, app, branchname); - - if (args.size() == 3) - log_message = idx(args, 2)(); - else - get_log_message(rev, app, log_message); - - N(log_message.find_first_not_of(" \r\t\n") != string::npos, - F("empty log message")); - - cert_revision_in_branch(new_rid, branchname, app, dbw); - cert_revision_date_now(new_rid, app, dbw); - cert_revision_author_default(new_rid, app, dbw); - cert_revision_changelog(new_rid, log_message, app, dbw); - - // finish off - guard.commit(); -} - - CMD(fload, "debug", "", "load file contents into db", OPT_NONE) { string s = get_stdin();