OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 29-Oct-2007 18:20:54 Branch: HEAD Handle: 2007102917205400 Modified files: openpkg-src/monotone monotone.patch.rse monotone.spec Log: upgrade my RSE patchset to provide the 'mtn base' command for convenient sub-branch management Summary: Revision Changes Path 1.3 +67 -7 openpkg-src/monotone/monotone.patch.rse 1.24 +1 -1 openpkg-src/monotone/monotone.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/monotone/monotone.patch.rse ============================================================================ $ cvs diff -u -r1.2 -r1.3 monotone.patch.rse --- openpkg-src/monotone/monotone.patch.rse 26 Oct 2007 07:42:05 -0000 1.2 +++ openpkg-src/monotone/monotone.patch.rse 29 Oct 2007 17:20:54 -0000 1.3 @@ -531,7 +531,7 @@ =================================================================== Index: std_hooks.lua --- std_hooks.lua a53348ca15431cc67266c65e6215640f6f55eee7 -+++ std_hooks.lua a22ecb0c807ba34a9c4a564fb0d86ce246e9e1c9 ++++ std_hooks.lua 2bf9ca9c0181225388eba671beb3d6ca05fe8089 @@ -284,6 +284,15 @@ function edit_comment(basetext, user_log if user_log_message == "" or string.sub(user_log_message, -1) ~= "\n" then tmp:write("\n") @@ -548,10 +548,11 @@ tmp:write(basetext) io.close(tmp) -@@ -1112,6 +1121,93 @@ end - return "socat" +@@ -1175,3 +1184,153 @@ end + netsync_notifiers[precedence] = notifier + return true, warning end - ++ +-- #if defined(RSE) /* extra-command */ + +-- extra command: "mtn fuse REVISION" @@ -637,11 +638,70 @@ + end +end + ++-- extra command: "mtn base {upgrade|diff}" ++register_command( ++ "base", "upgrade|diff", ++ "Upgrades or compares current branch against base branch", ++ "Upgrade current branch from base branch or compares current " .. ++ "branch against base branch. The base branch has to be stored " .. ++ "in the \".mtn-base\" file in the workspace root directory.", ++ "command_base" ++) ++function command_base(op) ++ -- sanity check command line ++ if op == nil then ++ io.stderr:write("mtn: base: ERROR: no operation specified\n") ++ return ++ end ++ if op ~= "upgrade" and op ~= "diff" then ++ io.stderr:write("mtn: base: ERROR: either \"upgrade\" or \"diff\" operation has to be specified\n") ++ return ++ end ++ ++ -- determine current branch of workspace and base base ++ local rc, branch_this = mtn_automate("get_option", "branch") ++ if branch_this ~= nil then ++ branch_this = string.match(branch_this, "^%s*(%S+)%s*$") ++ end ++ if branch_this == nil then ++ io.stderr:write("mtn: base: ERROR: failed to determine current branch\n") ++ return ++ end ++ local branch_base = read_contents_of_file(".mtn-base", "r") ++ if branch_base ~= nil then ++ branch_base = string.match(branch_base, "^%s*(%S+)%s*$") ++ end ++ if branch_base == nil then ++ io.stderr:write("mtn: base: ERROR: failed to determine base branch\n") ++ return ++ end ++ ++ -- dispatch according to operation ++ if op == "upgrade" then ++ -- upgrade current branch by merging in revisions of base branch ++ local rc = execute("mtn", "propagate", branch_base, branch_this) ++ if rc ~= 0 then ++ io.stderr:write("mtn: revision: ERROR: failed to execute \"mtn propagate\"\n") ++ return ++ end ++ rc = execute("mtn", "update") ++ if rc ~= 0 then ++ io.stderr:write("mtn: revision: ERROR: failed to execute \"mtn update\"\n") ++ return ++ end ++ elseif op == "diff" then ++ -- upgrade current branch by merging in revisions of base branch ++ local rc = execute("mtn", "diff", "-r", "h:" .. branch_base, "-r", "h:" .. branch_this) ++ if rc ~= 0 then ++ io.stderr:write("mtn: revision: ERROR: failed to execute \"mtn diff\"\n") ++ return ++ end ++ end ++ return ++end ++ +-- #endif + - -- Netsync notifiers are tables containing 5 functions: - -- start, revision_received, cert_received, pubkey_received and end - -- Those functions take exactly the same arguments as the corresponding =================================================================== Index: work.cc --- work.cc 04389e4274f38d0b2bc866c6938d53bbda5e8a2f @@ . patch -p0 <<'@@ .' Index: openpkg-src/monotone/monotone.spec ============================================================================ $ cvs diff -u -r1.23 -r1.24 monotone.spec --- openpkg-src/monotone/monotone.spec 26 Oct 2007 13:26:29 -0000 1.23 +++ openpkg-src/monotone/monotone.spec 29 Oct 2007 17:20:54 -0000 1.24 @@ -33,7 +33,7 @@ Group: SCM License: GPL Version: 0.37 -Release: 20071026 +Release: 20071029 # package options %option with_rse yes @@ . ______________________________________________________________________ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org