You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2014/04/07 10:55:10 UTC

[PATCH] svnadmin freeze r1 svnadmin freeze r2 rsync -a ./

Is this a good idea? ---

[[[
Test that 'svnadmin freeze' is nestable.

This would be useful in practice as a means to easily freeze a (small)
number of repositories simultaneously.  It also verifies that 'freeze'
doesn't take system-global locks.

Incidentally, this is also the first 'svnadmin freeze' test in our tree.

* subversion/tests/cmdline/svnadmin_tests.py
  (freeze_freeze): New test.
  (test_list): Run it.
]]]

[[[
Index: subversion/tests/cmdline/svnadmin_tests.py
===================================================================
--- subversion/tests/cmdline/svnadmin_tests.py	(revision 1585428)
+++ subversion/tests/cmdline/svnadmin_tests.py	(working copy)
@@ -2397,6 +2397,14 @@ def verify_packed(sbox):
   svntest.actions.run_and_verify_svnadmin(None, expected_output, [],
                                           "verify", sbox.repo_dir)
 
+def freeze_freeze(sbox):
+  "svnadmin freeze svnadmin freeze (some-cmd)"
+  sbox.build(create_wc=False)
+  second_repo_dir, _ = sbox.add_repo_path('backup')
+  svntest.main.run_svnadmin('freeze', sbox.repo_dir, '--',
+                 svntest.main.svnadmin_binary, 'freeze', second_repo_dir, '--',
+                 sys.executable, '-c', 'True')
+
 ########################################################################
 # Run the tests
 
@@ -2442,6 +2450,7 @@ test_list = [ None,
               load_ignore_dates,
               fsfs_hotcopy_old_with_propchanges,
               verify_packed,
+              freeze_freeze,
              ]
 
 if __name__ == '__main__':
]]]

On re-reading the code, I wonder if I should add read_only=True to
sbox.create().. this would cause the code to freeze the shared read-only
repository, which shouldn't affect other tests in any way except perhaps
to slow them down (when BDB is in use).

Re: [PATCH] svnadmin freeze r1 svnadmin freeze r2 rsync -a ./

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Julian Foad wrote on Mon, Apr 07, 2014 at 11:36:57 +0100:
> Daniel Shahaf wrote:
> 
> > Is this a good idea? ---
> 
> Sure -- why not?
> 

Because I wasn't sure whether that's a supported use-case or something
that just happens to work --- compare --editor-cmd='f(){ x=$0; echo
"Template text" > "$0";  $EDITOR "$0" }; f'.

> > [[[
> > Test that 'svnadmin freeze' is nestable.
> > 
> > This would be useful in practice as a means to easily freeze a (small)
> > number of repositories simultaneously.  It also verifies that 'freeze'
> > doesn't take system-global locks.
> 
> Please put this documentation of the test's purpose in the test itself.
> 

Done.

> > On re-reading the code, I wonder if I should add read_only=True to
> > sbox.create().. this would cause the code to freeze the shared read-only
> > repository, which shouldn't affect other tests in any way except perhaps
> > to slow them down (when BDB is in use).
> 
> No. Keep tests independent. Anyway, this requires a kind of write access to the repo it freezes.

"Kind of" read access.  It doesn't create or otherwise modify history.
It won't step on the feet of other tests that use the pristine
repository (whether to read its history or to freeze it).  That's why I
wasn't sure.

Thanks for the review; committed r1585535.

Daniel

Re: [PATCH] svnadmin freeze r1 svnadmin freeze r2 rsync -a ./

Posted by Julian Foad <ju...@btopenworld.com>.
Daniel Shahaf wrote:

> Is this a good idea? ---

Sure -- why not?

> [[[
> Test that 'svnadmin freeze' is nestable.
> 
> This would be useful in practice as a means to easily freeze a (small)
> number of repositories simultaneously.  It also verifies that 'freeze'
> doesn't take system-global locks.

Please put this documentation of the test's purpose in the test itself.

> Incidentally, this is also the first 'svnadmin freeze' test in our tree.

Well, it's certainly a good idea to have a basic test for each feature that at least simply exercises the feature.

> * subversion/tests/cmdline/svnadmin_tests.py
>   (freeze_freeze): New test.
>   (test_list): Run it.
> ]]]
> 
> [[[
> Index: subversion/tests/cmdline/svnadmin_tests.py
> ===================================================================
> --- subversion/tests/cmdline/svnadmin_tests.py    (revision 1585428)
> +++ subversion/tests/cmdline/svnadmin_tests.py    (working copy)
> @@ -2397,6 +2397,14 @@ def verify_packed(sbox):
>    svntest.actions.run_and_verify_svnadmin(None, expected_output, [],
>                                            "verify", sbox.repo_dir)
> 
> +def freeze_freeze(sbox):
> +  "svnadmin freeze svnadmin freeze (some-cmd)"
> +  sbox.build(create_wc=False)
> +  second_repo_dir, _ = sbox.add_repo_path('backup')
> +  svntest.main.run_svnadmin('freeze', sbox.repo_dir, '--',
> +                 svntest.main.svnadmin_binary, 'freeze', second_repo_dir, '--',
> +                 sys.executable, '-c', 'True')
> +
> ########################################################################
> # Run the tests
> 
> @@ -2442,6 +2450,7 @@ test_list = [ None,
>                load_ignore_dates,
>                fsfs_hotcopy_old_with_propchanges,
>                verify_packed,
> +              freeze_freeze,
>               ]
> 
> if __name__ == '__main__':
> ]]]
> 
> On re-reading the code, I wonder if I should add read_only=True to
> sbox.create().. this would cause the code to freeze the shared read-only
> repository, which shouldn't affect other tests in any way except perhaps
> to slow them down (when BDB is in use).

No. Keep tests independent. Anyway, this requires a kind of write access to the repo it freezes.

- Julian