Browse Source

recreate: add experimental warning for now

Marian Beermann 9 years ago
parent
commit
d5ad063d13
3 changed files with 9 additions and 0 deletions
  1. 6 0
      borg/archiver.py
  2. 1 0
      borg/testsuite/archiver.py
  3. 2 0
      docs/usage.rst

+ 6 - 0
borg/archiver.py

@@ -821,6 +821,12 @@ class Archiver:
                 print("\nReceived signal, will exit cleanly.", file=sys.stderr)
                 print("\nReceived signal, will exit cleanly.", file=sys.stderr)
             recreater.interrupt = True
             recreater.interrupt = True
 
 
+        msg = ("recreate is an experimental feature.\n"
+               "Type 'YES' if you understand this and want to continue: ")
+        if not yes(msg, false_msg="Aborting.", truish=('YES',),
+                   env_var_override='BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING'):
+            return EXIT_ERROR
+
         matcher, include_patterns = self.build_matcher(args.excludes, args.paths)
         matcher, include_patterns = self.build_matcher(args.excludes, args.paths)
         self.output_list = args.output_list
         self.output_list = args.output_list
         self.output_filter = args.output_filter
         self.output_filter = args.output_filter

+ 1 - 0
borg/testsuite/archiver.py

@@ -197,6 +197,7 @@ class ArchiverTestCaseBase(BaseTestCase):
     def setUp(self):
     def setUp(self):
         os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = 'YES'
         os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = 'YES'
         os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = 'YES'
         os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = 'YES'
+        os.environ['BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING'] = 'YES'
         os.environ['BORG_PASSPHRASE'] = 'waytooeasyonlyfortests'
         os.environ['BORG_PASSPHRASE'] = 'waytooeasyonlyfortests'
         self.archiver = not self.FORK_DEFAULT and Archiver() or None
         self.archiver = not self.FORK_DEFAULT and Archiver() or None
         self.tmpdir = tempfile.mkdtemp()
         self.tmpdir = tempfile.mkdtemp()

+ 2 - 0
docs/usage.rst

@@ -94,6 +94,8 @@ Some automatic "answerers" (if set, they automatically answer confirmation quest
         For "Warning: 'check --repair' is an experimental feature that might result in data loss."
         For "Warning: 'check --repair' is an experimental feature that might result in data loss."
     BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
     BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
         For "You requested to completely DELETE the repository *including* all archives it contains:"
         For "You requested to completely DELETE the repository *including* all archives it contains:"
+    BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
+        For "recreate is an experimental feature."
 
 
     Note: answers are case sensitive. setting an invalid answer value might either give the default
     Note: answers are case sensitive. setting an invalid answer value might either give the default
     answer or ask you interactively, depending on whether retries are allowed (they by default are
     answer or ask you interactively, depending on whether retries are allowed (they by default are