# # patch "ChangeLog" # from [128cc1f688a879b05391cab2f954afddaafd46e7] # to [8c977ddacedcc217fcdd8dc4dbc4e73ce54c8eee] # # patch "automate.cc" # from [f10d2c6090c993b5c05fb824581aded812f59871] # to [e3bc754e30f0356b70c015dff6ee413a3969b5f3] # # patch "commands.cc" # from [7291355a92780e10f26eb41272262e52b844e979] # to [588e56b9de4a9ff6e0146177ed642787db7b64a2] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,7 @@ +2005-04-19 Sebastian Spaeth + * automate.cc: make BRANCH optional in "automate heads BRANCH" + we use the default branch as given in MT/options if not specified + * commands.cc: BRANCH -> [BRANCH] in cmd description 2005-04-19 Richard Levitte * contrib/monotone-import.pl (my_exit): As in monotone-notify.pl, --- automate.cc +++ automate.cc @@ -37,7 +37,7 @@ // Name: heads // Arguments: -// 1: a branch name +// 1: branch name (optional, default branch is used if non-existant) // Added in: 0.0 // Purpose: Prints the heads of the given branch. // Output format: A list of revision ids, in hexadecimal, each followed by a @@ -50,11 +50,15 @@ app_state & app, std::ostream & output) { - if (args.size() != 1) + if (args.size() > 1) throw usage(help_name); + if (args.size() ==1 ) { + // branchname was explicitly given, use that + app.set_branch(idx(args, 0)); + } std::set heads; - get_branch_heads(idx(args, 0)(), app, heads); + get_branch_heads(app.branch_name(), app, heads); for (std::set::const_iterator i = heads.begin(); i != heads.end(); ++i) output << (*i).inner()() << std::endl; } --- commands.cc +++ commands.cc @@ -3898,7 +3898,7 @@ CMD(automate, "automation", "interface_version\n" - "heads BRANCH\n" + "heads [BRANCH]\n" "descendents REV1 [REV2 [REV3 [...]]]\n" "erase_ancestors [REV1 [REV2 [REV3 [...]]]]\n" "toposort [REV1 [REV2 [REV3 [...]]]]\n"