#
#
# patch "ChangeLog"
# from [c66d0310fe8254ce323c78b3d7f2946b42e2fc07]
# to [d4a9ab3d568a112e4f03fd8391881483b9154cfe]
#
# patch "app_state.cc"
# from [2cab118139f3e81ea0ee3b46b99ff6e4d6714c51]
# to [24c3eb393ccb1f6dd6b8b7ec77e28e86d3102b17]
#
# patch "app_state.hh"
# from [7eac59cda812029f862c9965272f10242c5e0f21]
# to [7c7f7cb855dc4fa643d6ba62c8d4fac8c5c6075f]
#
# patch "cmd_ws_commit.cc"
# from [df6621e7ffc64c6b9d71834703108cf31f5f4dab]
# to [8bd6642849d379cb58bf81b4e69000e34f6bf17b]
#
============================================================
--- ChangeLog c66d0310fe8254ce323c78b3d7f2946b42e2fc07
+++ ChangeLog d4a9ab3d568a112e4f03fd8391881483b9154cfe
@@ -1,3 +1,9 @@
+2006-04-26 Timothy Brownawell
+
+ * app_state.{cc,hh}: Overload set_restriction to take a path_set as
+ the list of paths to restrict to.
+ * cmd_ws_commit.cc: Use this to fix revert --missing.
+
2006-04-25 Timothy Brownawell
* monotone.cc: --quiet forces --ticker=none
============================================================
--- app_state.cc 2cab118139f3e81ea0ee3b46b99ff6e4d6714c51
+++ app_state.cc 24c3eb393ccb1f6dd6b8b7ec77e28e86d3102b17
@@ -154,7 +154,7 @@
void
app_state::set_restriction(path_set const & valid_paths,
- vector const & paths)
+ path_set const & paths)
{
// FIXME: this was written before split_path, and only later kludged to
// work with it. Could be much tidier if written with knowledge of
@@ -163,18 +163,16 @@
static file_path root = file_path_internal("");
restrictions.clear();
excludes.clear();
- for (vector::const_iterator i = paths.begin(); i != paths.end(); ++i)
+ for (path_set::const_iterator i = paths.begin(); i != paths.end(); ++i)
{
- file_path p = file_path_external(*i);
- split_path sp;
- p.split(sp);
+ file_path p(*i);
N(lua.hook_ignore_file(p) ||
- p == root || valid_paths.find(sp) != valid_paths.end(),
+ p == root || valid_paths.find(*i) != valid_paths.end(),
F("unknown path '%s'\n") % p);
L(FL("'%s' added to restricted path set\n") % p);
- restrictions.insert(sp);
+ restrictions.insert(*i);
}
for (std::set::const_iterator i = exclude_patterns.begin();
@@ -203,6 +201,21 @@
}
}
+void
+app_state::set_restriction(path_set const & valid_paths,
+ vector const & paths)
+{
+ path_set ps;
+ for (vector::const_iterator i = paths.begin(); i != paths.end(); ++i)
+ {
+ file_path p = file_path_external(*i);
+ split_path sp;
+ p.split(sp);
+ ps.insert(sp);
+ }
+ set_restriction(valid_paths, ps);
+}
+
bool
app_state::restriction_includes(split_path const & sp)
{
============================================================
--- app_state.hh 7eac59cda812029f862c9965272f10242c5e0f21
+++ app_state.hh 7c7f7cb855dc4fa643d6ba62c8d4fac8c5c6075f
@@ -97,6 +97,8 @@
void set_restriction(path_set const & valid_paths,
std::vector const & paths);
+ void set_restriction(path_set const & valid_paths,
+ path_set const & paths);
bool restriction_includes(split_path const & path);
// Set the branch name. If you only invoke set_branch, the branch
============================================================
--- cmd_ws_commit.cc df6621e7ffc64c6b9d71834703108cf31f5f4dab
+++ cmd_ws_commit.cc 8bd6642849d379cb58bf81b4e69000e34f6bf17b
@@ -66,13 +66,7 @@
return;
}
- vector missing_args;
- for (path_set::const_iterator i = missing.begin(); i != missing.end(); i++)
- {
- L(FL("missing files are '%s'") % file_path(*i));
- missing_args.push_back(file_path(*i).as_external());
- }
- app.set_restriction(valid_paths, missing_args);
+ app.set_restriction(valid_paths, missing);
}
else
{