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

[PATCH] Enhance svn ls tests (Was: Re: 'svn ls' without argument)

From: Chris Stork <cstork_at_ics.uci.edu>
Date: 2003-04-03 01:06:00 CEST

Hi,

On Thu, Mar 27, 2003 at 08:56:30AM -0800, Matt Kraai wrote:
> On Thu, Mar 27, 2003 at 12:15:17PM +0100, Andreas J. Koenig wrote:
> > I'm a bit surprised that 'svn ls' without any argument doesn't list
> > the current directory:
...
> > Is this intended?
>
> No, I forgot to default to the current working directory when I
> added path support "svn ls". Fixed in revision 5485. Thanks for
> the report.

While reading this, I was wondering why the test suite didn't catch it.
So I took a look at it. :-)

The following is a patch that will catch this bug next time. It also
does an svn ls in the root and a nested dir of the wc. This might be of
importance in the future wrt the way svn maintains its metadata (.svn
per wc dir or one db file in wc root). Since I'm new here even this
simple patch might contain some mistakes. Feel free to nitpick!
(Although I did read HACKING, etc.)

-Chris

PS: As for introduction, I'm a grad student at UCI and I've been
administering our CVS repository for some time in the past. Since then
I've been desperately waiting for a valid replacement. Unfortunately, I
don't have too much time to contribute, but if I find some more spare
time I will go through the list/source some more. BTW, I'm highly
impressed by the way you guys work here! Great communication on the
list and very high coding standards. Congrats!

Log:

* subversion/tests/clients/cmdline/basic_tests.py (basic_ls): add test
  cases to check for `svn ls' of a directory (wc root & nested), and
  implicit current working directory (i.e. without argument)

Index: basic_tests.py
===================================================================
--- basic_tests.py (revision 5521)
+++ basic_tests.py (working copy)
@@ -1285,22 +1285,52 @@
 #----------------------------------------------------------------------
 
 def basic_ls(sbox):
- "basic ls of files"
+ "basic ls"
 
   sbox.build()
 
   wc_dir = sbox.wc_dir
 
- mu_path = os.path.join(wc_dir, 'A', 'mu')
+ svntest.actions.run_and_verify_svn("list the root of working copy",
+ ["A/\n", "iota\n"],
+ None, 'ls',
+ ###TODO is user/pass really necessary?
+ '--username', svntest.main.wc_author,
+ '--password', svntest.main.wc_passwd,
+ wc_dir)
 
- svntest.actions.run_and_verify_svn(None, ["mu\n"],
+ A_path = os.path.join(wc_dir, 'A')
+
+ svntest.actions.run_and_verify_svn("list a working copy directory",
+ ["B/\n", "C/\n", "D/\n", "mu\n"],
                                      None, 'ls',
                                      ###TODO is user/pass really necessary?
                                      '--username', svntest.main.wc_author,
                                      '--password', svntest.main.wc_passwd,
+ A_path)
+
+ mu_path = os.path.join(A_path, 'mu')
+
+ svntest.actions.run_and_verify_svn("list a working copy file", ["mu\n"],
+ None, 'ls',
+ ###TODO is user/pass really necessary?
+ '--username', svntest.main.wc_author,
+ '--password', svntest.main.wc_passwd,
                                      mu_path)
 
+ cwd = os.getcwd()
+ try:
+ os.chdir(wc_dir)
+ svntest.actions.run_and_verify_svn("list current working directory",
+ ["A/\n", "iota\n"],
+ None, 'ls',
+ ###TODO is user/pass really necessary?
+ '--username', svntest.main.wc_author,
+ '--password', svntest.main.wc_passwd)
+ finally:
+ os.chdir(cwd)
 
+
 #----------------------------------------------------------------------
 def nonexistent_repository(sbox):
   "'svn log file:///nonexistent_path' should fail"

-- 
Chris Stork (PhD student at UC Irvine)  http://www.ics.uci.edu/~cstork/
OpenPGP fingerprint: B08B 602C C806 C492 D069  021E 41F3 8C8D 50F9 CA2F
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Apr 3 01:06:49 2003

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