| 1 |
#!/usr/bin/env python3 |
| 2 |
## First example from the Hacking Guide |
| 3 |
|
| 4 |
import sys, testlifter |
| 5 |
|
| 6 |
testlifter.verbose += sys.argv[1:].count("-v") |
| 7 |
repo = testlifter.CVSRepository("hack1.repo") |
| 8 |
repo.init() |
| 9 |
repo.module("module") |
| 10 |
co = repo.checkout("module", "hack1.checkout") |
| 11 |
|
| 12 |
co.write("foo.c", "The quick brown fox jumped over the lazy dog.\n") |
| 13 |
co.add("foo.c") |
| 14 |
co.write("bar.c", "Not an obfuscated C contest entry.\n") |
| 15 |
co.add("bar.c") |
| 16 |
co.commit("First commit") |
| 17 |
|
| 18 |
co.write("bar.c", "The world will little note, nor long remember...\n") |
| 19 |
co.commit("Second commit") |
| 20 |
|
| 21 |
co.write("foo.c", "And now for something completely different.\n") |
| 22 |
co.write("bar.c", "One is dead, one is mad, and I have forgotten.\n") |
| 23 |
co.commit("Third commit") |
| 24 |
|
| 25 |
repo.cleanup() |
| 26 |
|
| 27 |
# end |