| 1 |
#!/usr/bin/env python3 |
| 2 |
## A branchy repo with deletions and only valid tags |
| 3 |
|
| 4 |
import sys, testlifter |
| 5 |
|
| 6 |
testlifter.verbose += sys.argv[1:].count("-v") |
| 7 |
repo = testlifter.CVSRepository("branchy.repo") |
| 8 |
repo.init() |
| 9 |
repo.module("module") |
| 10 |
co = repo.checkout("module", "branchy.checkout") |
| 11 |
|
| 12 |
co.write("README", "The quick brown fox jumped over the lazy dog.\n") |
| 13 |
co.add("README") |
| 14 |
co.commit("This is a sample commit") |
| 15 |
|
| 16 |
co.write("README", |
| 17 |
"Now is the time for all good men to come to the aid of their country.\n") |
| 18 |
co.commit("This is another sample commit") |
| 19 |
|
| 20 |
co.write("doomed", |
| 21 |
"This is a doomed file. Its destiny is to be deleted.\n") |
| 22 |
co.add("doomed") |
| 23 |
co.commit("Create a doomed file") |
| 24 |
|
| 25 |
co.write("doomed", |
| 26 |
"The world will little note, nor long remember what we say here\n") |
| 27 |
co.commit("Add a spacer commit") |
| 28 |
|
| 29 |
co.tag("foo") # Ordinary, legal tag name |
| 30 |
|
| 31 |
co.write(".cvsignore","*.pyc\n") |
| 32 |
co.add(".cvsignore") |
| 33 |
co.commit("Check that .cvsignore -> .gitignore name translation works.") |
| 34 |
|
| 35 |
co.write(".cvsignore","*.pyc\n*.o\n") |
| 36 |
co.commit("Check that .cvsignore -> .gitignore name translation works on updates as well.") |
| 37 |
|
| 38 |
co.write("README", |
| 39 |
"And now for something completely different.\n") |
| 40 |
co.commit("The obligatory Monty Python reference") |
| 41 |
|
| 42 |
co.remove("doomed") |
| 43 |
co.commit("Testing file removal") |
| 44 |
|
| 45 |
co.write("README", |
| 46 |
"The file 'doomed' should not be visible at this revision.\n") |
| 47 |
co.commit("Only README should be visible here.") |
| 48 |
|
| 49 |
co.write("superfluous", |
| 50 |
"This is a superflous file, a sanity check for branch creation.\n") |
| 51 |
co.add("superfluous") |
| 52 |
co.commit("Should not generate an extra fileop after branching") |
| 53 |
|
| 54 |
co.branch("samplebranch") |
| 55 |
|
| 56 |
# This will point at the same commit as the generated samplebranch_root |
| 57 |
co.tag("random") |
| 58 |
|
| 59 |
co.write("README", "This is alternate content for README.\n") |
| 60 |
co.commit("Do we get branch detection right?") |
| 61 |
|
| 62 |
co.switch("HEAD") |
| 63 |
|
| 64 |
co.write("README", "I'm back in the saddle again.\n") |
| 65 |
co.commit("This commit should alter the master branch.") |
| 66 |
|
| 67 |
# The tilde should be stripped from the middle of this |
| 68 |
co.tag("ill~egal") |
| 69 |
|
| 70 |
repo.cleanup() |
| 71 |
|
| 72 |
# end |