[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Re: [Issue 816] - Silent failure in svn log -r (fwd)

From: Kieran <kieran_at_esperi.demon.co.uk>
Date: 2002-07-30 06:24:49 CEST

On 29 Jul 2002, Philip Martin wrote:

> Later in this function there is code that handles a new repository
> with no revisions:
> a) there is now code duplication retrieving HEAD.
> b) I think you broke it.
>
Yes, I did.

The following addition to
./subversion/tests/clients/cmdline/log_tests.py should catch such
mistakes in the future. It's my first attempt at python, so style
pointers would be appreciated.

It removes and re-creates an empty repository, checks it out, then runs
"svn log". Note that it has hard code to use a "file:///..."-type url.

It occurs to me that it might be worth creating a
"make_empty_repo_and_wc" function in
./subversion/tests/clients/cmdline/svntest/actions.py

Regards

Kieran

-- 
* subversion/tests/clients/cmdline/log_tests.py:
  Added log_with_empty_repos
  This creates an absolutely empty, untouched repository,
  then checks that "svn log" works on it without errors
Index: subversion/tests/clients/cmdline/log_tests.py
===================================================================
--- subversion/tests/clients/cmdline/log_tests.py
+++ subversion/tests/clients/cmdline/log_tests.py	Tue Jul 30 05:08:09 2002
@@ -392,6 +392,43 @@
   os.chdir (was_cwd)
   return 0
+# Simple-minded test to check "svn log" on the degenerate
+# case with an empty repository
+def log_with_empty_repos(sbox):
+  "'svn log' with an empty repository"
+
+  # Create wc_dir and repo_dir
+  if os.path.exists(sbox.wc_dir):
+    svntest.main.remove_wc (sbox.wc_dir)
+  os.makedirs (sbox.wc_dir)
+
+  if os.path.exists (sbox.repo_dir):
+    svntest.main.remove_wc (sbox.repo_dir)
+  os.makedirs (sbox.repo_dir)
+
+  # Create virgin repos
+  svntest.main.create_repos (sbox.repo_dir)
+
+
+  was_cwd = os.getcwd ()
+  os.chdir (sbox.wc_dir)
+
+  url = "file:///" + was_cwd + "/" + sbox.repo_dir
+
+  stdout_lines, stderr_lines = \
+     svntest.main.run_svn (None, "checkout", url, ".")
+
+  if (len(stderr_lines) != 0):
+    os.chdir (was_cwd)
+    return 1
+
+  stdout_lines, stderr_lines = svntest.main.run_svn (None, "log")
+
+  if (len(stderr_lines) != 0):
+    os.chdir (was_cwd)
+    return 1
+  os.chdir (was_cwd)
+  return 0
 ########################################################################
 # Run the tests
@@ -401,6 +438,7 @@
 test_list = [ None,
               plain_log,
               versioned_log_message,
+              log_with_empty_repos,
              ]
 if __name__ == '__main__':
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 30 06:30:59 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.