~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/text.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-19 10:58:39 UTC
  • mfrom: (6383 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6386.
  • Revision ID: jelmer@canonical.com-20111219105839-uji05ck4rkm1mj4j
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
"""A store that keeps the full text of every version.
18
20
 
19
21
This store keeps uncompressed versions of the full text. It does not
118
120
        # so buffer them in a StringIO instead
119
121
        if getattr(f, 'tell', None) is not None:
120
122
            return gzip.GzipFile(mode='rb', fileobj=f)
121
 
        else:
 
123
        try:
122
124
            from cStringIO import StringIO
123
125
            sio = StringIO(f.read())
124
126
            return gzip.GzipFile(mode='rb', fileobj=sio)
 
127
        finally:
 
128
            f.close()