homebrew-core/Formula/bzr-colo.rb

47 lines
1.5 KiB
Ruby
Raw Normal View History

class BzrColo < Formula
desc "Git style colocated branches for Bazaar"
homepage "https://launchpad.net/bzr-colo"
url "https://launchpad.net/bzr-colo/trunk/0.4.0/+download/bzr-colo-0.4.0.tar.gz"
sha256 "f61c1abaf80f1e4a573fefd492b70938d27c4b8ca5611cdb0e0a4dc0ed71bbb3"
bottle :unneeded
2016-02-24 02:32:43 +00:00
depends_on "bazaar"
def install
(share/"bazaar/plugins/colo").install Dir["*"]
end
test do
system "bzr", "whoami", "Homebrew"
system "bzr", "colo-init", "foo"
file_path = (testpath/"foo/trunk/foo.txt")
cd "foo" do
system "bzr", "colo-checkout", "trunk"
cd "trunk" do
file_path.write("change")
system "bzr", "add"
system "bzr", "commit", "-m", "some change in trunk"
system "bzr", "colo-branch", "branch1"
assert_match(/\* branch1/, shell_output("bzr colo-branches"))
2016-02-24 02:32:43 +00:00
file_path.append_lines("change")
system "bzr", "commit", "-m", "some change in branch1"
assert_match(/some change in branch1/, shell_output("bzr log -l1"))
system "bzr", "switch", "colo:trunk"
assert_match(/\* trunk/, shell_output("bzr colo-branches"))
assert_match(/some change in trunk/, shell_output("bzr log -l1"))
system "bzr", "merge", "colo:branch1"
system "bzr", "commit", "-m", "this is so much worse than just using bzr"
assert_match(/this is so much worse than just using bzr/, shell_output("bzr log -r2"))
assert_match(/some change in trunk/, shell_output("bzr log -r1"))
end
end
end
end