# # # add_dir "tests/alias_command" # # add_file "tests/alias_command/__driver__.lua" # content [55a16e110fd2e8d79fed209d6a61e0e54c369a7d] # # add_file "tests/alias_command/extra_rc" # content [406020976c82e8fe381f63bf2f234337891fab14] # ============================================================ --- tests/alias_command/__driver__.lua 55a16e110fd2e8d79fed209d6a61e0e54c369a7d +++ tests/alias_command/__driver__.lua 55a16e110fd2e8d79fed209d6a61e0e54c369a7d @@ -0,0 +1,75 @@ +-- -*-lua-*- +-- +-- We are testing annotate on this graph: +-- +-- a +-- /|\ +-- / | \ +-- b* c* d* +-- | | | +-- e* e* e* +-- \ \/ +-- \ e +-- \ / +-- e +-- | +-- f* +-- +-- The current annotate code will arbitrarily select one of the marked +-- e-revisions for lines coming from e. +-- + +mtn_setup() + +check(get("extra_rc")) + +addfile("foo", "first\nfoo\nthird\n") +commit() +rev_a = base_revision() + +econtents = "first\nsecond\nthird\n" + +writefile("foo", "first\nb\nthird\n") +commit() +writefile("foo", econtents) +commit() +rev_e1 = base_revision() + +revert_to(rev_a) +writefile("foo", "first\nc\nthird\n") +commit() +writefile("foo", econtents) +commit() +rev_e2 = base_revision() + +revert_to(rev_a) +writefile("foo", "first\nd\nthird\n") +commit() +writefile("foo", econtents) +commit() +rev_e3 = base_revision() + +check(mtn("merge"), 0, false, false) +check(mtn("update"), 0, false, false) + +writefile("foo", econtents .. "fourth\n") +commit() +rev_f = base_revision() + +check(mtn("praise", "foo", "--brief", "--rcfile=extra_rc"), 0, true, true) + +check(qgrep(rev_a .. ": first", "stdout")) +check(qgrep(rev_e1 .. ": second", "stdout") + or qgrep(rev_e2 .. ": second", "stdout") + or qgrep(rev_e3 .. ": second", "stdout")) +check(qgrep(rev_a .. ": third", "stdout")) +check(qgrep(rev_f .. ": fourth", "stdout")) + +check(mtn("blame", "foo", "--brief", "--rcfile=extra_rc"), 0, true, true) + +check(qgrep(rev_a .. ": first", "stdout")) +check(qgrep(rev_e1 .. ": second", "stdout") + or qgrep(rev_e2 .. ": second", "stdout") + or qgrep(rev_e3 .. ": second", "stdout")) +check(qgrep(rev_a .. ": third", "stdout")) +check(qgrep(rev_f .. ": fourth", "stdout")) ============================================================ --- tests/alias_command/extra_rc 406020976c82e8fe381f63bf2f234337891fab14 +++ tests/alias_command/extra_rc 406020976c82e8fe381f63bf2f234337891fab14 @@ -0,0 +1,2 @@ +alias_command("annotate", "blame") +alias_command("annotate", "praise")