diff --git a/tests/test-verify-repo-operations.py b/tests/test-verify-repo-operations.py --- a/tests/test-verify-repo-operations.py +++ b/tests/test-verify-repo-operations.py @@ -133,6 +133,7 @@ class verifyingstatemachine(RuleBasedSta # be provided as arguments to future operations. paths = Bundle('paths') contents = Bundle('contents') + branches = Bundle('branches') committimes = Bundle('committimes') def __init__(self): @@ -250,6 +251,13 @@ class verifyingstatemachine(RuleBasedSta def gencontent(self, content): return content + @rule( + target=branches, + name=safetext, + ) + def genbranch(self, name): + return name + @rule(target=paths, source=paths) def lowerpath(self, source): return source.lower() @@ -369,6 +377,32 @@ class verifyingstatemachine(RuleBasedSta def export(self): self.hg("export") + # Section: Branch management + @rule() + def checkbranch(self): + self.hg("branch") + + @rule(branch=branches) + def switchbranch(self, branch): + with acceptableerrors( + 'cannot use an integer as a name', + 'cannot be used in a name', + 'a branch of the same name already exists', + 'is reserved', + ): + self.hg("branch", "--", branch) + + @rule(branch=branches, clean=st.booleans()) + def update(self, branch, clean): + with acceptableerrors( + 'unknown revision', + 'parse error', + ): + if clean: + self.hg("update", "-C", "--", branch) + else: + self.hg("update", "--", branch) + settings.register_profile( 'default', settings( timeout=300,