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

[PATCH] use svntest.main.file_write whereever it makes sense

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-11-29 11:09:03 CET

Hi All,
Find the attached patch and log.

With regards
Kamesh Jayachandran

[[[

Use 'svntest.main.file_write' rather than explicitly open/write/close.

* subversion/tests/cmdline/svntest/main.py
  (create_config_dir):
  (Sandbox._set_name):
   As explained in the above summary.

* subversion/tests/cmdline/svntest/actions.py
  (setup_pristine_repository):
   As explained in the above summary.

Patch by: Kamesh Jayachandran <kamesh@collab.net>
]]]

Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py (revision 22500)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -317,15 +317,10 @@
   if not os.path.isdir(cfgdir):
     os.makedirs(cfgdir)
 
- fd = open(cfgfile_cfg, 'w')
- fd.write(config_contents)
- fd.close()
+ file_write(cfgfile_cfg, config_contents)
+ file_write(cfgfile_srv, server_contents)
 
- fd = open(cfgfile_srv, 'w')
- fd.write(server_contents)
- fd.close()
 
-
 # For running subversion and returning the output
 def run_svn(error_expected, *varargs):
   """Run svn with VARARGS; return stdout, stderr as lists of lines.
@@ -593,9 +588,7 @@
       if not os.path.exists(work_dir):
         os.makedirs(work_dir)
       self.authz_file = os.path.join(work_dir, "authz")
- fp = open(self.authz_file, "w")
- fp.write("[/]\n* = rw\n")
- fp.close()
+ file_write(self.authz_file, "[/]\n* = rw\n")
 
     # For svnserve tests we have a per-repository authz file, and it
     # doesn't need to be there in order for things to work, so we don't
Index: subversion/tests/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/cmdline/svntest/actions.py (revision 22500)
+++ subversion/tests/cmdline/svntest/actions.py (working copy)
@@ -69,9 +69,7 @@
     # if this is dav, gives us access rights to import the greek tree.
     if main.is_ra_type_dav():
       authz_file = os.path.join(main.work_dir, "authz")
- fp = open(authz_file, "w")
- fp.write("[/]\n* = rw\n")
- fp.close()
+ svntest.main.file_write(authz_file, "[/]\n* = rw\n")
 
     # dump the greek tree to disk.
     main.greek_state.write_to_disk(main.greek_dump_dir)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 29 11:09:16 2006

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