# # # add_dir "tests/merge_--update" # # add_file "tests/merge_--update/__driver__.lua" # content [f67439ada14b3299819824e9a5d4c55bb7dd823d] # # patch "NEWS" # from [7334ed2122e04eade123c5e7bdef663c51ad941d] # to [2d8e0ecbd44136e22aba0a1c75f6ecdf2bc3d61f] # ============================================================ --- tests/merge_--update/__driver__.lua f67439ada14b3299819824e9a5d4c55bb7dd823d +++ tests/merge_--update/__driver__.lua f67439ada14b3299819824e9a5d4c55bb7dd823d @@ -0,0 +1,28 @@ +mtn_setup() + +addfile("foo", "foo") +commit() +base = base_revision() + +addfile("left", "left") +commit() +left = base_revision() +check(mtn("up", "-r", base), 0, nil, false) + +addfile("right", "right") +commit() +right = base_revision() + +check(mtn("merge"), 0, nil, true) +check(qgrep("not been updated", "stderr")) +check(mtn("heads"), 0, true, false) +check(not qgrep(base_revision(), "stdout")) + +addfile("third", "third") +commit() +third = base_revision() + +check(mtn("merge", "--update"), 0, nil, true) +check(qgrep("updated to", "stderr")) +check(mtn("heads"), 0, true, false) +check(qgrep(base_revision(), "stdout")) ============================================================ --- NEWS 7334ed2122e04eade123c5e7bdef663c51ad941d +++ NEWS 2d8e0ecbd44136e22aba0a1c75f6ecdf2bc3d61f @@ -33,6 +33,14 @@ xxx xxx xx xx:xx:xx UTC 2010 - New automation command 'update' which behaves identical to the normal 'update' command. + - Many commands that change the heads of a branch (approve, disapprove, + pull, merge, etc) can now take an option "--update". If run from + a workspace which is based on a head of the branch and has no local + changes, this option makes these commands update that workspace to + the new head. If you always want this behavior, you can define the + get_default_command_options(cmd) + hook in your monotonerc. + - A new Lua extension function change_workspace(directory) has been added. This should be most useful for custom commands which need to work on multiple workspaces from the same monotone instance.