Rev 6520: Merge the get_file_text cleanup. in http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

John Arbash Meinel john at arbash-meinel.com
Thu Sep 6 11:20:38 UTC 2012


At http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

------------------------------------------------------------
revno: 6520 [merge]
revision-id: john at arbash-meinel.com-20120906112013-x4s069psvr4f8mvh
parent: john at arbash-meinel.com-20120906111935-m4p8prgxohkg9ywy
parent: john at arbash-meinel.com-20120906073859-mcqkevttsx7zd4ma
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.5-remote-wt-tests-1046697
timestamp: Thu 2012-09-06 15:20:13 +0400
message:
  Merge the get_file_text cleanup.
  
  There were a few tests that fail because the filtered content ends up
  coming back as the empty string, rather than actually coming back with
  content. Obviously, we want content :).
modified:
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
-------------- next part --------------
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2012-09-06 10:27:16 +0000
+++ b/bzrlib/workingtree_4.py	2012-09-06 11:20:13 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2011 Canonical Ltd
+# Copyright (C) 2007-2012 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1886,8 +1886,19 @@
         return self.inventory[file_id].text_size
 
     def get_file_text(self, file_id, path=None):
-        _, content = list(self.iter_files_bytes([(file_id, None)]))[0]
-        return ''.join(content)
+        full_content = None
+        for _, content in self.iter_files_bytes([(file_id, None)]):
+            if full_content is not None:
+                raise AssertionError('iter_files_bytes returned'
+                    ' too many entries')
+            # For each entry returned by iter_files_bytes, we must consume the
+            # content before we step the iterator.
+            full_content = ''.join(content)
+            del content
+        if full_content is None:
+            raise AssertionError('iter_files_bytes did not return'
+                ' the requested data')
+        return full_content
 
     def get_reference_revision(self, file_id, path=None):
         return self.inventory[file_id].reference_revision

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2012-08-01 08:51:57 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2012-09-06 07:38:59 +0000
@@ -35,6 +35,10 @@
 * ``bzr config`` properly handles aliases and references in the
   ``--directory`` parameter (Vincent Ladeuil, Wouter van Heyst, #947049)
 
+* Lightweight checkouts of remote repositories had a bug with how they
+  extracted texts from the repository. (Just an ordering constraint on how
+  they consumed the stream.) (John Arbash Meinel, #1046284)
+
 * Revert use of --no-tty when gpg signing commits. (Jelmer Vernooij, #1014570)
 
 Documentation



More information about the bazaar-commits mailing list