/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/plugins/git/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-15 19:05:51 UTC
  • mfrom: (6968 work)
  • mto: (6973.5.1 python3-c)
  • mto: This revision was merged to the branch mainline in revision 6984.
  • Revision ID: jelmer@jelmer.uk-20180515190551-epr5abd0mtxmrehr
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from __future__ import absolute_import
21
21
 
22
 
from cStringIO import StringIO
 
22
from io import BytesIO
23
23
from collections import defaultdict
24
24
 
25
25
from dulwich.objects import (
397
397
    def _set_nick(self, nick):
398
398
        cf = self.repository._git.get_config()
399
399
        cf.set((b"branch", self.name.encode('utf-8')), b"nick", nick.encode("utf-8"))
400
 
        f = StringIO()
 
400
        f = BytesIO()
401
401
        cf.write_to_file(f)
402
402
        self.repository._git._put_named_file('config', f.getvalue())
403
403
 
480
480
        else:
481
481
            # TODO(jelmer): Maybe unset rather than setting to HEAD?
482
482
            cs.set((b"remote", b"origin"), b"merge", 'HEAD')
483
 
        f = StringIO()
 
483
        f = BytesIO()
484
484
        cs.write_to_file(f)
485
485
        self.repository._git._put_named_file('config', f.getvalue())
486
486
 
638
638
        self._last_revision_info_cache = revno, revision_id
639
639
 
640
640
    def set_last_revision(self, revid):
641
 
        if not revid or not isinstance(revid, basestring):
 
641
        if not revid or not isinstance(revid, bytes):
642
642
            raise errors.InvalidRevisionId(revision_id=revid, branch=self)
643
643
        if revid == NULL_REVISION:
644
644
            newhead = None