~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-17 18:55:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070217185558-mhsvsed3azztcuez
Track down and add tests that all tree.commit() can handle
non-ascii revision ids, as well as that file_ids_affected_by can handle
non-ascii revision ids. Also track down pending-merges needing to
write byte streams rather than unicode.

Show diffs side-by-side

added added

removed removed

Lines of Context:
544
544
                try:
545
545
                    revision_id = unescape_revid_cache[revision_id]
546
546
                except KeyError:
547
 
                    unescaped = unescape(revision_id)
 
547
                    # TODO: jam 20070217 For now, _unescape_xml return Unicode
 
548
                    #       revision ids, once we make file_ids utf8, then it
 
549
                    #       will return utf8 strings instead, and we can get
 
550
                    #       rid of this.
 
551
                    unescaped = osutils.safe_revision_id(unescape(revision_id))
548
552
                    unescape_revid_cache[revision_id] = unescaped
549
553
                    revision_id = unescaped
550
554
 
2081
2085
 
2082
2086
 
2083
2087
def _unescaper(match, _map=_unescape_map):
2084
 
    return _map[match.group(1)]
 
2088
    code = match.group(1)
 
2089
    try:
 
2090
        return _map[code]
 
2091
    except KeyError:
 
2092
        if not code.startswith('#'):
 
2093
            raise
 
2094
        return unichr(int(code[1:]))
2085
2095
 
2086
2096
 
2087
2097
_unescape_re = None