# # # add_dir "tests/automate_inventory_ignore_dirs" # # add_dir "tests/automate_inventory_options" # # add_file "tests/automate_inventory_ignore_dirs/__driver__.lua" # content [717aff25d5a2f1e1c3f2643049b7098b6d6cecb6] # # add_file "tests/automate_inventory_ignore_dirs/expected.stderr" # content [41fc6d7fb22c6a3040b0ba0c7708be080a4a8716] # # add_file "tests/automate_inventory_ignore_dirs/expected.stdout" # content [ee97eb075d7fb94084672c6867355bd72728d9ef] # # add_file "tests/automate_inventory_ignore_dirs/local_hooks.lua" # content [e6cf0fd64140311801fb6ecc380cdeb7dfd3e1ac] # # add_file "tests/automate_inventory_options/__driver__.lua" # content [5c539535d0a426d63b22f02b1b656cf4a7a5cffe] # # add_file "tests/automate_inventory_options/expected-no-ignored.stdout" # content [519651efd5079bae0e0643a2e10047e8d1094558] # # add_file "tests/automate_inventory_options/expected-no-unchanged.stdout" # content [040cf70ac3fd8fd6a09810501ed95c99e7bb0326] # # add_file "tests/automate_inventory_options/expected-no-unknown.stdout" # content [b76cb34843c7a555d212e23db24ee4a7d65b823f] # # add_file "tests/automate_inventory_options/expected-none.stdout" # content [040fb4b496e6bc1231ba5708e8cc4aa2dc1e0d63] # # add_file "tests/automate_inventory_options/test_hooks.lua" # content [4c7ad3157746b50af10102b317498c574345d102] # # patch "NEWS" # from [18ccffe3a66a7d4dae075252b7bfb016a56f83dd] # to [bbd7c2a4e825e004d34f1189b4b9d6a7e11b6f1a] # # patch "automate.cc" # from [fa24428de48ae21e3a4cd877ac6af11055383399] # to [0e3aa435aad9e048ed08f99e8ebd06c6c8e2ba9e] # # patch "cmd_automate.cc" # from [f507718f94531c96f86f38ec3582d7892b802136] # to [7f01ad421e5ccecc31a96ddff55a04805ba7c664] # # patch "monotone.texi" # from [ddc19be794612fe7621f8dff0c543a9da4e7b0c1] # to [18c88ece2c63a353b110b9ad15d7acf32021d4eb] # # patch "options_list.hh" # from [e0359c1c2454708b66f9d7e6e613dc44953e1766] # to [185432e32dc44b93821c965cd658d4de5354c1bb] # ============================================================ --- tests/automate_inventory_ignore_dirs/__driver__.lua 717aff25d5a2f1e1c3f2643049b7098b6d6cecb6 +++ tests/automate_inventory_ignore_dirs/__driver__.lua 717aff25d5a2f1e1c3f2643049b7098b6d6cecb6 @@ -0,0 +1,34 @@ +-- Test that 'automate inventory' properly ignores directories given in .mtn_ignore + +mtn_setup() + +check(get("local_hooks.lua")) +check(get("expected.stderr")) +check(get("expected.stdout")) + +include ("common/test_utils_inventory.lua") + +---------- +-- The local local_hooks.lua defines ignore_file to ignore 'ignored' +-- directory, 'source/ignored_1' file. It also writes the name of each +-- file checked to stderr. So we check to see that it does _not_ write +-- the names of the files in the ignored directory. + +mkdir ("source") +addfile("source/source_1", "source_1") +addfile("source/source_2", "source_2") +writefile("source/ignored_1", "source ignored_1") + +mkdir ("source/ignored_dir") +writefile ("source/ignored_dir/file_1", "ignored file 1") +writefile ("source/ignored_dir/file_2", "ignored file 2") + +check(mtn("automate", "inventory", "--rcfile=local_hooks.lua", "source"), 0, true, false) + +canonicalize("stdout") +canonicalize("ts-stderr") + +check (readfile("expected.stderr") == readfile("ts-stderr")) +check (readfile("expected.stdout") == readfile("stdout")) + +-- end of file ============================================================ --- tests/automate_inventory_ignore_dirs/expected.stderr 41fc6d7fb22c6a3040b0ba0c7708be080a4a8716 +++ tests/automate_inventory_ignore_dirs/expected.stderr 41fc6d7fb22c6a3040b0ba0c7708be080a4a8716 @@ -0,0 +1,5 @@ +ignore_file: 'keys': +ignore_file: 'source': +ignore_file: 'source/ignored_dir': +ignore_file: 'source/ignored_1': +ignore_file: 'source/ignored_dir': ============================================================ --- tests/automate_inventory_ignore_dirs/expected.stdout ee97eb075d7fb94084672c6867355bd72728d9ef +++ tests/automate_inventory_ignore_dirs/expected.stdout ee97eb075d7fb94084672c6867355bd72728d9ef @@ -0,0 +1,24 @@ + path "source" +new_type "directory" + fs_type "directory" + status "added" "known" + + path "source/ignored_1" +fs_type "file" + status "ignored" + + path "source/ignored_dir" +fs_type "directory" + status "ignored" + + path "source/source_1" +new_type "file" + fs_type "file" + status "added" "known" + changes "content" + + path "source/source_2" +new_type "file" + fs_type "file" + status "added" "known" + changes "content" ============================================================ --- tests/automate_inventory_ignore_dirs/local_hooks.lua e6cf0fd64140311801fb6ecc380cdeb7dfd3e1ac +++ tests/automate_inventory_ignore_dirs/local_hooks.lua e6cf0fd64140311801fb6ecc380cdeb7dfd3e1ac @@ -0,0 +1,7 @@ +function ignore_file(name) + io.stderr:write("ignore_file: '" .. name .. "':\n") + + if (name == "source/ignored_dir") then return true end + if (name == "source/ignored_1") then return true end + return false +end ============================================================ --- tests/automate_inventory_options/__driver__.lua 5c539535d0a426d63b22f02b1b656cf4a7a5cffe +++ tests/automate_inventory_options/__driver__.lua 5c539535d0a426d63b22f02b1b656cf4a7a5cffe @@ -0,0 +1,46 @@ +-- Test 'automate inventory' options --ignored=false, --unchanged=false, --unknown=false + +mtn_setup() + +-- override standard test_hooks.lua, because 'automate stdio' uses it. +check(get("test_hooks.lua")) + +check(get("expected-none.stdout")) +check(get("expected-no-ignored.stdout")) +check(get("expected-no-unknown.stdout")) +check(get("expected-no-unchanged.stdout")) + +include ("common/test_utils_inventory.lua") + +mkdir ("source") +addfile("source/source_1", "source_1") +addfile("source/source_2", "source_2") +commit() + +writefile("source/ignored_1", "ignored_1") +writefile("source/unknown_1", "unknown_1") +writefile ("source/source_2", "source_2 changed") + +-- First with no options +check(mtn("automate", "inventory", "source"), 0, true, false) +canonicalize("stdout") +check (readfile("expected-none.stdout") == readfile("stdout")) + +check(mtn("automate", "inventory", "source", "--no-ignored"), 0, true, false) +canonicalize("stdout") +check (readfile("expected-no-ignored.stdout") == readfile("stdout")) + +-- make sure 'automate stdio' handles inventory options +check(mtn("automate", "stdio"), 0, true, false, "o10:no-ignored0:e l9:inventory6:sourcee") +canonicalize("stdout") +check (("0:0:l:364:" .. readfile("expected-no-ignored.stdout")) == readfile("stdout")) + +check(mtn("automate", "inventory", "source", "--no-unknown"), 0, true, false) +canonicalize("stdout") +check (readfile("expected-no-unknown.stdout") == readfile("stdout")) + +check(mtn("automate", "inventory", "source", "--no-unchanged"), 0, true, false) +canonicalize("stdout") +check (readfile("expected-no-unchanged.stdout") == readfile("stdout")) + +-- end of file ============================================================ --- tests/automate_inventory_options/expected-no-ignored.stdout 519651efd5079bae0e0643a2e10047e8d1094558 +++ tests/automate_inventory_options/expected-no-ignored.stdout 519651efd5079bae0e0643a2e10047e8d1094558 @@ -0,0 +1,22 @@ + path "source" +old_type "directory" +new_type "directory" + fs_type "directory" + status "known" + + path "source/source_1" +old_type "file" +new_type "file" + fs_type "file" + status "known" + + path "source/source_2" +old_type "file" +new_type "file" + fs_type "file" + status "known" + changes "content" + + path "source/unknown_1" +fs_type "file" + status "unknown" ============================================================ --- tests/automate_inventory_options/expected-no-unchanged.stdout 040cf70ac3fd8fd6a09810501ed95c99e7bb0326 +++ tests/automate_inventory_options/expected-no-unchanged.stdout 040cf70ac3fd8fd6a09810501ed95c99e7bb0326 @@ -0,0 +1,14 @@ + path "source/ignored_1" +fs_type "file" + status "ignored" + + path "source/source_2" +old_type "file" +new_type "file" + fs_type "file" + status "known" + changes "content" + + path "source/unknown_1" +fs_type "file" + status "unknown" ============================================================ --- tests/automate_inventory_options/expected-no-unknown.stdout b76cb34843c7a555d212e23db24ee4a7d65b823f +++ tests/automate_inventory_options/expected-no-unknown.stdout b76cb34843c7a555d212e23db24ee4a7d65b823f @@ -0,0 +1,22 @@ + path "source" +old_type "directory" +new_type "directory" + fs_type "directory" + status "known" + + path "source/ignored_1" +fs_type "file" + status "ignored" + + path "source/source_1" +old_type "file" +new_type "file" + fs_type "file" + status "known" + + path "source/source_2" +old_type "file" +new_type "file" + fs_type "file" + status "known" + changes "content" ============================================================ --- tests/automate_inventory_options/expected-none.stdout 040fb4b496e6bc1231ba5708e8cc4aa2dc1e0d63 +++ tests/automate_inventory_options/expected-none.stdout 040fb4b496e6bc1231ba5708e8cc4aa2dc1e0d63 @@ -0,0 +1,26 @@ + path "source" +old_type "directory" +new_type "directory" + fs_type "directory" + status "known" + + path "source/ignored_1" +fs_type "file" + status "ignored" + + path "source/source_1" +old_type "file" +new_type "file" + fs_type "file" + status "known" + + path "source/source_2" +old_type "file" +new_type "file" + fs_type "file" + status "known" + changes "content" + + path "source/unknown_1" +fs_type "file" + status "unknown" ============================================================ --- tests/automate_inventory_options/test_hooks.lua 4c7ad3157746b50af10102b317498c574345d102 +++ tests/automate_inventory_options/test_hooks.lua 4c7ad3157746b50af10102b317498c574345d102 @@ -0,0 +1,7 @@ +function ignore_file(name) + if (name == "source/ignored_1") then return true end + return false +end +function get_passphrase(keyid) + return keyid +end ============================================================ --- NEWS 18ccffe3a66a7d4dae075252b7bfb016a56f83dd +++ NEWS bbd7c2a4e825e004d34f1189b4b9d6a7e11b6f1a @@ -29,6 +29,11 @@ - 'automate drop_db_variables' which drops one database variable (like the 'unset' command) or all variables within a given domain. + - 'automate inventory' now accepts options '--no-ignored', + '--no-unknown', '--no-unchanged'. In addition, it no longer + recurses into ignored directories. The typical case of + listing files that need attention now runs at least four + times faster. Wed Dec 12 21:21:15 UTC 2007 ============================================================ --- automate.cc fa24428de48ae21e3a4cd877ac6af11055383399 +++ automate.cc 0e3aa435aad9e048ed08f99e8ebd06c6c8e2ba9e @@ -1,4 +1,5 @@ // Copyright (C) 2004, 2007 Nathaniel Smith +// Copyright (C) 2007 - 2008 Stephen Leake // // This program is made available under the GNU GPL version 2.0 or // greater. See the accompanying file COPYING for details. @@ -656,8 +657,8 @@ inventory_itemizer::visit_dir(file_path { inventory[path].fs_type = path::directory; } - // always recurse into subdirectories - return true; + // don't recurse into ignored subdirectories + return not app.lua.hook_ignore_file(path); } void @@ -712,10 +713,15 @@ inventory_print_states(app_state & app, static void inventory_print_states(app_state & app, file_path const & fs_path, inventory_item const & item, roster_t const & old_roster, - roster_t const & new_roster, basic_io::stanza & st) + roster_t const & new_roster, basic_io::stanza & st, + bool & ignored, bool & unknown, bool & unchanged) { std::vector states; + ignored = false; + unknown = false; + unchanged = false; + // if both nodes exist, the only interesting case is // when the node ids aren't equal (so we have different nodes // with one and the same path in the old and the new roster) @@ -763,14 +769,23 @@ inventory_print_states(app_state & app, if (!item.new_node.exists) { if (app.lua.hook_ignore_file(fs_path)) - states.push_back("ignored"); + { + states.push_back("ignored"); + ignored = true; + } else - states.push_back("unknown"); + { + states.push_back("unknown"); + unknown = true; + } } else if (item.new_node.type != item.fs_type) states.push_back("invalid"); else - states.push_back("known"); + { + states.push_back("known"); + unchanged = true; + } } st.push_str_multi(syms::status, states); @@ -778,11 +793,12 @@ inventory_print_changes(inventory_item c static void inventory_print_changes(inventory_item const & item, roster_t const & old_roster, - basic_io::stanza & st) + basic_io::stanza & st, bool & unchanged) { // old nodes do not have any recorded content changes and attributes, // so we can't print anything for them here - if (!item.new_node.exists) return; + if (!item.new_node.exists) + return; std::vector changes; @@ -832,7 +848,10 @@ inventory_print_changes(inventory_item c } if (!changes.empty()) - st.push_str_multi(syms::changes, changes); + { + st.push_str_multi(syms::changes, changes); + unchanged = false; + } } // Name: inventory @@ -851,7 +870,11 @@ CMD_AUTOMATE(inventory, N_("[PATH]...") CMD_AUTOMATE(inventory, N_("[PATH]..."), N_("Prints a summary of files found in the workspace"), "", - options::opts::depth | options::opts::exclude) + options::opts::depth | + options::opts::exclude | + options::opts::no_ignored | + options::opts::no_unknown | + options::opts::no_unchanged) { app.require_workspace(); @@ -883,6 +906,7 @@ CMD_AUTOMATE(inventory, N_("[PATH]...") for (inventory_map::const_iterator i = inventory.begin(); i != inventory.end(); ++i) { + bool print_this, ignored, unknown, unchanged; basic_io::stanza st; inventory_item const & item = i->second; @@ -922,10 +946,22 @@ CMD_AUTOMATE(inventory, N_("[PATH]...") case path::nonexistent: st.push_str_pair(syms::fs_type, "none"); break; } - inventory_print_states(app, i->first, item, old_roster, new_roster, st); - inventory_print_changes(item, old_roster, st); + inventory_print_states(app, i->first, item, old_roster, new_roster, st, ignored, unknown, unchanged); + inventory_print_changes(item, old_roster, st, unchanged); - pr.print_stanza(st); + print_this = true; + + if (ignored && app.opts.no_ignored) + print_this = false; + + if (unknown && app.opts.no_unknown) + print_this = false; + + if (unchanged && app.opts.no_unchanged) + print_this = false; + + if (print_this) + pr.print_stanza(st); } output.write(pr.buf.data(), pr.buf.size()); ============================================================ --- cmd_automate.cc f507718f94531c96f86f38ec3582d7892b802136 +++ cmd_automate.cc 7f01ad421e5ccecc31a96ddff55a04805ba7c664 @@ -62,7 +62,7 @@ namespace commands { } } -static string const interface_version = "7.0"; +static string const interface_version = "7.1"; // Name: interface_version // Arguments: none ============================================================ --- monotone.texi ddc19be794612fe7621f8dff0c543a9da4e7b0c1 +++ monotone.texi 18c88ece2c63a353b110b9ad15d7acf32021d4eb @@ -33,7 +33,7 @@ Copyright @copyright{} 2006 Jeronimo Pellegrini @* Copyright @copyright{} 2006 Alex Queiroz @* Copyright @copyright{} 2006, 2007 William Uther @* -Copyright @copyright{} 2007 Stephen Leake @* +Copyright @copyright{} 2007, 2008 Stephen Leake @* This manual is made available under the GNU GPL version 2.0 or greater. See the accompanying file COPYING for details. @@ -41,7 +41,7 @@ @end titlepage @ifnottex address@hidden Top address@hidden Top, Concepts, (dir), (dir) @top Top Monotone is a distributed version control tool. It can help automate @@ -68,15 +68,15 @@ @top Top @end ifnottex @menu -* Concepts:: Taxonomy of monotone -* Tutorial:: A detailed example of using monotone -* Advanced Uses:: Going beyond the basics -* CVS Phrasebook:: Transitional guide for CVS users -* Command Reference:: Details of each monotone command -* Hook Reference:: Functions which extend monotone -* Special Topics:: Extra explanations and details -* Default hooks:: The standard hook definitions -* General Index:: Index of concepts and functions +* Concepts:: Taxonomy of monotone +* Tutorial:: A detailed example of using monotone +* Advanced Uses:: Going beyond the basics +* CVS Phrasebook:: Transitional guide for CVS users +* Command Reference:: Details of each monotone command +* Hook Reference:: Functions which extend monotone +* Special Topics:: Extra explanations and details +* Default hooks:: The standard hook definitions +* General Index:: Index of concepts and functions @end menu @ifnottex @@ -85,7 +85,7 @@ @top Top @contents address@hidden Concepts address@hidden Concepts, Tutorial, Top, Top @chapter Concepts This chapter should familiarize you with the concepts, terminology, @@ -94,17 +94,17 @@ @chapter Concepts with these terms. @menu -* Versions of files:: Tracking changes to single files -* Versions of trees:: Tracking changes to collections of files -* Historical records:: Tracking the history of changes -* Certificates:: Tracking extended information -* Storage and workflow:: Saving, sending, and receiving changes -* Forks and merges:: Managing divergence of code -* Branches:: Intentional divergence and automatic merging +* Versions of files:: Tracking changes to single files +* Versions of trees:: Tracking changes to collections of files +* Historical records:: Tracking the history of changes +* Certificates:: Tracking extended information +* Storage and workflow:: Saving, sending, and receiving changes +* Forks and merges:: Managing divergence of code +* Branches:: Intentional divergence and automatic merging @end menu @page address@hidden Versions of files address@hidden Versions of files, Versions of trees, Concepts, Concepts @section Versions of files Suppose you wish to modify a file @file{file.txt} on your @@ -282,7 +282,7 @@ @section Versions of files @end ifnotinfo @page address@hidden Versions of trees address@hidden Versions of trees, Historical records, Versions of files, Concepts @section Versions of trees After you have made many different files, you may wish to capture a @@ -396,7 +396,7 @@ @section Versions of trees manifests; when necessary it stores complete versions of manifests. @page address@hidden Historical records address@hidden Historical records, Certificates, Versions of trees, Concepts @section Historical records Suppose you sit down to edit some files. Before you start working, you @@ -522,7 +522,7 @@ @section Historical records @end ifnotinfo @page address@hidden Certificates address@hidden Certificates, Storage and workflow, Historical records, Concepts @section Certificates Often, you will wish to make a @i{statement} about a revision, such as @@ -623,7 +623,7 @@ @section Certificates secure key exchange techniques are beyond the scope of this document. @page address@hidden Storage and workflow address@hidden Storage and workflow, Forks and merges, Certificates, Concepts @section Storage and workflow Monotone moves information in and out of four different types of @@ -812,7 +812,7 @@ @section Storage and workflow implied in communication. @page address@hidden Forks and merges address@hidden Forks and merges, Branches, Storage and workflow, Concepts @section Forks and merges So far we have been talking about revisions as though each logically @@ -907,7 +907,7 @@ @section Forks and merges @end ifnotinfo @page address@hidden Branches address@hidden Branches, , Forks and merges, Concepts @section Branches Sometimes, people intentionally produce forks which are @emph{not @@ -1060,7 +1060,7 @@ @subsection Branch Names (For more information, see @ref{Naming Conventions}.) @page address@hidden Tutorial address@hidden Tutorial, Advanced Uses, Concepts, Top @chapter Tutorial This chapter illustrates the basic uses of monotone by means of an @@ -1146,7 +1146,7 @@ @section The Fictional Project @page address@hidden Creating a Database address@hidden Creating a Database, Generating Keys, Tutorial, Tutorial @section Creating a Database The first step Jim, Abe and Beth each need to perform is to create a @@ -1189,7 +1189,7 @@ @section Creating a Database @end smallexample @page address@hidden Generating Keys address@hidden Generating Keys, Starting a New Project, Creating a Database, Tutorial @section Generating Keys Now Jim, Abe and Beth must each generate an @sc{rsa} key pair for @@ -1326,7 +1326,7 @@ @section Generating Keys Abe and Beth do the same, with their secret passphrases. @page address@hidden Starting a New Project address@hidden Starting a New Project, Adding Files, Generating Keys, Tutorial @section Starting a New Project Before he can begin work on the project, Jim needs to create a @@ -1364,7 +1364,7 @@ @section Starting a New Project directories. @page address@hidden Adding Files address@hidden Adding Files, Committing Work, Starting a New Project, Tutorial @section Adding Files Next Jim decides to add some files to the project. He writes up @@ -1537,7 +1537,7 @@ @section Adding Files @end smallexample @page address@hidden Committing Work address@hidden Committing Work, Basic Network Service, Adding Files, Tutorial @section Committing Work Satisfied with the work he's done, Jim wants to save his changes. He @@ -1636,7 +1636,7 @@ @section Committing Work yet, it has no descendants. @page address@hidden Basic Network Service address@hidden Basic Network Service, Synchronising Databases, Committing Work, Tutorial @section Basic Network Service Jim now decides he will make his base revision available to his @@ -1734,7 +1734,7 @@ @section Basic Network Service his laptop on the default port 4691, serving everything in his database. @page address@hidden Synchronising Databases address@hidden Synchronising Databases, Making Changes, Basic Network Service, Tutorial @section Synchronising Databases With Jim's server preparations done, now Abe is ready to fetch Jim's @@ -1783,7 +1783,7 @@ @section Synchronising Databases little later as the project grows. @page address@hidden Making Changes address@hidden Making Changes, Dealing with a Fork, Synchronising Databases, Tutorial @section Making Changes Abe decides to do some work on his part of the code. He has a copy of @@ -1988,7 +1988,7 @@ @section Making Changes @end smallexample @page address@hidden Dealing with a Fork address@hidden Dealing with a Fork, Branching and Merging, Making Changes, Tutorial @section Dealing with a Fork Careful readers will note that, in the previous section, the JuiceBot @@ -2216,7 +2216,7 @@ @section Dealing with a Fork testing). @page address@hidden Branching and Merging address@hidden Branching and Merging, Network Service Revisited, Dealing with a Fork, Tutorial @section Branching and Merging So by now you're familiar with making changes, sharing them with other @@ -2333,7 +2333,7 @@ @section Branching and Merging @end smallexample @page address@hidden Network Service Revisited address@hidden Network Service Revisited, , Branching and Merging, Tutorial @section Network Service Revisited Up until now, Jim has been using his laptop and database as a sort of @@ -2590,7 +2590,7 @@ @section Network Service Revisited content arrived in your database. @end itemize address@hidden Advanced Uses address@hidden Advanced Uses, CVS Phrasebook, Tutorial, Top @chapter Advanced Uses This chapter covers slightly less common aspects of using @@ -2600,26 +2600,26 @@ @chapter Advanced Uses familiarize yourself with its operation. @menu -* Other Transports:: Using netsync over SSH, or other transports. -* Selectors:: Selecting revisions by certificate. -* Restrictions:: Limit workspace changes to specified files. -* Scripting:: Running monotone from other programs. -* Inodeprints:: Trading off safety for speed in your workspace. -* Workspace Collisions:: Workspace files that collide with new versioned files. -* Quality Assurance:: Integrating testing and review with development. -* Vars:: Simple per-database configuration information. -* Reserved Files:: File names with special meanings. -* Reserved Certs:: Certificate names with special meanings. -* Naming Conventions:: Choosing appropriate names for keys and branches. -* File Attributes:: Marking files as executable, or other attributes. -* Merging:: Merging with external tools, handling binary files. -* Migrating and Dumping:: Changing the underlying storage system. -* Importing from CVS:: Building a monotone database from a CVS repository. -* Using packets:: Transferring data ``by hand''. +* Other Transports:: Using netsync over SSH, or other transports. +* Selectors:: Selecting revisions by certificate. +* Restrictions:: Limit workspace changes to specified files. +* Scripting:: Running monotone from other programs. +* Inodeprints:: Trading off safety for speed in your workspace. +* Workspace Collisions:: Workspace files that collide with new versioned files. +* Quality Assurance:: Integrating testing and review with development. +* Vars:: Simple per-database configuration information. +* Reserved Files:: File names with special meanings. +* Reserved Certs:: Certificate names with special meanings. +* Naming Conventions:: Choosing appropriate names for keys and branches. +* File Attributes:: Marking files as executable, or other attributes. +* Merging:: Merging with external tools, handling binary files. +* Migrating and Dumping:: Changing the underlying storage system. +* Importing from CVS:: Building a monotone database from a CVS repository. +* Using packets:: Transferring data ``by hand''. @end menu @page address@hidden Other Transports address@hidden Other Transports, Selectors, Advanced Uses, Advanced Uses @section Other Transports Monotone's database synchronization system is based on a protocol @@ -2678,7 +2678,7 @@ @section Other Transports @ref{Netsync Transport Hooks}. @page address@hidden Selectors address@hidden Selectors, Restrictions, Other Transports, Advanced Uses @section Selectors Revisions can be specified on the monotone command line, precisely, by @@ -2845,7 +2845,7 @@ @heading Typeless selection is just as effective as specifying @code{a:graydon}. @page address@hidden Restrictions address@hidden Restrictions, Scripting, Selectors, Advanced Uses @section Restrictions Several monotone commands accept optional @var{pathname...} arguments in @@ -2936,7 +2936,7 @@ @heading Finding a workspace @page address@hidden Scripting address@hidden Scripting, Inodeprints, Restrictions, Advanced Uses @section Scripting People often want to write programs that call monotone --- for example, @@ -2961,7 +2961,7 @@ @section Scripting For details of this interface, see @ref{Automation}. @page address@hidden Inodeprints address@hidden Inodeprints, Workspace Collisions, Scripting, Advanced Uses @section Inodeprints Fairly often, in order to accomplish its job, monotone has to look at @@ -2998,7 +2998,7 @@ @section Inodeprints workspaces you create. See @ref{Hook Reference} for details. @page address@hidden Workspace Collisions address@hidden Workspace Collisions, Quality Assurance, Inodeprints, Advanced Uses @section Workspace Collisions Sometimes when you work on a project, several people make similar @@ -3092,7 +3092,7 @@ @section Workspace Collisions @command{revert}). @page address@hidden Quality Assurance address@hidden Quality Assurance, Vars, Workspace Collisions, Advanced Uses @section Quality Assurance Monotone was constructed to serve both as a version control tool and @@ -3152,7 +3152,7 @@ @section Quality Assurance For details on these hooks, see the @ref{Hook Reference}. @page address@hidden Vars address@hidden Vars, Reserved Files, Quality Assurance, Advanced Uses @section Vars Every monotone database has a set of @emph{vars} associated with it. @@ -3211,7 +3211,7 @@ @heading Existing vars @end table @page address@hidden Reserved Files address@hidden Reserved Files, Reserved Certs, Vars, Advanced Uses @section Reserved Files A monotone workspace consists of control files and non-control @@ -3304,7 +3304,7 @@ @heading Existing control files @page address@hidden Reserved Certs address@hidden Reserved Certs, Naming Conventions, Reserved Files, Advanced Uses @section Reserved Certs Every certificate has a name. Some names have meaning which is built @@ -3386,7 +3386,7 @@ @section Reserved Certs @end table @page address@hidden Naming Conventions address@hidden Naming Conventions, File Attributes, Reserved Certs, Advanced Uses @section Naming Conventions Some names in monotone are private to your work, such as @@ -3417,7 +3417,7 @@ @section Naming Conventions @end itemize @page address@hidden File Attributes address@hidden File Attributes, Merging, Naming Conventions, Advanced Uses @section File Attributes Monotone contains a support for storing @dfn{persistent attributes} on @@ -3465,7 +3465,7 @@ @section File Attributes reserved for monotone's own use. @page address@hidden Merging address@hidden Merging, Migrating and Dumping, File Attributes, Advanced Uses @section Merging Monotone has two merging modes, controlled by the @code{manual_merge} @@ -3506,7 +3506,7 @@ @section Merging the files to be merged has the @code{manual_merge} attribute set. @page address@hidden Migrating and Dumping address@hidden Migrating and Dumping, Importing from CVS, Merging, Advanced Uses @section Migrating and Dumping While the state of your database is logically captured in terms of a @@ -3544,7 +3544,7 @@ @section Migrating and Dumping @command{init} your database before a @command{load}. @page address@hidden Importing from CVS address@hidden Importing from CVS, Using packets, Migrating and Dumping, Advanced Uses @section Importing from CVS Monotone is capable of reading CVS files directly and importing them @@ -3588,7 +3588,7 @@ @section Importing from CVS @end smallexample @page address@hidden Using packets address@hidden Using packets, , Importing from CVS, Advanced Uses @section Using packets Suppose you made changes to your database, and want to send those @@ -3779,7 +3779,7 @@ @section Using packets @page address@hidden CVS Phrasebook address@hidden CVS Phrasebook, Command Reference, Advanced Uses, Top @chapter CVS Phrasebook This chapter translates common CVS commands into monotone commands. It @@ -4127,28 +4127,28 @@ @heading Initializing a Repository users. address@hidden Command Reference address@hidden Command Reference, Hook Reference, CVS Phrasebook, Top @chapter Command Reference Monotone has a large number of commands. To help navigate through them all, commands are grouped into logical categories. @menu -* Tree:: Operations on tree states in your database -* Workspace:: Operations on your workspace -* Network:: Communication with the network -* Informative:: Production of descriptive reports -* Key and Cert Trust:: Keys and Trust Evaluations based on them -* Certificate:: Creation of certificates -* Packet I/O:: Production or consumption of packets -* Database:: Manipulation of your database as a whole -* Automation:: Running monotone from other programs -* RCS:: Importing legacy version control files +* Tree:: Operations on tree states in your database +* Workspace:: Operations on your workspace +* Network:: Communication with the network +* Informative:: Production of descriptive reports +* Key and Cert Trust:: Keys and Trust Evaluations based on them +* Certificate:: Creation of certificates +* Packet I/O:: Production or consumption of packets +* Database:: Manipulation of your database as a whole +* Automation:: Running monotone from other programs +* RCS:: Importing legacy version control files @end menu @page address@hidden Tree address@hidden Tree, Workspace, Command Reference, Command Reference @section Tree @ftable @command @@ -4321,7 +4321,7 @@ @section Tree @page address@hidden Workspace address@hidden Workspace, Network, Tree, Command Reference @section Workspace @ftable @command @@ -4637,7 +4637,7 @@ @section Workspace @end ftable @page address@hidden Network address@hidden Network, Informative, Workspace, Command Reference @section Network @ftable @command @@ -4749,7 +4749,7 @@ @section Network @page address@hidden Informative address@hidden Informative, Key and Cert Trust, Network, Command Reference @section Informative @ftable @command @@ -5125,7 +5125,7 @@ @section Informative @page address@hidden Key and Cert Trust address@hidden Key and Cert Trust, Certificate, Informative, Command Reference @section Key and Cert Trust @ftable @command @@ -5242,7 +5242,7 @@ @section Key and Cert Trust @page address@hidden Certificate address@hidden Certificate, Packet I/O, Key and Cert Trust, Command Reference @section Certificate @ftable @command @@ -5299,7 +5299,7 @@ @section Certificate @page address@hidden Packet I/O address@hidden Packet I/O, Database, Certificate, Command Reference @section Packet I/O Monotone can produce and consume data in a convenient, portable form @@ -5359,7 +5359,7 @@ @section Packet I/O @page address@hidden Database address@hidden Database, Automation, Packet I/O, Command Reference @section Database @ftable @command @@ -5624,7 +5624,7 @@ @section Database @page address@hidden Automation address@hidden Automation, RCS, Database, Command Reference @section Automation This section contains subcommands of the @command{mtn automate} command, @@ -6336,24 +6336,42 @@ @section Automation @end table address@hidden mtn automate inventory address@hidden address@hidden mtn automate inventory [options]... address@hidden @table @strong @item Arguments: One or more file paths (optional). If present, only show inventory for the given -files or directories (and their sub-directories). You can use @option{--depth} -and @option{--exclude} to control what is selected through this restriction. +files or directories (and their sub-directories). address@hidden @option address@hidden address@hidden +Maximum number of directories to descend. + address@hidden address@hidden +File or directory to exclude. + address@hidden --no-ignored +Don't output ignored files or directories. + address@hidden --no-unknown +Don't output unknown directories. + address@hidden --no-unchanged +Don't output files that are known but not changed in any way. + address@hidden table + @item Changes: @itemize @item +7.1 -- added options '--no-ignored', '--no-unknown', '--no-unchanged' address@hidden 6.0 -- converted to basic_io format (restriction support, various fixes) @item 1.0 -- initial, line-based format @end itemize address@hidden FIXME: check this number when merge to main branch @item Purpose: @@ -6813,7 +6831,8 @@ @section Automation provided as 'l' [ ...] 'e', where = colon . This may optionally be preceded by a set of key=value pairs (command options) as 'o' [ ...] 'e', where -strings come in pairs, key followed by value. +strings come in pairs, key followed by value. For flag options that +don't take values, specify the second string as zero length; @code{0:}. The space between the ending 'e' of one group of strings and the beginning 'l' or 'o' of the next is reserved. Any characters other than whitespace @@ -8068,7 +8087,7 @@ @section Automation @end ftable @page address@hidden RCS address@hidden RCS, , Automation, Command Reference @section RCS @ftable @command @@ -8098,7 +8117,7 @@ @section RCS @end ftable address@hidden Hook Reference address@hidden Hook Reference, Special Topics, Command Reference, Top @chapter Hook Reference Monotone's behavior can be customized and extended by writing @@ -8152,7 +8171,7 @@ @chapter Hook Reference @end menu @page address@hidden Hooks address@hidden Hooks, Additional Lua Functions, Hook Reference, Hook Reference @section Hooks This section documents the existing hook functions and their default @@ -9050,7 +9069,7 @@ @subsection Validation Hooks @end ftable @page address@hidden Additional Lua Functions address@hidden Additional Lua Functions, , Hooks, Hook Reference @section Additional Lua Functions This section documents the additional Lua functions made available to @@ -9261,7 +9280,7 @@ @section Additional Lua Functions @end ftable address@hidden Special Topics address@hidden Special Topics, Default hooks, Hook Reference, Top @chapter Special Topics This chapter describes some ``special'' issues which are not directly @@ -9279,7 +9298,7 @@ @chapter Special Topics @end menu @page address@hidden Internationalization address@hidden Internationalization, Hash Integrity, Special Topics, Special Topics @section Internationalization Monotone initially dealt with only ASCII characters, in file path @@ -9509,7 +9528,7 @@ @heading Packets @end itemize @page address@hidden Hash Integrity address@hidden Hash Integrity, Rebuilding ancestry, Internationalization, Special Topics @section Hash Integrity Some proponents of a competing, proprietary version control system @@ -9656,7 +9675,7 @@ @subheading Collision attacks relatively simple to change it to use some other algorithm. @page address@hidden Rebuilding ancestry address@hidden Rebuilding ancestry, Mark-Merge, Hash Integrity, Special Topics @section Rebuilding ancestry As described in @ref{Historical records}, monotone revisions contain the @@ -9787,7 +9806,7 @@ @heading Best practices never happen at all. But this way we're prepared. @page address@hidden Mark-Merge address@hidden Mark-Merge, Regexps, Rebuilding ancestry, Special Topics @section Mark-Merge Monotone makes use of the Mark-Merge (also known as *-merge) algorithm. @@ -10604,7 +10623,7 @@ @subheading More on "mark-merge" Replies and further discussion concerning this email can be found in the @uref{http://thread.gmane.org/gmane.comp.version-control.revctrl/92, monotone-devel archives}. address@hidden Regexps address@hidden Regexps, , Mark-Merge, Special Topics @section Regular Expression Syntax Monotone expects user-provided regular expressions in @@ -10623,7 +10642,7 @@ @section Regular Expression Syntax @include pcre/pcresyntax.texi @include pcre/pcrepattern.texi address@hidden Default hooks address@hidden Default hooks, General Index, Special Topics, Top @appendix Default hooks This section contains the entire source code of the standard hook file, @@ -10633,7 +10652,7 @@ @appendix Default hooks @verbatiminclude std_hooks.lua address@hidden General Index address@hidden General Index, , Default hooks, Top @unnumbered General Index @printindex cp ============================================================ --- options_list.hh e0359c1c2454708b66f9d7e6e613dc44953e1766 +++ options_list.hh 185432e32dc44b93821c965cd658d4de5354c1bb @@ -396,7 +396,7 @@ GOPT(nostd, "nostd", bool, false, nostd = true; } #endif - + OPT(pidfile, "pid-file", system_path, , gettext_noop("record process id of server")) #ifdef option_bodies @@ -528,7 +528,36 @@ OPTION(globals, xargs, true, "xargs,@", } #endif +OPTSET(automate_inventory_opts) +// These options take arguments, so they can be used with automate stdio. +OPTVAR(automate_inventory_opts, bool, no_ignored, false) +OPTVAR(automate_inventory_opts, bool, no_unknown, false) +OPTVAR(automate_inventory_opts, bool, no_unchanged, false) +OPTION(automate_inventory_opts, no_ignored, false, "no-ignored", + gettext_noop("don't output ignored files")) +#ifdef option_bodies +{ + no_ignored = true; +} +#endif + +OPTION(automate_inventory_opts, no_unknown, false, "no-unknown", + gettext_noop("don't output unknown files")) +#ifdef option_bodies +{ + no_unknown = true; +} +#endif + +OPTION(automate_inventory_opts, no_unchanged, false, "no-unchanged", + gettext_noop("don't output unchanged files")) +#ifdef option_bodies +{ + no_unchanged = true; +} +#endif + // Local Variables: // mode: C++ // fill-column: 76