Rev 4971: Be windows-friendly and don't left opened files behind. in file:///home/vila/src/bzr/bugs/476293-log-check-ancestor/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Jan 22 07:47:18 GMT 2010


At file:///home/vila/src/bzr/bugs/476293-log-check-ancestor/

------------------------------------------------------------
revno: 4971
revision-id: v.ladeuil+lp at free.fr-20100122074718-fx28xjovo3ekj8om
parent: v.ladeuil+lp at free.fr-20100121181508-wqciwy39018jinph
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: respect-direction
timestamp: Fri 2010-01-22 08:47:18 +0100
message:
  Be windows-friendly and don't left opened files behind.
  
  * bzrlib/tests/test_log.py:
  (TestCaseForLogFormatter.make_commits_with_trailing_newlines): Fix
  file handle left open.
  
  * bzrlib/tests/blackbox/test_log.py:
  (TestLogEncodings.create_branch): Fix file handle left open.
-------------- next part --------------
=== modified file 'bzrlib/tests/blackbox/test_log.py'
--- a/bzrlib/tests/blackbox/test_log.py	2010-01-21 16:02:48 +0000
+++ b/bzrlib/tests/blackbox/test_log.py	2010-01-22 07:47:18 +0000
@@ -646,7 +646,7 @@
     def create_branch(self):
         bzr = self.run_bzr
         bzr('init')
-        open('a', 'wb').write('some stuff\n')
+        self.build_tree_contents([('a', 'some stuff\n')])
         bzr('add a')
         bzr(['commit', '-m', self._message])
 

=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py	2010-01-21 18:15:08 +0000
+++ b/bzrlib/tests/test_log.py	2010-01-22 07:47:18 +0000
@@ -76,19 +76,18 @@
         """Helper method for LogFormatter tests"""
         b = wt.branch
         b.nick = 'test'
-        open('a', 'wb').write('hello moto\n')
-        wt.add('a')
+        self.build_tree_contents([('a', 'hello moto\n')])
         wt.commit('simple log message', rev_id='a1',
                   timestamp=1132586655.459960938, timezone=-6*3600,
                   committer='Joe Foo <joe at foo.com>')
-        open('b', 'wb').write('goodbye\n')
+        self.build_tree_contents([('b', 'goodbye\n')])
         wt.add('b')
         wt.commit('multiline\nlog\nmessage\n', rev_id='a2',
                   timestamp=1132586842.411175966, timezone=-6*3600,
                   committer='Joe Foo <joe at foo.com>',
                   authors=['Joe Bar <joe at bar.com>'])
 
-        open('c', 'wb').write('just another manic monday\n')
+        self.build_tree_contents([('c', 'just another manic monday\n')])
         wt.add('c')
         wt.commit('single line with trailing newline\n', rev_id='a3',
                   timestamp=1132587176.835228920, timezone=-6*3600,



More information about the bazaar-commits mailing list