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

  • Committer: Jelmer Vernooij
  • Date: 2019-03-04 05:10:44 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7294.
  • Revision ID: jelmer@jelmer.uk-20190304051044-vph4s8p9qvpy2qe9
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
        from .object_store import (
195
195
            get_object_store,
196
196
            )
197
 
        from . import gettext
 
197
        from ..i18n import gettext
198
198
        controldir, _ = ControlDir.open_containing(directory)
199
199
        repo = controldir.find_repository()
200
200
        object_store = get_object_store(repo)
201
201
        with object_store.lock_read():
202
202
            if sha1 is not None:
203
203
                try:
204
 
                    obj = object_store[str(sha1)]
 
204
                    obj = object_store[sha1.encode('ascii')]
205
205
                except KeyError:
206
206
                    raise BzrCommandError(
207
207
                        gettext("Object not found: %s") % sha1)
212
212
                self.outf.write(text)
213
213
            else:
214
214
                for sha1 in object_store:
215
 
                    self.outf.write("%s\n" % sha1)
 
215
                    self.outf.write("%s\n" % sha1.decode('ascii'))
216
216
 
217
217
 
218
218
class cmd_git_refs(Command):
265
265
        :param f: Patch file to read.
266
266
        :param signoff: Add Signed-Off-By flag.
267
267
        """
268
 
        from . import gettext
 
268
        from ..i18n import gettext
269
269
        from ..errors import BzrCommandError
270
270
        from dulwich.patch import git_am_patch_split
271
271
        import subprocess
278
278
        exitcode = p.wait()
279
279
        if exitcode != 0:
280
280
            raise BzrCommandError(gettext("error running patch"))
281
 
        message = c.message
 
281
        message = c.message.decode('utf-8')
282
282
        if signoff:
283
283
            signed_off_by = wt.branch.get_config().username()
284
 
            message += "Signed-off-by: %s\n" % signed_off_by.encode('utf-8')
285
 
        wt.commit(authors=[c.author], message=message)
 
284
            message += "Signed-off-by: %s\n" % (signed_off_by, )
 
285
        wt.commit(authors=[c.author.decode('utf-8')], message=message)
286
286
 
287
287
    def run(self, patches_list=None, signoff=False, force=False):
288
288
        from ..errors import UncommittedChanges