/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/bzr/xml8.py

  • Committer: Jelmer Vernooij
  • Date: 2020-06-08 23:03:56 UTC
  • mto: (7490.40.2 work)
  • mto: This revision was merged to the branch mainline in revision 7511.
  • Revision ID: jelmer@jelmer.uk-20200608230356-a4clct7auuvhbfep
Fix handling of a particular kind of broken committer id.

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
 
17
19
from io import BytesIO
18
20
 
19
21
from .. import (
34
36
    unpack_inventory_flat,
35
37
    )
36
38
from ..revision import Revision
 
39
from ..sixish import unichr
37
40
from ..errors import BzrError
38
41
 
39
42
 
53
56
    except KeyError:
54
57
        if not code.startswith(b'#'):
55
58
            raise
56
 
        return chr(int(code[1:])).encode('utf8')
 
59
        return unichr(int(code[1:])).encode('utf8')
57
60
 
58
61
 
59
62
_unescape_re = lazy_regex.lazy_compile(b'\\&([^;]*);')
241
244
                       revision_id=get_cached(elt.get('revision_id')),
242
245
                       inventory_sha1=elt.get('inventory_sha1').encode('ascii')
243
246
                       )
244
 
        parents = elt.find('parents')
245
 
        if parents is not None:
246
 
            for p in parents:
247
 
                rev.parent_ids.append(get_cached(p.get('revision_id')))
 
247
        parents = elt.find('parents') or []
 
248
        for p in parents:
 
249
            rev.parent_ids.append(get_cached(p.get('revision_id')))
248
250
        self._unpack_revision_properties(elt, rev)
249
251
        v = elt.get('timezone')
250
252
        if v is None: