# # patch "commands.cc" # from [952e81e0c81d35977508b35b34c04d082a704f79] # to [7c48b11d14dd9d09d9b1ce7438db03b1cf558ea7] # # patch "restrictions.cc" # from [f00567c24894c679fba09faa5e02598e37f0fe77] # to [751a27b384929942a3bfc5286228c48788471bc0] # # patch "tests/t_ls_known.at" # from [8166924964d56ec99b8133c212b36c9a6509b415] # to [99eb14f8f7144c26b858c836b5fcdc355d0a246d] # # patch "work.cc" # from [017ae079b4de961c8e2dd41b180b79e04b8c5f6e] # to [45c039be61f0b62c573b4e4b4c18a200ba9a7b15] # ======================================================================== --- commands.cc 952e81e0c81d35977508b35b34c04d082a704f79 +++ commands.cc 7c48b11d14dd9d09d9b1ce7438db03b1cf558ea7 @@ -361,7 +361,7 @@ file_t old_file = downcast_to_file_t(old_node); file_t new_file = downcast_to_file_t(new_node); - if (!(new_file->content == old_file->content)) + if (new_file->content == old_file->content) { split_path sp; new_roster.get_name(nid, sp); @@ -1695,14 +1695,18 @@ path_set old_paths, new_paths; app.require_working_copy(); - get_base_roster_and_working_cset(app, args, base_rid, base_roster, old_paths, new_paths, included_work, excluded_work); for (path_set::const_iterator i = new_paths.begin(); i != new_paths.end(); ++i) { - file_path fp(*i); + if (i->size() == 1) + { + I(null_name(idx(*i, 0))); + continue; + } + file_path fp(*i); if (app.restriction_includes(fp) && !path_exists(fp)) missing.insert(*i); } @@ -2624,6 +2628,7 @@ "try adding --external or removing --diff-args?")); cset composite; + cset excluded; // initialize before transaction so we have a database to work with @@ -2634,7 +2639,6 @@ if (app.revision_selectors.size() == 0) { - cset excluded; get_working_revision_and_rosters(app, args, r_new, old_roster, new_roster, @@ -2654,9 +2658,10 @@ complete(app, idx(app.revision_selectors, 0)(), r_old_id); N(app.db.revision_exists(r_old_id), F("no such revision '%s'") % r_old_id); - get_unrestricted_working_revision_and_rosters(app, r_new, - old_roster, - new_roster); + get_working_revision_and_rosters(app, args, r_new, + old_roster, + new_roster, + excluded); // now clobber old_roster with the one specified app.db.get_revision(r_old_id, r_old); app.db.get_roster(r_old_id, old_roster); ======================================================================== --- restrictions.cc f00567c24894c679fba09faa5e02598e37f0fe77 +++ restrictions.cc 751a27b384929942a3bfc5286228c48788471bc0 @@ -177,6 +177,18 @@ restrict_cset(work, included, excluded, app); remap_paths(old_paths, old_roster, work, new_paths); + + for (std::set::const_iterator i = included.dirs_added.begin(); + i != included.dirs_added.end(); ++i) + new_paths.insert(*i); + + for (std::map::const_iterator i = included.files_added.begin(); + i != included.files_added.end(); ++i) + new_paths.insert(i->first); + + for (std::map::const_iterator i = included.nodes_renamed.begin(); + i != included.nodes_renamed.end(); ++i) + new_paths.insert(i->second); } void ======================================================================== --- tests/t_ls_known.at 8166924964d56ec99b8133c212b36c9a6509b415 +++ tests/t_ls_known.at 99eb14f8f7144c26b858c836b5fcdc355d0a246d @@ -30,6 +30,7 @@ AT_CHECK(MONOTONE ls known | sort, [], [stdout], []) AT_CHECK(CANONICALISE(stdout)) AT_DATA(ls_foobar_dir, [bar +dir dir/bar dir/foo foo @@ -51,6 +52,7 @@ AT_CHECK(MONOTONE ls known | sort, [], [stdout], []) AT_CHECK(CANONICALISE(stdout)) AT_DATA(ls_baz_dir, [baz +dir2 dir2/bar dir2/foo ]) ======================================================================== --- work.cc 017ae079b4de961c8e2dd41b180b79e04b8c5f6e +++ work.cc 45c039be61f0b62c573b4e4b4c18a200ba9a7b15 @@ -811,7 +811,7 @@ node_id nid = next_nid++; bookkeeping_path pth = path_for_nid(nid); require_path_is_nonexistent(pth, - F("path %s already exists")); + F("path %s already exists") % pth); mkdir_p(pth); return nid; } @@ -822,7 +822,7 @@ node_id nid = next_nid++; bookkeeping_path pth = path_for_nid(nid); require_path_is_nonexistent(pth, - F("path %s already exists")); + F("path %s already exists") % pth); file_data dat; source.get_file_content(content, dat); // FIXME_ROSTERS: what about charset conversion etc.?