/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/rio.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 
19
17
# \subsection{\emph{rio} - simple text metaformat}
20
18
#
21
19
# \emph{r} stands for `restricted', `reproducible', or `rfc822-like'.
36
34
 
37
35
from . import osutils
38
36
from .iterablefile import IterableFile
39
 
from .sixish import (
40
 
    text_type,
41
 
    )
42
37
 
43
38
# XXX: some redundancy is allowing to write stanzas in isolation as well as
44
39
# through a writer object.
139
134
            raise ValueError("invalid tag %r" % (tag,))
140
135
        if isinstance(value, bytes):
141
136
            value = value.decode('ascii')
142
 
        elif isinstance(value, text_type):
 
137
        elif isinstance(value, str):
143
138
            pass
144
139
        else:
145
140
            raise TypeError("invalid type for rio value: %r of type %s"
189
184
        result = []
190
185
        for text_tag, text_value in self.items:
191
186
            tag = text_tag.encode('ascii')
192
 
            value = text_value.encode('utf-8')
 
187
            value = text_value.encode('utf-8', 'surrogateescape')
193
188
            if value == b'':
194
189
                result.append(tag + b': \n')
195
190
            elif b'\n' in value: