[PATCH 3 of 3] tests: add relink extension to hypothesis testing

Simon Farnsworth simonfar at fb.com
Mon Feb 22 14:43:42 EST 2016


# HG changeset patch
# User Simon Farnsworth <simonfar at fb.com>
# Date 1456166194 28800
#      Mon Feb 22 10:36:34 2016 -0800
# Branch all
# Node ID 7555522915fcc32c403fbadccc0d02a443b9dd77
# Parent  87c160b301c0c90be408e6a846cb9fcda4a828df
tests: add relink extension to hypothesis testing

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
@@ -169,7 +169,7 @@
         return repo in self.extensions and extension in self.extensions[repo]
 
     @rule(extension=st.sampled_from((
-        'shelve', 'mq'
+        'shelve', 'mq', 'relink'
     )))
     def add_extension(self, extension):
         extensions = self.extensions.setdefault(self.current_repo, set())
@@ -458,6 +458,12 @@
         with acceptable_errors("shelved change '%s' not found" % (name,)):
             self.hg("shelve", "--delete", name)
 
+    @rule()
+    @precondition(lambda self: self.has_extension("relink"))
+    def relink(self):
+        with acceptable_errors("repository default-relink not found!"):
+            self.hg("relink")
+
 class WriteOnlyDatabase(ExampleDatabase):
     def __init__(self, underlying):
         super(ExampleDatabase, self).__init__()


More information about the Mercurial-devel mailing list