[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] Issues with mtn commit and the latest net.venge.mo
From: |
Zack Weinberg |
Subject: |
Re: [Monotone-devel] Issues with mtn commit and the latest net.venge.monotone head |
Date: |
Mon, 9 Mar 2009 20:44:30 -0700 |
Committed.
On Mon, Mar 9, 2009 at 12:50 PM, Tero Koskinen <address@hidden> wrote:
> On Sun, 8 Mar 2009 23:02:28 -0700 Zack Weinberg wrote:
>> On Sun, Mar 8, 2009 at 1:11 PM, Tero Koskinen <address@hidden> wrote:
>> >
>> > Test below.
>> Some nits:
>
> Improved test here:
> #
> #
> # add_dir "tests/commit_default_editor"
> #
> # add_file "tests/commit_default_editor/__driver__.lua"
> # content [db5e1f449b2a3c7d6faa26e0089032db7800ce8b]
> #
> # add_file "tests/commit_default_editor/test_hooks.lua"
> # content [b2e3ef495040e76ef61e120e618b9cd27925d23b]
> #
> # patch "testlib.lua"
> # from [dd8669557a3a4bf9933897e29a615cbedc42cf38]
> # to [690ef91f97bdce15204c3e2a61212eaf3ef99fec]
> #
> ============================================================
> --- tests/commit_default_editor/__driver__.lua
> db5e1f449b2a3c7d6faa26e0089032db7800ce8b
> +++ tests/commit_default_editor/__driver__.lua
> db5e1f449b2a3c7d6faa26e0089032db7800ce8b
> @@ -0,0 +1,9 @@
> +
> +mtn_setup()
> +
> +check(get("test_hooks.lua"))
> +
> +addfile("a", "hello there")
> +
> +check(mtn("--branch","testbranch","commit"), 0, false, false)
> +
> ============================================================
> --- tests/commit_default_editor/test_hooks.lua
> b2e3ef495040e76ef61e120e618b9cd27925d23b
> +++ tests/commit_default_editor/test_hooks.lua
> b2e3ef495040e76ef61e120e618b9cd27925d23b
> @@ -0,0 +1,23 @@
> +
> +function execute(path,...)
> + tname, rest = unpack(arg)
> + if tname == nil then
> + return 1
> + end
> + if path == "editor" then
> + tmp = io.open(tname, "w")
> + tmp:write("Hello\n")
> + io.close(tmp)
> + return 0
> + end
> + return 1
> +end
> +
> +function get_passphrase(keyid)
> + return keyid
> +end
> +
> +function program_exists_in_path(program)
> + return (program == "editor")
> +end
> +
> ============================================================
> --- testlib.lua dd8669557a3a4bf9933897e29a615cbedc42cf38
> +++ testlib.lua 690ef91f97bdce15204c3e2a61212eaf3ef99fec
> @@ -872,6 +872,10 @@ function run_tests(debugging, list_only,
> unset_env("SSH_AUTH_SOCK")
> unset_env("DISPLAY")
>
> + -- tests do not use (interactive) editors for commits
> + unset_env("EDITOR")
> + unset_env("VISUAL")
> +
> logfile = io.open(logname, "w")
> chdir(run_dir);
>
>
>
> --
> Tero Koskinen <address@hidden>
>