# # # patch "ChangeLog" # from [1b822ac9ae7cbdf1ff93f599450e5186add032bc] # to [14cf7c60521298d3e5a972b190a9c162119e6d66] # # patch "cmd_ws_commit.cc" # from [df6621e7ffc64c6b9d71834703108cf31f5f4dab] # to [d4893a2a8a8e11d32bf454188f763a972c6c12df] # # patch "restrictions.cc" # from [9f2c033f24bdccdde48c86f186e91b6d8b19b026] # to [d6aab977cceb6ba3023a412b493d5b4427dc7cb4] # # patch "restrictions.hh" # from [5bcf6d58f2f3f07e2cd7c9ec874f10eaab6b7786] # to [90f92189154b660bfa8a5dd180d827f642852895] # # patch "work.cc" # from [b4e65a058f65062894d119f77e9ab0866b05a4c5] # to [9b352daf7e285c5fd4640140e33dcffc1825201f] # # patch "work.hh" # from [85d65d1e29318209a3f12306fe9072dc47995ff7] # to [e2e4b9cec0cf493e4550e3d555a5a5da7f0c0024] # ============================================================ --- ChangeLog 1b822ac9ae7cbdf1ff93f599450e5186add032bc +++ ChangeLog 14cf7c60521298d3e5a972b190a9c162119e6d66 @@ -1,3 +1,9 @@ +2006-04-25 Derek Scherger + + * restrictions.{cc,hh} (find_missing, find_unknown_and_ignored): move to... + * work.{cc,hh}: ...here since these are not really restriction things + * cmd_ws_commit.cc: sort includes and add work.hh to account for moves + 2006-04-24 Derek Scherger * contrib/monotone.el (monotone-commit-complete): call line ============================================================ --- cmd_ws_commit.cc df6621e7ffc64c6b9d71834703108cf31f5f4dab +++ cmd_ws_commit.cc d4893a2a8a8e11d32bf454188f763a972c6c12df @@ -1,10 +1,11 @@ #include "cmd.hh" -#include "revision.hh" #include "diff_patch.hh" #include "packet.hh" +#include "restrictions.hh" +#include "revision.hh" #include "transforms.hh" -#include "restrictions.hh" +#include "work.hh" #include using std::map; ============================================================ --- restrictions.cc 9f2c033f24bdccdde48c86f186e91b6d8b19b026 +++ restrictions.cc d6aab977cceb6ba3023a412b493d5b4427dc7cb4 @@ -361,49 +361,3 @@ restrict_cset(cs, included, excluded, app); } -void -find_missing(app_state & app, - std::vector const & args, - path_set & missing) -{ - revision_id base_rid; - roster_t base_roster; - cset included_work, excluded_work; - path_set old_paths, new_paths; - - app.require_workspace(); - 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) - { - if (i->size() == 1) - { - I(null_name(idx(*i, 0))); - continue; - } - file_path fp(*i); - if (app.restriction_includes(*i) && !path_exists(fp)) - missing.insert(*i); - } -} - -void -find_unknown_and_ignored(app_state & app, - bool want_ignored, - std::vector const & args, - path_set & unknown, - path_set & ignored) -{ - revision_set rev; - roster_t old_roster, new_roster; - path_set known; - temp_node_id_source nis; - - get_working_revision_and_rosters(app, args, rev, old_roster, new_roster, nis); - new_roster.extract_path_set(known); - - file_itemizer u(app, known, unknown, ignored); - walk_tree(file_path(), u); -} ============================================================ --- restrictions.hh 5bcf6d58f2f3f07e2cd7c9ec874f10eaab6b7786 +++ restrictions.hh 90f92189154b660bfa8a5dd180d827f642852895 @@ -83,16 +83,4 @@ cset & included, cset & excluded); -void -find_missing(app_state & app, - std::vector const & args, - path_set & missing); - -void -find_unknown_and_ignored(app_state & app, - bool want_ignored, - std::vector const & args, - path_set & unknown, - path_set & ignored); - #endif // header guard ============================================================ --- work.cc b4e65a058f65062894d119f77e9ab0866b05a4c5 +++ work.cc 9b352daf7e285c5fd4640140e33dcffc1825201f @@ -15,6 +15,7 @@ #include "cset.hh" #include "file_io.hh" #include "platform.hh" +#include "restrictions.hh" #include "sanity.hh" #include "safe_map.hh" #include "transforms.hh" @@ -50,6 +51,54 @@ } +void +find_missing(app_state & app, + std::vector const & args, + path_set & missing) +{ + revision_id base_rid; + roster_t base_roster; + cset included_work, excluded_work; + path_set old_paths, new_paths; + + app.require_workspace(); + 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) + { + if (i->size() == 1) + { + I(null_name(idx(*i, 0))); + continue; + } + file_path fp(*i); + if (app.restriction_includes(*i) && !path_exists(fp)) + missing.insert(*i); + } +} + +void +find_unknown_and_ignored(app_state & app, + bool want_ignored, + std::vector const & args, + path_set & unknown, + path_set & ignored) +{ + revision_set rev; + roster_t old_roster, new_roster; + path_set known; + temp_node_id_source nis; + + get_working_revision_and_rosters(app, args, rev, old_roster, new_roster, nis); + new_roster.extract_path_set(known); + + file_itemizer u(app, known, unknown, ignored); + walk_tree(file_path(), u); +} + + class addition_builder : public tree_walker ============================================================ --- work.hh 85d65d1e29318209a3f12306fe9072dc47995ff7 +++ work.hh e2e4b9cec0cf493e4550e3d555a5a5da7f0c0024 @@ -60,6 +60,18 @@ }; void +find_missing(app_state & app, + std::vector const & args, + path_set & missing); + +void +find_unknown_and_ignored(app_state & app, + bool want_ignored, + std::vector const & args, + path_set & unknown, + path_set & ignored); + +void perform_additions(path_set const & targets, app_state & app, bool recursive = true); void