# # # patch "contrib/README" # from [90c3e67f623b4bc39fc774a09e792989f42e36fd] # to [1a793c46aa1cc6c0949e9944f08182b3e6b18d4d] # # patch "contrib/extra-commands.lua" # from [0958d80adc80086bd029e0c760e37fc42fcd4a41] # to [5fc6b602f136d33d3e8405e9f80206fa6e0508dc] # ============================================================ --- contrib/README 90c3e67f623b4bc39fc774a09e792989f42e36fd +++ contrib/README 1a793c46aa1cc6c0949e9944f08182b3e6b18d4d @@ -59,3 +59,7 @@ licenses. -- monotone-cluster-push.lua: A simple script to push changes to other servers upon receiving them. This will only work on a server instance. + + -- extra-commands.lua: Some simple lua user commands to automate common + command sequences. The lua code should be copied to a monotonerc file + for use. ============================================================ --- contrib/extra-commands.lua 0958d80adc80086bd029e0c760e37fc42fcd4a41 +++ contrib/extra-commands.lua 5fc6b602f136d33d3e8405e9f80206fa6e0508dc @@ -1,21 +1,19 @@ alias_command("annotate", "praise") -- include this in your monotonerc file to gain the extra commands. alias_command("annotate", "blame") alias_command("annotate", "praise") -function pmup(...) +function pup(...) mtn_automate("get_option", "branch") -- make sure we have a valid workspace mtn_automate("pull") - mtn_automate("merge") mtn_automate("update") end -register_command("pup", "Pull, merge and update a workspace", +register_command("pup", "Pull and update a workspace", "This command approximates the update command of a centralised revision control system. " .. - "It first contacts the server to gather new revisions, then merges multiple local heads " .. - "(if any), and then it updates the workspace.", "pmup") + "It first contacts the server to gather new revisions and then it updates the workspace.", "pup") -function cpm(...) +function cpp(...) mtn_automate("get_option", "branch") -- make sure we have a valid workspace mtn_automate("commit") mtn_automate("pull") @@ -25,17 +23,27 @@ function cpm(...) if words == 1 then mtn_automate("push") else - mtn_automate("merge") - print("Workspace contents will not be pushed to the server.") - print("Please check that merge was successful then push changes.") + print("There are multiple heads in your current branch.") + print("You should run 'mtn mup' to merge the heads and update.") + print("After you have verified the merge works, run 'mtn cpp'") + print("again to commit and push the changes.") end end -register_command("cpm", "Commit, pull, merge and push a workspace", +register_command("cpp", "Commit, pull and push a workspace", "This command approximates the commit command of a centralised revision control system. " .. "It first commits your work to the local repository, then contacts the server to gather " .. "new revisions. If there is a single head at this point, then the local changes are pushed " .. - "to the server. If there are multiple heads then they are merged, and the user is asked " .. - "to check things still work before pushing the changes.", "cpm") + "to the server.", "cpp") +function mup(...) + mtn_automate("get_option", "branch") -- make sure we have a valid workspace + mtn_automate("merge") + mtn_automate("update") +end +register_command("mup", "Merge and update a workspace", + "This command merges multiple heads of a branch, and then updates the current workspace" .. + "to the resulting revision.", "mup") + +