/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-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
        :param f: Patch file to read.
266
266
        :param signoff: Add Signed-Off-By flag.
267
267
        """
268
 
        from ..i18n import gettext
269
 
        from ..errors import BzrCommandError
270
268
        from dulwich.patch import git_am_patch_split
271
 
        import subprocess
 
269
        from breezy.patch import patch_tree
272
270
        (c, diff, version) = git_am_patch_split(f)
273
271
        # FIXME: Cope with git-specific bits in patch
274
272
        # FIXME: Add new files to working tree
275
 
        p = subprocess.Popen(["patch", "-p1"], stdin=subprocess.PIPE,
276
 
                             cwd=wt.basedir)
277
 
        p.communicate(diff)
278
 
        exitcode = p.wait()
279
 
        if exitcode != 0:
280
 
            raise BzrCommandError(gettext("error running patch"))
 
273
        patch_tree(wt, [diff], strip=1, out=self.outf)
281
274
        message = c.message.decode('utf-8')
282
275
        if signoff:
283
276
            signed_off_by = wt.branch.get_config().username()