Rev 1649: Fix tests. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Mon Aug 25 02:32:48 BST 2008


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

------------------------------------------------------------
revno: 1649
revision-id: jelmer at samba.org-20080825013246-fgsbl340zifzsbfc
parent: jelmer at samba.org-20080825013242-dwspr8d9fm10c681
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-08-25 03:32:46 +0200
message:
  Fix tests.
modified:
  tags.py                        tags.py-20080822211316-scblu3akdvu0b64c-1
=== modified file 'tags.py'
--- a/tags.py	2008-08-24 15:22:40 +0000
+++ b/tags.py	2008-08-25 01:32:46 +0000
@@ -76,7 +76,7 @@
         conn = self.repository.transport.connections.get(urlutils.join(self.repository.base, parent))
         deletefirst = (conn.check_path(urlutils.basename(path), self.repository.get_latest_revnum()) != core.NODE_NONE)
         try:
-            ci = conn.get_commit_editor({properties.PROP_REVISION_LOG: "Add tag %s" % tag_name})
+            ci = conn.get_commit_editor({properties.PROP_REVISION_LOG: "Add tag %s" % tag_name.encode("utf-8")})
             try:
                 root = ci.open_root()
                 if deletefirst:
@@ -117,10 +117,10 @@
         path = self.branch.layout.get_tag_path(tag_name, self.branch.project)
         parent = urlutils.dirname(path)
         conn = self.repository.transport.connections.get(urlutils.join(self.repository.base, parent))
-        if conn.check_path(urlutils.basename(path), self.repository.get_latest_revnum()) != core.NODE_DIR:
-            raise NoSuchTag(tag_name)
         try:
-            ci = conn.get_commit_editor({properties.PROP_REVISION_LOG: "Remove tag %s" % tag_name})
+            if conn.check_path(urlutils.basename(path), self.repository.get_latest_revnum()) != core.NODE_DIR:
+                raise NoSuchTag(tag_name)
+            ci = conn.get_commit_editor({properties.PROP_REVISION_LOG: "Remove tag %s" % tag_name.encode("utf-8")})
             try:
                 root = ci.open_root()
                 root.delete_entry(urlutils.basename(path))
@@ -130,6 +130,7 @@
                 raise
             ci.close()
         finally:
+            assert not conn.busy
             self.repository.transport.add_connection(conn)
 
     def _set_tag_dict(self, dest_dict):




More information about the bazaar-commits mailing list