Merge lp:~luoyonggang/subvertpy/closefile into lp:~jelmer/subvertpy/trunk

Proposed by Yonggang Luo
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 2428
Merged at revision: 2436
Proposed branch: lp:~luoyonggang/subvertpy/closefile
Merge into: lp:~jelmer/subvertpy/trunk
Diff against target: 38 lines (+8/-3)
1 file modified
subvertpy/tests/__init__.py (+8/-3)
To merge this branch: bzr merge lp:~luoyonggang/subvertpy/closefile
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+95117@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Merged, tweaked. Thanks for the patch.

review: Approve
lp:~luoyonggang/subvertpy/closefile updated
2429. By Yonggang Luo

There is one more file need to be closed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'subvertpy/tests/__init__.py'
2--- subvertpy/tests/__init__.py 2011-11-08 14:41:55 +0000
3+++ subvertpy/tests/__init__.py 2012-02-29 10:14:24 +0000
4@@ -209,6 +209,11 @@
5 def log_message_func(self, items):
6 return self.next_message
7
8+ def write_file(self, filename, content):
9+ f = open(filename, 'w')
10+ f.write(content)
11+ f.close()
12+
13 def make_repository(self, relpath, allow_revprop_changes=True):
14 """Create a repository.
15
16@@ -222,11 +227,11 @@
17 if sys.platform == 'win32':
18 revprop_hook = os.path.join(abspath, "hooks",
19 "pre-revprop-change.bat")
20- open(revprop_hook, 'w').write("exit 0\n")
21+ self.write_file(revprop_hook, "exit 0\n")
22 else:
23 revprop_hook = os.path.join(abspath, "hooks",
24 "pre-revprop-change")
25- open(revprop_hook, 'w').write("#!/bin/sh\n")
26+ self.write_file(revprop_hook, "#!/bin/sh\n")
27 os.chmod(revprop_hook, os.stat(revprop_hook).st_mode | 0111)
28
29 if sys.platform == 'win32':
30@@ -368,7 +373,7 @@
31 os.makedirs(os.path.dirname(f))
32 except OSError:
33 pass
34- open(f, 'w').write(files[f])
35+ self.write_file(f, files[f])
36
37 def make_client(self, repospath, clientpath, allow_revprop_changes=True):
38 """Create a repository and a checkout. Return the checkout.

Subscribers

People subscribed via source and target branches

to all changes: