# # rename_file "tests/t_inventory.at" # to "tests/t_automate_inventory.at" # # patch "ChangeLog" # from [30828634f0fb1e8318afa57d8002db5e8956ffd9] # to [297bceb7e51c174a4bed2de77e187a39585bc297] # # patch "app_state.cc" # from [6ae71dd8eab819023b30c62cc0cf22701dc20d71] # to [7a6eec6df5336f398ef9a587f8ffd102b7beba2e] # # patch "app_state.hh" # from [34ce0c063205bb5c5bee6cf8e7016f1d7bd5d056] # to [27b58d6683bc026b41c07308738952067bf82926] # # patch "automate.cc" # from [9eb7fae312c0ac8f8886cfc038e8df41df71d29b] # to [104a3a0307c16c724da0fed33f087175aaaba5bf] # # patch "commands.cc" # from [ce7dfe3a3b86b971225af0a7284b6e8d6d1e6a40] # to [4d032f1c29cd1c829a6aeb1979dd11a32fc81139] # # patch "monotone.1" # from [afcfe5e4e38756065a06c8698b73a3bc2e359446] # to [ba5f63a813f90f28050235e3d6131c42a31f48fe] # # patch "monotone.cc" # from [0719867d9645dcd2322cce26a223889d9ae4fc78] # to [b7ea54927f9fc7ade638452e26e1fd77927f10e8] # # patch "monotone.texi" # from [ba3740efb738dc0ff9ce38e6448f78c8ad0747a5] # to [f3488861442fece50dd6f18404687429647b3efc] # # patch "tests/t_automate_inventory.at" # from [2cfa97b7d12c1bf751f7f8aefb64c7d566a2e8e1] # to [81165e26ca6a1c4c1310a8f2d1ad28feab636ea9] # # patch "testsuite.at" # from [73a4e7c1227aafec4b18808f86c08a663827a354] # to [0a779c26fbcdad4634e0d15f4449931709e18f81] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,17 @@ 2005-04-30 Derek Scherger + * app_state.{cc,hh}: remove --all-files option + * automate.cc: move inventory command and associated stuff here from ... + * commands.cc: ... here, where it has been removed + * monotone.1: relocate inventory command, remove --all-files option + * monotone.cc: remove --all-files option + * monotone.texi: relocate inventory documentation to automation + section, remove --all-files option + * tests/t_automate_inventory.at: renamed and updated for move to automate + * testsuite.at: adjust for rename + +2005-04-30 Derek Scherger + * Makefile.am (MOST_SOURCES): add restrictions.{cc,hh} * commands.cc (extract_rearranged_paths): (extract_delta_paths): --- app_state.cc +++ app_state.cc @@ -30,7 +30,7 @@ static string const key_option("key"); app_state::app_state() - : branch_name(""), db(""), stdhooks(true), rcfiles(true), all_files(false), + : branch_name(""), db(""), stdhooks(true), rcfiles(true), search_root("/"), depth(-1) { db.set_app(this); @@ -312,12 +312,6 @@ } void -app_state::set_all_files(bool b) -{ - all_files = b; -} - -void app_state::add_rcfile(utf8 const & filename) { extra_rcfiles.push_back(filename); --- app_state.hh +++ app_state.hh @@ -31,7 +31,6 @@ lua_hooks lua; bool stdhooks; bool rcfiles; - bool all_files; options_map options; utf8 message; utf8 date; @@ -72,7 +71,6 @@ void set_stdhooks(bool b); void set_rcfiles(bool b); - void set_all_files(bool b); void add_rcfile(utf8 const & filename); explicit app_state(); --- automate.cc +++ automate.cc @@ -10,10 +10,12 @@ #include #include -#include "vocab.hh" #include "app_state.hh" +#include "basic_io.hh" #include "commands.hh" +#include "restrictions.hh" #include "revision.hh" +#include "vocab.hh" static std::string const interface_version = "0.2"; @@ -450,6 +452,199 @@ output << *i << std::endl; } +struct inventory_item +{ + enum pstat + { UNCHANGED_PATH, ADDED_PATH, DROPPED_PATH, RENAMED_PATH, UNKNOWN_PATH, IGNORED_PATH } + path_status; + + enum dstat + { UNCHANGED_DATA, PATCHED_DATA, MISSING_DATA } + data_status; + + enum ptype + { FILE, DIRECTORY } + path_type; + + file_path old_path; + + inventory_item(): + path_status(UNCHANGED_PATH), data_status(UNCHANGED_DATA), path_type(FILE), old_path() {} +}; + +typedef std::map inventory_map; + +static void +inventory_paths(inventory_map & inventory, + path_set const & paths, + inventory_item::pstat path_status, + inventory_item::ptype path_type = inventory_item::FILE) +{ + for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++) + { + L(F("%d %d %s\n") % inventory[*i].path_status % path_status % *i); + I(inventory[*i].path_status == inventory_item::UNCHANGED_PATH); + inventory[*i].path_status = path_status; + inventory[*i].path_type = path_type; + } +} + +static void +inventory_paths(inventory_map & inventory, + path_set const & paths, + inventory_item::dstat data_status) +{ + for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++) + { + L(F("%d %d %s\n") % inventory[*i].data_status % data_status % *i); + I(inventory[*i].data_status == inventory_item::UNCHANGED_DATA); + inventory[*i].data_status = data_status; + } +} + +static void +inventory_paths(inventory_map & inventory, + std::map const & renames, + inventory_item::pstat path_status, + inventory_item::ptype path_type = inventory_item::FILE) +{ + for (std::map::const_iterator i = renames.begin(); + i != renames.end(); i++) + { + L(F("%d %d %s %s\n") % inventory[i->second].path_status % path_status % i->first % i->second); + I(inventory[i->second].path_status == inventory_item::UNCHANGED_PATH); + inventory[i->second].path_status = inventory_item::RENAMED_PATH; + inventory[i->second].path_type = path_type; + inventory[i->second].old_path = i->first; + } +} + +// Name: inventory +// Arguments: none +// Added in: 0.2 +// Purpose: Prints all the files found in a working copy or current manifest +// prefixed by 2 status code characters. The first status code character +// indicates the status of the path itsself and is drawn from the following +// set: +// +// ' ' the path is unchanged from the current manifest +// '+' the path has been added to the current manifest +// '-' the path has been dropped from the current manifest +// '%' the path has been renamed in the current manifest, both the old and new name are listed +// '?' the path is unknown, it exists in the working copy but not in the current manifest +// '~' the path is ignored by the current ignore_file lua hook setting +// +// The second status code character indicates the status of the data associated +// with the path and is drawn from the following set: +// +// ' ' the data is unchanged, its sha1 version matches the version in the base manifest +// '#' the data is changed, its sha1 version differs from the version in the base manifest +// '!' the data is missing and its sha1 version cannot be computed +// +// Output format: Each file is printed on its own line, prefixed by a +// two character status code and a single space character. All filenames are +// quoted with double quotes (") to support filenames containg spaces. Intervening quotes +// are escaped with \". Directories are identified by paths ending with '/' characters. +// Rename lines list the old name first, followed by the new name. +// Error conditions: If no working copy book keeping MT directory is found, +// prints an error message to stderr, and exits with status 1. +static void +automate_inventory(std::vector args, + std::string const & help_name, + app_state & app, + std::ostream & output) +{ + if (args.size() != 0) + throw usage(help_name); + + manifest_id old_manifest_id; + revision_id old_revision_id; + manifest_map m_old; + path_set old_paths, new_paths, empty; + change_set::path_rearrangement included, excluded; + path_set missing, changed, unchanged, unknown, ignored; + inventory_map inventory; + + app.require_working_copy(); + + calculate_restricted_rearrangement(app, args, + old_manifest_id, old_revision_id, + m_old, old_paths, new_paths, + included, excluded); + + file_itemizer u(app, new_paths, unknown, ignored); + walk_tree(u); + + // remove deleted paths from the set of unknown paths + + for (path_set::const_iterator i = included.deleted_files.begin(); + i != included.deleted_files.end(); ++i) + unknown.erase(*i); + + for (path_set::const_iterator i = included.deleted_dirs.begin(); + i != included.deleted_dirs.end(); ++i) + unknown.erase(*i); + + classify_paths(app, new_paths, m_old, missing, changed, unchanged); + + inventory_paths(inventory, missing, inventory_item::MISSING_DATA); + + inventory_paths(inventory, included.deleted_files, inventory_item::DROPPED_PATH); + inventory_paths(inventory, included.deleted_dirs, inventory_item::DROPPED_PATH, inventory_item::DIRECTORY); + + inventory_paths(inventory, included.renamed_files, inventory_item::RENAMED_PATH); + inventory_paths(inventory, included.renamed_dirs, inventory_item::RENAMED_PATH, inventory_item::DIRECTORY); + + inventory_paths(inventory, included.added_files, inventory_item::ADDED_PATH); + inventory_paths(inventory, changed, inventory_item::PATCHED_DATA); + + inventory_paths(inventory, unchanged, inventory_item::UNCHANGED_DATA); + inventory_paths(inventory, unknown, inventory_item::UNKNOWN_PATH); + inventory_paths(inventory, ignored, inventory_item::IGNORED_PATH); + + for (inventory_map::const_iterator i = inventory.begin(); i != inventory.end(); ++i) + { + switch (inventory[i->first].path_status) + { + case inventory_item::UNCHANGED_PATH: output << " "; break; + case inventory_item::ADDED_PATH: output << "+"; break; + case inventory_item::DROPPED_PATH: output << "-"; break; + case inventory_item::RENAMED_PATH: output << "%"; break; + case inventory_item::UNKNOWN_PATH: output << "?"; break; + case inventory_item::IGNORED_PATH: output << "~"; break; + } + + switch (inventory[i->first].data_status) + { + case inventory_item::UNCHANGED_DATA: output << " "; break; + case inventory_item::PATCHED_DATA: output << "#"; break; + case inventory_item::MISSING_DATA: output << "!"; break; + } + + output << " "; + + switch (inventory[i->first].path_type) + { + case inventory_item::FILE: + if (inventory[i->first].path_status == inventory_item::RENAMED_PATH) + output << basic_io::escape(inventory[i->first].old_path()) << " "; + + output << basic_io::escape(i->first()); + break; + + case inventory_item::DIRECTORY: + if (inventory[i->first].path_status == inventory_item::RENAMED_PATH) + output << basic_io::escape(inventory[i->first].old_path() + "/") << " "; + + output << basic_io::escape(i->first() + "/"); + break; + } + + output << std::endl; + } + +} + void automate_command(utf8 cmd, std::vector args, std::string const & root_cmd_name, @@ -480,6 +675,8 @@ automate_graph(args, root_cmd_name, app, output); else if (cmd() == "select") automate_select(args, root_cmd_name, app, output); + else if (cmd() == "inventory") + automate_inventory(args, root_cmd_name, app, output); else throw usage(root_cmd_name); } --- commands.cc +++ commands.cc @@ -1667,168 +1667,6 @@ } } -struct inventory_item -{ - enum pstat - { UNCHANGED_PATH, ADDED_PATH, DROPPED_PATH, RENAMED_PATH, UNKNOWN_PATH, IGNORED_PATH } - path_status; - - enum dstat - { UNCHANGED_DATA, PATCHED_DATA, MISSING_DATA } - data_status; - - enum ptype - { FILE, DIRECTORY } - path_type; - - file_path old_path; - - inventory_item(): - path_status(UNCHANGED_PATH), data_status(UNCHANGED_DATA), path_type(FILE), old_path() {} -}; - -typedef std::map inventory_map; - -static void -inventory_paths(inventory_map & inventory, - path_set const & paths, - inventory_item::pstat path_status, - inventory_item::ptype path_type = inventory_item::FILE) -{ - for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++) - { - L(F("%d %d %s\n") % inventory[*i].path_status % path_status % *i); - I(inventory[*i].path_status == inventory_item::UNCHANGED_PATH); - inventory[*i].path_status = path_status; - inventory[*i].path_type = path_type; - } -} - -static void -inventory_paths(inventory_map & inventory, - path_set const & paths, - inventory_item::dstat data_status) -{ - for (path_set::const_iterator i = paths.begin(); i != paths.end(); i++) - { - L(F("%d %d %s\n") % inventory[*i].data_status % data_status % *i); - I(inventory[*i].data_status == inventory_item::UNCHANGED_DATA); - inventory[*i].data_status = data_status; - } -} - -static void -inventory_paths(inventory_map & inventory, - std::map const & renames, - inventory_item::pstat path_status, - inventory_item::ptype path_type = inventory_item::FILE) -{ - for (std::map::const_iterator i = renames.begin(); - i != renames.end(); i++) - { - L(F("%d %d %s %s\n") % inventory[i->second].path_status % path_status % i->first % i->second); - I(inventory[i->second].path_status == inventory_item::UNCHANGED_PATH); - inventory[i->second].path_status = inventory_item::RENAMED_PATH; - inventory[i->second].path_type = path_type; - inventory[i->second].old_path = i->first; - } -} - -CMD(inventory, "informative", "[PATH]...", - "inventory of every file in working copy with associated status", - OPT_BRANCH_NAME % OPT_ALL_FILES) -{ - manifest_id old_manifest_id; - revision_id old_revision_id; - manifest_map m_old; - path_set old_paths, new_paths, empty; - change_set::path_rearrangement included, excluded; - path_set missing, changed, unchanged, unknown, ignored; - inventory_map inventory; - - app.require_working_copy(); - - calculate_restricted_rearrangement(app, args, - old_manifest_id, old_revision_id, - m_old, old_paths, new_paths, - included, excluded); - - file_itemizer u(app, new_paths, unknown, ignored); - walk_tree(u); - - // remove deleted paths from the set of unknown paths - - for (path_set::const_iterator i = included.deleted_files.begin(); - i != included.deleted_files.end(); ++i) - unknown.erase(*i); - - for (path_set::const_iterator i = included.deleted_dirs.begin(); - i != included.deleted_dirs.end(); ++i) - unknown.erase(*i); - - classify_paths(app, new_paths, m_old, missing, changed, unchanged); - - inventory_paths(inventory, missing, inventory_item::MISSING_DATA); - - inventory_paths(inventory, included.deleted_files, inventory_item::DROPPED_PATH); - inventory_paths(inventory, included.deleted_dirs, inventory_item::DROPPED_PATH, inventory_item::DIRECTORY); - - inventory_paths(inventory, included.renamed_files, inventory_item::RENAMED_PATH); - inventory_paths(inventory, included.renamed_dirs, inventory_item::RENAMED_PATH, inventory_item::DIRECTORY); - - inventory_paths(inventory, included.added_files, inventory_item::ADDED_PATH); - inventory_paths(inventory, changed, inventory_item::PATCHED_DATA); - - if (app.all_files) - { - inventory_paths(inventory, unchanged, inventory_item::UNCHANGED_DATA); - inventory_paths(inventory, unknown, inventory_item::UNKNOWN_PATH); - inventory_paths(inventory, ignored, inventory_item::IGNORED_PATH); - } - - for (inventory_map::const_iterator i = inventory.begin(); i != inventory.end(); ++i) - { - switch (inventory[i->first].path_status) - { - case inventory_item::UNCHANGED_PATH: cout << " "; break; - case inventory_item::ADDED_PATH: cout << "+"; break; - case inventory_item::DROPPED_PATH: cout << "-"; break; - case inventory_item::RENAMED_PATH: cout << "%"; break; - case inventory_item::UNKNOWN_PATH: cout << "?"; break; - case inventory_item::IGNORED_PATH: cout << "~"; break; - } - - switch (inventory[i->first].data_status) - { - case inventory_item::UNCHANGED_DATA: cout << " "; break; - case inventory_item::PATCHED_DATA: cout << "#"; break; - case inventory_item::MISSING_DATA: cout << "!"; break; - } - - cout << " "; - - switch (inventory[i->first].path_type) - { - case inventory_item::FILE: - if (inventory[i->first].path_status == inventory_item::RENAMED_PATH) - cout << basic_io::escape(inventory[i->first].old_path()) << " "; - - cout << basic_io::escape(i->first()); - break; - - case inventory_item::DIRECTORY: - if (inventory[i->first].path_status == inventory_item::RENAMED_PATH) - cout << basic_io::escape(inventory[i->first].old_path() + "/") << " "; - - cout << basic_io::escape(i->first() + "/"); - break; - } - - cout << endl; - } - -} - CMD(list, "informative", "certs ID\n" "keys [PATTERN]\n" @@ -3744,8 +3582,9 @@ "erase_ancestors [REV1 [REV2 [REV3 [...]]]]\n" "toposort [REV1 [REV2 [REV3 [...]]]]\n" "ancestry_difference NEW_REV [OLD_REV1 [OLD_REV2 [...]]]\n" - "leaves", - "automation interface", + "leaves\n" + "inventory", + "automation interface", OPT_NONE) { if (args.size() == 0) --- monotone.1 +++ monotone.1 @@ -41,9 +41,6 @@ \fBstatus \fI[...]\fP Show status of working copy. .TP -\fBinventory \fI[...]\fP -Show inventory of files in the working copy. -.TP \fBlog\fP \fI[id] \fP Show historical log of revisions, starting from working copy base revision, or \fI[id]\fP if given. @@ -177,7 +174,7 @@ \fBunset\fP \fI \fP Delete any setting for db var \fI\fP in domain \fI\fP. .TP -\fBautomate\fP \fI(interface_version|heads|descendents|erase_ancestors|toposort|ancestry_difference|leaves)\fP +\fBautomate\fP \fI(interface_version|heads|descendents|erase_ancestors|toposort|ancestry_difference|leaves|inventory)\fP Scripting interface. .TP \fBdb\fP \fI(init|info|version|dump|load|migrate|rebuild|execute|check)\fP @@ -291,10 +288,6 @@ \fB-@ \fI\fP An alias for \fB--xargs=\fI\fP .TP -\fB--all-files\fP -Include every file available in the working copy in the inventory -list. By default inventory only lists ``interesting'' files. This option -is specific to the @command{inventory} command. .SH ENVIRONMENT .TP --- monotone.cc +++ monotone.cc @@ -47,7 +47,6 @@ {"date", 0, POPT_ARG_STRING, &argstr, OPT_DATE, "override date/time for commit", NULL}, {"author", 0, POPT_ARG_STRING, &argstr, OPT_AUTHOR, "override author for commit", NULL}, {"depth", 0, POPT_ARG_LONG, &arglong, OPT_DEPTH, "limit the log output to the given number of entries", NULL}, - {"all-files", 0, POPT_ARG_NONE, NULL, OPT_ALL_FILES, "inventory all working copy files", NULL}, { NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -353,10 +352,6 @@ my_poptStuffArgFile(ctx(), utf8(string(argstr))); break; - case OPT_ALL_FILES: - app.set_all_files(true); - break; - case OPT_HELP: default: requested_help = true; --- monotone.texi +++ monotone.texi @@ -3651,63 +3651,6 @@ copy. Specifying only the pathname "." will restrict @command{status} to files changed within the current subdirectory of the working copy. address@hidden monotone inventory address@hidden monotone inventory @var{pathname...} - -This command prints the ``inventory'' of files in a working copy. Each -file is prefixed by two characters indicating the current status of the -file's path and associated data or contents. - -The first status character may be one of the following: address@hidden address@hidden ' ' the path is unchanged from the current manifest address@hidden '+' the path has been added to the current manifest address@hidden '-' the path has been dropped from the current manifest address@hidden '%' the path has been renamed in the current manifest, both the old and new name are listed address@hidden '?' the path is unknown, it exists in the working copy but not in the current manifest address@hidden '~' the path is ignored by the current ignore_file lua hook setting address@hidden itemize - -The second status character may be one of the following: address@hidden address@hidden ' ' the data is unchanged, its sha1 version matches the version in the base manifest address@hidden '#' the data is changed, its sha1 version differs from the version in the base manifest address@hidden '!' the data is missing and its sha1 version cannot be computed address@hidden itemize - -By default the @command{inventory} command lists only ``interesting'' -files, considered to be those with a status of missing, dropped, -renamed, added or changed. If the @option{--all-files} option is -specified the @command{inventory} command lists every file in the -working copy, including those with a status of unchanged, unknown and -ignored. - -Specifying optional @var{pathname...} arguments to the @command{inventory} -command restricts the set of changes that are visible and results in -only a partial inventory of the working copy. Changes to files not included -in the specified set of pathnames will be ignored. - -From within a subdirectory of the working copy the @command{inventory} -command will, by default, include @emph{all changes} in the working -copy. Specifying only the pathname "." will restrict @command{inventory} -to files changed within the current subdirectory of the working copy. - -If the @option{--all-files} option is specified the @command{inventory} -command will list all files in the working copy. However, the changes -that are will be restricted as described above. - -Renamed files have both the old and new name of the file listed on -the same line in the inventory, in that order. - -Since pathnames may contain spaces, quotes and other ``special'' -characters, the @command{inventory} command lists quoted filenames to -avoid any ambiguities. - -Full support for versioned directories is not yet complete and the address@hidden command will only list entries for renamed or -dropped directories. Directory entries are designated by pathnames -ending with the "/" character. - @item monotone log @itemx monotone log address@hidden @itemx monotone log @var{id} @@ -4819,6 +4762,80 @@ @end table address@hidden monotone automate inventory + address@hidden @strong address@hidden Arguments: + +None. + address@hidden Added in: + +0.2 + address@hidden Purpose: + +Prints the inventory of all files found in the current working copy +prefixed by 2 status code characters. + address@hidden Sample output: + address@hidden ++ "added-file" ++! "added-and-missing-file" +- "dropped-file" + # "edited-file" +% "file-before-rename" "file-after-rename" +%# "file-before-rename" "file-after-rename-and-edit" +~ "ignored-file" + ! "missing-file" + "unchanged-file" +? "unknown-file" address@hidden verbatim + address@hidden Output format: + +Each file is printed on its own line, prefixed by a two character status +code characters and a single space character. All filenames are quoted +with double quotes (") to support filenames containg spaces. Intervening +quotes are escaped with \". Directories are identified by paths ending +with '/' characters. Rename lines list the old name first, followed by +the new name. Lines are ordered by their pathname, with renames using +the new name is used for ordering. + +The first status character indicates the status of the path itsself and +may be one of the following: + address@hidden address@hidden ' ' the path is unchanged from the current manifest address@hidden '+' the path has been added to the current manifest address@hidden '-' the path has been dropped from the current manifest address@hidden '%' the path has been renamed in the current manifest, both the old and new name are listed address@hidden '?' the path is unknown, it exists in the working copy but not in the current manifest address@hidden '~' the path is ignored by the current ignore_file lua hook setting address@hidden itemize + +The second status character indicates the status of the data associated +witth the path and may be one of the following: + address@hidden address@hidden ' ' the data is unchanged, its sha1 version matches the version in the base manifest address@hidden '#' the data is changed, its sha1 version differs from the version in the base manifest address@hidden '!' the data is missing and its sha1 version cannot be computed address@hidden itemize + +Full support for versioned directories is not yet complete and the +inventory will only list entries for renamed or dropped +directories. Directory entries are designated by pathnames ending with +"/" characters. + address@hidden Error conditions: + +When executed from outside of a working copy directory, prints an error +message to stderr, and exits with status 1. + address@hidden table + @end ftable @page @@ -6168,10 +6185,6 @@ Show status of working copy. @comment TROFF INPUT: .TP address@hidden @b{inventory} @i{[...]} -Show inventory of files in working copy. address@hidden TROFF INPUT: .TP - @item @b{log} @i{[id]} Show historical log of revisions, starting from working copy base revision, or @i{[id]} if given. @@ -6348,7 +6361,7 @@ Serve contents of @i{} at network address @i{} @comment TROFF INPUT: .SH DESCRIPTION address@hidden @b{automate} @i{(interface_version|heads|descendents|erase_ancestors|toposort|ancestry_difference|leaves)} address@hidden @b{automate} @i{(interface_version|heads|descendents|erase_ancestors|toposort|ancestry_difference|leaves|inventory)} Scripting interface. @item @b{db} @i{(init|info|version|dump|load|migrate|execute )} @@ -6484,11 +6497,6 @@ @item @b{-@@} @i{} An alias for @address@hidden}. address@hidden @b{--all-files} -Include every file available in the working copy in the inventory -list. By default inventory only lists ``interesting'' files. This option -is specific to the @command{inventory} command. - @comment TROFF INPUT: .SH ENVIRONMENT @end table --- tests/t_automate_inventory.at +++ tests/t_automate_inventory.at @@ -40,24 +40,13 @@ AT_CHECK(MONOTONE rename original renamed, [], [ignore], [ignore]) AT_CHECK(MONOTONE drop dropped, [], [ignore], [ignore]) -# inventory by default only lists changed files +AT_CHECK(MONOTONE automate inventory --rcfile=inventory_hooks.lua, [], [stdout], [ignore]) -AT_CHECK(MONOTONE inventory, [], [stdout], [ignore]) - AT_CHECK(grep '^ ! "missing"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^+ "added"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^- "dropped"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^% "original" "renamed"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^ . "changed"' stdout, [], [ignore], [ignore]) - -AT_CHECK(grep '^ "unchanged"' stdout, [1], [ignore], [ignore]) -AT_CHECK(grep '^? "unknown"' stdout, [1], [ignore], [ignore]) -AT_CHECK(grep '^~ "ignored~"' stdout, [1], [ignore], [ignore]) - -# with --all-files they're all listed - -AT_CHECK(MONOTONE inventory --all-files --rcfile inventory_hooks.lua, [], [stdout], [ignore]) - AT_CHECK(grep '^ "unchanged"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^? "unknown"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^~ "ignored~"' stdout, [], [ignore], [ignore]) @@ -67,7 +56,7 @@ AT_DATA(renamed, [renamed and changed ]) -AT_CHECK(MONOTONE inventory, [], [stdout], [ignore]) +AT_CHECK(MONOTONE automate inventory, [], [stdout], [ignore]) AT_CHECK(grep '^%. "renamed"' stdout, [1], [ignore], [ignore]) AT_CHECK(grep '^% "original" "renamed"' stdout, [], [ignore], [ignore]) @@ -76,7 +65,7 @@ AT_CHECK(rm renamed added) -AT_CHECK(MONOTONE inventory, [], [stdout], [ignore]) +AT_CHECK(MONOTONE automate inventory, [], [stdout], [ignore]) AT_CHECK(grep '^+! "added"' stdout, [], [ignore], [ignore]) AT_CHECK(grep '^%! "original" "renamed"' stdout, [], [ignore], [ignore]) --- testsuite.at +++ testsuite.at @@ -578,7 +578,7 @@ m4_include(tests/t_multiple_heads_msg.at) m4_include(tests/t_diff_currev.at) m4_include(tests/t_normalized_filenames.at) -m4_include(tests/t_inventory.at) +m4_include(tests/t_automate_inventory.at) m4_include(tests/t_rename_file_to_dir.at) m4_include(tests/t_replace_file_with_dir.at) m4_include(tests/t_replace_dir_with_file.at)