# # patch "ChangeLog" # from [1746ee4a9f2425a09003fbc4c9d16f25c44640e4] # to [4f5d38c23ff44435d5657bcdcc9ccb93f7976e09] # # patch "app_state.cc" # from [ba628f813899ea30aee581c7435d93b6549d1890] # to [7c12ea6894df8aed4ac689b333df2f5dc19e3fd4] # # patch "app_state.hh" # from [3266667ef8e90abd725cb10983bbe1601c5d2c9f] # to [3ac03fa785dd39a9c005a7a35ad1962468d5be32] # # patch "commands.cc" # from [bae3f75e098e58c2e54eda192c62ac4e4f1847b0] # to [0b37c574ff4f24aa3ef783d34654c53a4e067818] # # patch "contrib/monotone.zsh_completion" # from [ab021dfed85eff74d530e395c9c3adbe760ccbe1] # to [872e2d668a2b4c5775134fd1b2a7101d29c1cba5] # # patch "monotone.cc" # from [99699fececcf92d3614b04a713b767ffa143a091] # to [c2d839bc84a52c398ae42a860f31b87d0004cc85] # # patch "monotone.texi" # from [4fb1363ab96b7475fb37f8a11dae6b43057c3af2] # to [e4a42059771b12538e575453621b24cc20ddf2ad] # # patch "netsync.cc" # from [6ac8baa7f1590808b738415ecd8770da32e23b71] # to [10e7570b6c2155fa1c88ef167e3fb8e692a4308c] # # patch "options.hh" # from [8246a992a8c10a7ca13ae99108d44d13b38f6950] # to [bb33c449ff288021098ac00c045e862806e42b9f] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,13 @@ +2005-06-07 Nathaniel Smith + + * monotone.texi (Storage and workflow): Attempt to thwart some + common misconceptions. + +2005-06-07 Nathaniel Smith + + * netsync.cc (rebuild_merkle_trees): Add a comment describing how + this code should work (and why it currently doesn't quite). + 2005-06-05 Nathaniel Smith * tests/t_bad_packets.at: Expect certs on a non-existent rev to @@ -18,7 +28,6 @@ Throw in some calls to CANONICALISE, maybe this will help on Win32... -2005-06-05 Timothy Brownawell * netsync.cc, netcmd.cc: Style cleanups (mostly whitespace). @@ -66,6 +75,14 @@ (note_state_at_branch_beginning): Move time back when there are known commits on a branch. +2005-06-03 Joel Reed + + * commands.cc, monotone.texi: provide --verbose option for + monotone complete revision which adds date and author + completion output + * contrib/monotone.zsh_completion: use verbose output when + completing revisions + 2005-06-02 graydon hoare * rcs_import.cc @@ -4809,7 +4826,7 @@ * AUTHORS: Mention Wojciech and Neil. * revision.cc (calculate_ancestors_from_graph): Make non-recursive. -2005-01-17 Wojciech Miłkowski +2005-01-17 Wojciech MiÅkowski * std_hooks.lua: Teach about meld. --- app_state.cc +++ app_state.cc @@ -31,7 +31,7 @@ app_state::app_state() : branch_name(""), db(""), stdhooks(true), rcfiles(true), diffs(false), - search_root("/"), depth(-1), last(-1) + search_root("/"), depth(-1), last(-1), verbose(false) { db.set_app(this); } @@ -351,6 +351,12 @@ } void +app_state::set_verbose(bool b) +{ + verbose = b; +} + +void app_state::add_rcfile(utf8 const & filename) { extra_rcfiles.push_back(filename); --- app_state.hh +++ app_state.hh @@ -33,6 +33,7 @@ bool rcfiles; bool diffs; bool no_merges; + bool verbose; options_map options; utf8 message; utf8 message_file; @@ -79,6 +80,7 @@ void set_stdhooks(bool b); void set_rcfiles(bool b); + void set_verbose(bool b); void add_rcfile(utf8 const & filename); explicit app_state(); --- commands.cc +++ commands.cc @@ -1405,7 +1405,7 @@ CMD(checkout, "tree", "[DIRECTORY]\n", - "check out revision from database into directory.\n" + "check out a revision from database into directory.\n" "If a revision is given, that's the one that will be checked out.\n" "Otherwise, it will be the head of the branch (given or implicit).\n" "If no directory is given, the branch name will be used as directory", @@ -3315,12 +3315,12 @@ CMD(complete, "informative", "(revision|manifest|file|key) PARTIAL-ID", "complete partial id", - OPT_BRIEF) + OPT_VERBOSE) { if (args.size() != 2) throw usage(name); - bool brief = global_sanity.brief; + bool verbose = app.verbose; N(idx(args, 1)().find_first_not_of("abcdef0123456789") == string::npos, F("non-hex digits in partial id")); @@ -3331,7 +3331,10 @@ app.db.complete(idx(args, 1)(), completions); for (set::const_iterator i = completions.begin(); i != completions.end(); ++i) - cout << i->inner()() << endl; + { + if (!verbose) cout << i->inner()() << endl; + else cout << describe_revision(app, i->inner()) << endl; + } } else if (idx(args, 0)() == "manifest") { @@ -3358,7 +3361,7 @@ i != completions.end(); ++i) { cout << i->first.inner()(); - if (!brief) cout << " " << i->second(); + if (verbose) cout << " " << i->second(); cout << endl; } } --- contrib/monotone.zsh_completion +++ contrib/monotone.zsh_completion @@ -94,10 +94,14 @@ compadd -- file manifest revision else local mtype="$words[2]" - local id="$words[3]:gs/-//" - if (( $#id )); then - compadd -- $(monotone complete $mtype $id) - fi + if [[ "$mtype" == "revision" ]]; then + _monotone_revisions + else + local id="$words[3]" + if (( $#id )); then + compadd -- $(monotone complete $mtype $id 2> /dev/null) + fi + fi fi } @@ -293,16 +297,16 @@ (( $+functions[_monotone_keys] )) || _monotone_keys() { - local keys - keys=$(monotone ls keys) - compadd -X $keys -n -- $(echo $keys | grep "[0-9a-f]\{40\}" | cut -f 1 -d ' ') + local id="$words[CURRENT]:gs/-//" + if (( $#id )); then + compadd -X "$(monotone complete key --verbose $id 2>/dev/null)" -n -- $(monotone complete key $id 2>/dev/null) + fi } (( $+functions[_monotone_revisions] )) || _monotone_revisions() { - local id="$words[CURRENT]:gs/-//" - if (( $#id )); then - compadd -- $(monotone complete revision $id 2>/dev/null) + if ! compset -P '*\='; then + compadd -X "$(monotone complete revision --verbose $PREFIX 2>/dev/null)" -n -- $(monotone complete revision $PREFIX 2>/dev/null) fi } --- monotone.cc +++ monotone.cc @@ -75,6 +75,7 @@ {"key", 'k', POPT_ARG_STRING, &argstr, OPT_KEY_NAME, "set key for signatures", NULL}, {"db", 'd', POPT_ARG_STRING, &argstr, OPT_DB_NAME, "set name of database", NULL}, {"root", 0, POPT_ARG_STRING, &argstr, OPT_ROOT, "limit search for working copy to specified root", NULL}, + {"verbose", 0, POPT_ARG_NONE, NULL, OPT_VERBOSE, "verbose completion output", NULL}, { NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -295,6 +296,10 @@ app.set_rcfiles(false); break; + case OPT_VERBOSE: + app.set_verbose(true); + break; + case OPT_RCFILE: app.add_rcfile(absolutify_for_command_line(tilde_expand(string(argstr)))); break; --- monotone.texi +++ monotone.texi @@ -667,12 +667,14 @@ A @dfn{database} is a single, regular file. You can copy or back it up using standard methods. Typically you keep a database in your home -directory. Databases are portable between different machine types. If -a database grows too big, you may choose to remove information from -it. You can have multiple databases and divide your work between them, -or keep everything in a single database if you prefer. You can dump -portions of your database out as text, and read them back into other -databases, or send them to your friends. +directory. Databases are portable between different machine types. You +can have multiple databases and divide your work between them, or keep +everything in a single database if you prefer. You can dump portions of +your database out as text, and read them back into other databases, or +send them to your friends. Underneath, databases are accessed using a +standard, robust data manager, which makes using even very large +databases efficient. In dire emergencies, you can directly examine and +manipulate a database using a simple SQL interface. A database contains many files, manifests, revisions, and certificates, some of which are not immediately of interest, some of @@ -3748,9 +3750,9 @@ is the revision in which that line of the file was last edited. @item monotone complete file @var{partial-id} address@hidden monotone complete key @var{partial-id} address@hidden monotone complete [--brief] key @var{partial-id} @itemx monotone complete manifest @var{partial-id} address@hidden monotone complete revision @var{partial-id} address@hidden monotone complete [--brief] revision @var{partial-id} These commands print out all known completions of a partial @sc{sha1} value, listing completions which are @code{file}, @code{manifest} or @@ -3771,6 +3773,20 @@ @code{fa36}. This command is intended to be used by programmable completion systems, such as those in @command{bash} and @command{zsh}. +The complete command for keys and revisions have a @code{--verbose} option. +Programmable completion systems can use @code{--verbose} output to +present users with additional information about each completion option. + +For example, verbose output for @code{revision} looks like this: address@hidden address@hidden +$ mt complete revision 01f +01f5da490941bee1f0000f0561fc62eabfb2fa23 graydon@@dub.net 2003-12-03T03:14:35 +01f992577bd8bcdcade0f89e724fd5dc2d2bbe8a kinetik@@orcon.nz 2005-05-11T05:19:29 +01faad191d8d0474777c70b4d606782942333a78 kinetik@@orcon.nz 2005-04-11T04:24:01 address@hidden group address@hidden smallexample + @item monotone diff @itemx monotone diff @var{pathname...} @itemx monotone diff address@hidden --- netsync.cc +++ netsync.cc @@ -3763,6 +3763,21 @@ ticker certs_ticker("certs", "c", 256); ticker keys_ticker("keys", "k", 1); + // this code is wrong. the way the logic _should_ work is: + // -- start with all branches we want to include + // -- for each such branch, find all branch certs for that branch + // -- for each such cert, note down its revision + // (or these two steps can be replaced with anything else that gives us + // list of all revisions in the branch) + // -- expand this set of revisions to include all of their ancestors + // -- for each such revision, insert all of its certs into the cert table, + // and note all of its branches and keys + // -- for each such branch, insert its epoch into the epoch table, and for + // each such key, insert its key into the key table. + // this somewhat convoluted approach is necessary to handle cases where + // ancestors leave the branch inclusion set, where revisions carry branches + // that are otherwise outside of the inclusion set, etc. + set revision_ids; set inserted_keys; --- options.hh +++ options.hh @@ -34,3 +34,4 @@ #define OPT_DIFFS 25 #define OPT_NO_MERGES 26 #define OPT_LAST 27 +#define OPT_VERBOSE 28