Rev 4850: Remove useless StringIO. in file:///home/vila/src/bzr/bugs/525571-minimal-lock-bazaar-conf-files/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Jul 2 16:56:31 BST 2010


At file:///home/vila/src/bzr/bugs/525571-minimal-lock-bazaar-conf-files/

------------------------------------------------------------
revno: 4850
revision-id: v.ladeuil+lp at free.fr-20100702155631-bgvt52qbayf1m0wc
parent: v.ladeuil+lp at free.fr-20100702143906-se1tm1vtvz8y47fp
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 525571-minimal-lock-bazaar-conf-files
timestamp: Fri 2010-07-02 17:56:31 +0200
message:
  Remove useless StringIO.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2010-07-02 14:39:06 +0000
+++ b/bzrlib/config.py	2010-07-02 15:56:31 +0000
@@ -511,10 +511,8 @@
         self._write_config_file()
 
     def _write_config_file(self):
-        f = StringIO()
-        self._get_parser().write(f)
         atomic_file = atomicfile.AtomicFile(self._get_filename())
-        atomic_file.write(f.getvalue())
+        self._get_parser().write(atomic_file)
         atomic_file.commit()
         atomic_file.close()
 
@@ -657,10 +655,8 @@
         self._get_parser()[location][option]=value
         # the allowed values of store match the config policies
         self._set_option_policy(location, option, store)
-        f = StringIO()
-        self._get_parser().write(f)
         atomic_file = atomicfile.AtomicFile(self._get_filename())
-        atomic_file.write(f.getvalue())
+        self._get_parser().write(atomic_file)
         atomic_file.commit()
         atomic_file.close()
 



More information about the bazaar-commits mailing list