Rev 1424: Use connection management API when obtaining commit editor. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Wed Jul 2 01:25:11 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/trunk

------------------------------------------------------------
revno: 1424
revision-id: jelmer at samba.org-20080702002510-vthyzwxslw3ayahw
parent: jelmer at samba.org-20080702002150-sgz37h2nfeiy2ihp
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-07-02 02:25:10 +0200
message:
  Use connection management API when obtaining commit editor.
modified:
  mapping3/__init__.py           __init__.py-20080502174630-9324zh25kka98vlw-1
=== modified file 'mapping3/__init__.py'
--- a/mapping3/__init__.py	2008-07-01 19:34:43 +0000
+++ b/mapping3/__init__.py	2008-07-02 00:25:10 +0000
@@ -137,14 +137,18 @@
 
 
 def set_property_scheme(repository, scheme):
-    editor = repository.transport.get_commit_editor(
+    conn = repository.transport.get_connection()
+    try:
+        editor = conn.get_commit_editor(
             {properties.PROP_REVISION_LOG: "Updating branching scheme for Bazaar."},
             None, None, False)
-    root = editor.open_root()
-    root.change_prop(SVN_PROP_BZR_BRANCHING_SCHEME, 
-            "".join(map(lambda x: x+"\n", scheme.branch_list)).encode("utf-8"))
-    root.close()
-    editor.close()
+        root = editor.open_root()
+        root.change_prop(SVN_PROP_BZR_BRANCHING_SCHEME, 
+                "".join(map(lambda x: x+"\n", scheme.branch_list)).encode("utf-8"))
+        root.close()
+        editor.close()
+    finally:
+        repository.transport.add_connection(conn)
 
 
 def repository_guess_scheme(repository, last_revnum, branch_path=None):




More information about the bazaar-commits mailing list