# # patch "Makefile.am" # from [76d958030020f74a8337d2da80762316cdac363e] # to [b4e54cf6debc0b615c8b1da211aeae2b65431696] # # patch "commands.cc" # from [aa4839cbdb1f7ecc4f8f12f58cf30d4b50f4f565] # to [ac1b1f473c02fa1f49a295174882fcb8452eb081] # # patch "roster.hh" # from [36aa7d8540e15710ea9fb44023c7e0419fdf4c1b] # to [6fb90c1b03e5a501aa9235f4f774488c3a7e1728] # # patch "work.cc" # from [c20dfd83af47411efbbb99caa23ec2cbff77e9e8] # to [963086ebd20315f2ccfabdf79a69813f77199701] # # patch "work.hh" # from [ec5f5d73337dd3c6a6d601ca5b3b50303e76ce0c] # to [f19c2815fabb8816a73e5907d168e94b271cb639] # ======================================================================== --- Makefile.am 76d958030020f74a8337d2da80762316cdac363e +++ Makefile.am b4e54cf6debc0b615c8b1da211aeae2b65431696 @@ -132,8 +132,8 @@ botan/pbe_pkcs.h botan/rsa.h botan/x509_crl.h botan/asn1.h \ botan/certstor.h botan/dlies.h botan/fips140.h botan/mgf1.h \ botan/pem.h botan/s2k.h botan/x509_key.h botan/asn1_obj.h \ - botan/cfb.h botan/dl_param.h botan/fips_rng.h botan/modebase.h \ - botan/pipe.h botan/x509_obj.h \ + botan/cfb.h botan/dl_param.h botan/modebase.h \ + botan/pipe.h botan/x509_obj.h \ botan/asn1_oid.h botan/conf.h botan/eax.h botan/gzip.h \ botan/mode_pad.h botan/pk_algs.h botan/secmem.h \ botan/x509self.h botan/barrett.h botan/config.h botan/ecb.h \ ======================================================================== --- commands.cc aa4839cbdb1f7ecc4f8f12f58cf30d4b50f4f565 +++ commands.cc ac1b1f473c02fa1f49a295174882fcb8452eb081 @@ -819,6 +819,7 @@ void changes_summary::print(std::ostream & os, size_t max_cols) const { + if (! cs.nodes_deleted.empty()) { os << "Deleted entries:" << endl; @@ -846,7 +847,7 @@ if (! cs.dirs_added.empty()) { - os << "Added files:" << endl; + os << "Added directories:" << endl; print_indented_set(os, cs.dirs_added, max_cols); } @@ -1210,8 +1211,6 @@ ALIAS(rm, drop); -/* -FIXME_ROSTERS CMD(rename, N_("working copy"), N_("SRC DST"), N_("rename entries in the working copy"), @@ -1222,24 +1221,15 @@ app.require_working_copy(); - manifest_map m_old; - get_base_manifest(app, m_old); + file_path src_path = file_path_external(idx(args, 0)); + file_path dst_path = file_path_external(idx(args, 1)); - change_set::path_rearrangement work; - get_path_rearrangement(work); - - build_rename(file_path_external(idx(args, 0)), - file_path_external(idx(args, 1)), - m_old, app, work); - - put_path_rearrangement(work); - - update_any_attrs(app); + perform_rename(src_path, dst_path, app); } ALIAS(mv, rename) -*/ + // fload and fmerge are simple commands for debugging the line // merger. ======================================================================== --- roster.hh 36aa7d8540e15710ea9fb44023c7e0419fdf4c1b +++ roster.hh 6fb90c1b03e5a501aa9235f4f774488c3a7e1728 @@ -133,7 +133,6 @@ void dump(node_t const & n, std::string & out); - struct marking_t { revision_id birth_revision; @@ -186,7 +185,7 @@ void attach_node(node_id nid, node_id parent, path_component name); void apply_delta(split_path const & pth, file_id const & old_id, - file_id const & new_new); + file_id const & new_id); void clear_attr(split_path const & pth, attr_key const & name); void set_attr(split_path const & pth, ======================================================================== --- work.cc c20dfd83af47411efbbb99caa23ec2cbff77e9e8 +++ work.cc 963086ebd20315f2ccfabdf79a69813f77199701 @@ -221,78 +221,41 @@ update_any_attrs(app); } -/* -// FIXME_ROSTERS: disabled until rewritten to use rosters - void -build_rename(file_path const & src, - file_path const & dst, - manifest_map const & man, - app_state & app, - change_set::path_rearrangement & pr) +perform_rename(file_path const & src_path, + file_path const & dst_path, + app_state & app) { - N(!src.empty(), F("invalid source path ''")); - N(!dst.empty(), F("invalid destination path ''")); + temp_node_id_source nis; + roster_t base_roster, new_roster; + split_path src, dst; - change_set::path_rearrangement pr_new, pr_concatenated; - path_set ps; - extract_path_set(man, ps); - apply_path_rearrangement(pr, ps); + get_base_and_current_roster_shape(base_roster, new_roster, nis, app); - bool src_dir_p = false; - bool dst_dir_p = false; + src_path.split(src); + dst_path.split(dst); - N(known_path(src, ps, src_dir_p), - F("%s does not exist in current revision\n") % src); + N(new_roster.has_node(src), + F("%s does not exist in current revision\n") % src_path); - N(!known_path(dst, ps, dst_dir_p), - F("%s already exists in current revision\n") % dst); + N(!new_roster.has_node(dst), + F("%s already exists in current revision\n") % dst_path); - P(F("adding %s -> %s to working copy rename set\n") % src % dst); - if (src_dir_p) - pr_new.renamed_dirs.insert(std::make_pair(src, dst)); - else - pr_new.renamed_files.insert(std::make_pair(src, dst)); + P(F("adding %s -> %s to working copy rename set\n") % src_path % dst_path); - if (app.execute && (path_exists(src) || !path_exists(dst))) - move_path(src, dst); + node_id nid = new_roster.detach_node(src); + new_roster.attach_node(nid, dst); - // read attribute map if available - file_path attr_path; - get_attr_path(attr_path); + if (app.execute && path_exists(src_path) && !path_exists(dst_path)) + move_path(src_path, dst_path); - if (path_exists(attr_path)) - { - data attr_data; - read_data(attr_path, attr_data); - attr_map attrs; - read_attr_map(attr_data, attrs); - - // make sure there aren't pre-existing attributes that we'd accidentally - // pick up - N(attrs.find(dst) == attrs.end(), - F("%s has existing attributes in %s; clean them up first") % dst % attr_file_name); - - // only write out a new attribute map if we find attrs to move - attr_map::iterator a = attrs.find(src); - if (a != attrs.end()) - { - attrs[dst] = (*a).second; - attrs.erase(a); - - P(F("moving attributes for %s to %s\n") % src % dst); - - write_attr_map(attr_data, attrs); - write_data(attr_path, attr_data); - } - } - - normalize_path_rearrangement(pr_new); - concatenate_rearrangements(pr, pr_new, pr_concatenated); - pr = pr_concatenated; + cset new_work; + make_cset(base_roster, new_roster, new_work); + put_work_cset(new_work); + update_any_attrs(app); } -*/ + // work file containing rearrangement from uncommitted adds/drops/renames std::string const work_file_name("work"); ======================================================================== --- work.hh ec5f5d73337dd3c6a6d601ca5b3b50303e76ce0c +++ work.hh f19c2815fabb8816a73e5907d168e94b271cb639 @@ -66,18 +66,11 @@ void perform_deletions(path_set const & targets, app_state & app); -/* -// FIXME_ROSTERS: disabled until rewritten to use rosters +void +perform_rename(file_path const & src_path, + file_path const & dst_path, + app_state & app); -void -build_rename(file_path const & src, - file_path const & dst, - manifest_map const & m_old, - app_state & app, - change_set::path_rearrangement & pr); - -*/ - // the "work" file contains the current cset representing uncommitted // add/drop/rename operations (not deltas)