Rev 6363: (jelmer) Remove support for the .bzr/branch/email file. (Jelmer Vernooij) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Wed Dec 14 00:18:55 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6363 [merge]
revision-id: pqm at pqm.ubuntu.com-20111214001855-ajelhw5zfmkcuii6
parent: pqm at pqm.ubuntu.com-20111212151207-xiz0tu02z1hxrq76
parent: jelmer at samba.org-20111213204736-fde4hm1jd053ivra
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-12-14 00:18:55 +0000
message:
  (jelmer) Remove support for the .bzr/branch/email file. (Jelmer Vernooij)
modified:
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
  bzrlib/tests/blackbox/test_sign_my_commits.py test_sign_my_commits.py-20060215152957-270238a1ffacc841
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-12-09 16:15:52 +0000
+++ b/bzrlib/config.py	2011-12-13 20:02:33 +0000
@@ -1396,13 +1396,6 @@
         e.g. "John Hacker <jhacker at example.com>"
         This is looked up in the email controlfile for the branch.
         """
-        try:
-            return (self.branch._transport.get_bytes("email")
-                    .decode(osutils.get_user_encoding())
-                    .rstrip("\r\n"))
-        except (errors.NoSuchFile, errors.PermissionDenied), e:
-            pass
-
         return self._get_best_value('_get_user_id')
 
     def _get_change_editor(self):

=== modified file 'bzrlib/tests/blackbox/test_commit.py'
--- a/bzrlib/tests/blackbox/test_commit.py	2011-12-05 16:55:20 +0000
+++ b/bzrlib/tests/blackbox/test_commit.py	2011-12-13 20:05:37 +0000
@@ -873,4 +873,4 @@
         # being too low. If rpc_count increases, more network roundtrips have
         # become necessary for this use case. Please do not adjust this number
         # upwards without agreement from bzr's network support maintainers.
-        self.assertLength(220, self.hpss_calls)
+        self.assertLength(213, self.hpss_calls)

=== modified file 'bzrlib/tests/blackbox/test_sign_my_commits.py'
--- a/bzrlib/tests/blackbox/test_sign_my_commits.py	2011-11-28 14:18:56 +0000
+++ b/bzrlib/tests/blackbox/test_sign_my_commits.py	2011-12-13 20:05:37 +0000
@@ -164,7 +164,7 @@
         # being too low. If rpc_count increases, more network roundtrips have
         # become necessary for this use case. Please do not adjust this number
         # upwards without agreement from bzr's network support maintainers.
-        self.assertLength(54, self.hpss_calls)
+        self.assertLength(51, self.hpss_calls)
 
     def test_verify_commits(self):
         self.setup_smart_server_with_call_log()

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-12-09 16:15:52 +0000
+++ b/bzrlib/tests/test_config.py	2011-12-13 20:47:36 +0000
@@ -328,13 +328,13 @@
 
 class FakeBranch(object):
 
-    def __init__(self, base=None, user_id=None):
+    def __init__(self, base=None):
         if base is None:
             self.base = "http://example.com/branches/demo"
         else:
             self.base = base
         self._transport = self.control_files = \
-            FakeControlFilesAndTransport(user_id=user_id)
+            FakeControlFilesAndTransport()
 
     def _get_config(self):
         return config.TransportConfig(self._transport, 'branch.conf')
@@ -348,16 +348,10 @@
 
 class FakeControlFilesAndTransport(object):
 
-    def __init__(self, user_id=None):
+    def __init__(self):
         self.files = {}
-        if user_id:
-            self.files['email'] = user_id
         self._transport = self
 
-    def get_utf8(self, filename):
-        # from LockableFiles
-        raise AssertionError("get_utf8 should no longer be used")
-
     def get(self, filename):
         # from Transport
         try:
@@ -1761,24 +1755,14 @@
         return my_config
 
     def test_user_id(self):
-        branch = FakeBranch(user_id='Robert Collins <robertc at example.net>')
+        branch = FakeBranch()
         my_config = config.BranchConfig(branch)
-        self.assertEqual("Robert Collins <robertc at example.net>",
-                         my_config.username())
+        self.assertIsNot(None, my_config.username())
         my_config.branch.control_files.files['email'] = "John"
         my_config.set_user_option('email',
                                   "Robert Collins <robertc at example.org>")
-        self.assertEqual("John", my_config.username())
-        del my_config.branch.control_files.files['email']
         self.assertEqual("Robert Collins <robertc at example.org>",
-                         my_config.username())
-
-    def test_not_set_in_branch(self):
-        my_config = self.get_branch_config(global_config=sample_config_text)
-        self.assertEqual(u"Erik B\u00e5gfors <erik at bagfors.nu>",
-                         my_config._get_user_id())
-        my_config.branch.control_files.files['email'] = "John"
-        self.assertEqual("John", my_config._get_user_id())
+                        my_config.username())
 
     def test_BZR_EMAIL_OVERRIDES(self):
         self.overrideEnv('BZR_EMAIL', "Robert Collins <robertc at example.org>")

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-12-12 13:44:20 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-12-13 20:26:39 +0000
@@ -15,6 +15,10 @@
 
 .. These may require users to change the way they use Bazaar.
 
+* The '.bzr/branch/email' file is no longer read to determine the users'
+  identity. Instead, the 'email' setting in '.bzr/branch/branch.conf'
+  should be used. (Jelmer Vernooij, #903894)
+
 New Features
 ************
 




More information about the bazaar-commits mailing list