Merge lp:~jelmer/brz/patch-silent into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/patch-silent
Merge into: lp:brz
Prerequisite: lp:~jelmer/brz/import-patch
Diff against target: 59 lines (+5/-11)
3 files modified
breezy/builtins.py (+2/-1)
breezy/git/commands.py (+2/-9)
breezy/tests/blackbox/test_resolve_location.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/brz/patch-silent
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+365620@code.launchpad.net

This proposal supersedes a proposal from 2019-04-06.

Commit message

Use standard patch functions in "bzr git-apply".

Description of the change

Use standard patch functions in "bzr git-apply".

This stops patch output from leaking to stderr during test runs.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/builtins.py'
2--- breezy/builtins.py 2019-06-01 01:19:21 +0000
3+++ breezy/builtins.py 2019-06-02 05:15:06 +0000
4@@ -7005,6 +7005,7 @@
5 """Apply a named patch to the current tree.
6
7 """
8+
9 takes_args = ['filename?']
10 takes_options = [Option('strip', type=int, short_name='p',
11 help=("Strip the smallest prefix containing num "
12@@ -7040,7 +7041,7 @@
13 from .location import location_to_url
14 url = location_to_url(location)
15 display_url = urlutils.unescape_for_display(url, self.outf.encoding)
16- self.outf.write('%s\n' % url)
17+ self.outf.write('%s\n' % display_url)
18
19
20 def _register_lazy_builtins():
21
22=== modified file 'breezy/git/commands.py'
23--- breezy/git/commands.py 2019-02-10 23:12:06 +0000
24+++ breezy/git/commands.py 2019-06-02 05:15:06 +0000
25@@ -265,19 +265,12 @@
26 :param f: Patch file to read.
27 :param signoff: Add Signed-Off-By flag.
28 """
29- from ..i18n import gettext
30- from ..errors import BzrCommandError
31 from dulwich.patch import git_am_patch_split
32- import subprocess
33+ from breezy.patch import patch_tree
34 (c, diff, version) = git_am_patch_split(f)
35 # FIXME: Cope with git-specific bits in patch
36 # FIXME: Add new files to working tree
37- p = subprocess.Popen(["patch", "-p1"], stdin=subprocess.PIPE,
38- cwd=wt.basedir)
39- p.communicate(diff)
40- exitcode = p.wait()
41- if exitcode != 0:
42- raise BzrCommandError(gettext("error running patch"))
43+ patch_tree(wt, [diff], strip=1, out=self.outf)
44 message = c.message.decode('utf-8')
45 if signoff:
46 signed_off_by = wt.branch.get_config().username()
47
48=== modified file 'breezy/tests/blackbox/test_resolve_location.py'
49--- breezy/tests/blackbox/test_resolve_location.py 2019-02-24 00:57:44 +0000
50+++ breezy/tests/blackbox/test_resolve_location.py 2019-06-02 05:15:06 +0000
51@@ -24,7 +24,7 @@
52 wt = self.make_branch_and_tree('.')
53
54 out, err = self.run_bzr('resolve-location %s' % wt.branch.user_url)
55- self.assertEqual(out, '%s\n' % wt.branch.user_url)
56+ self.assertEqual(out, '%s\n' % wt.branch.user_url.replace('file://', ''))
57
58 def test_parent_missing(self):
59 wt = self.make_branch_and_tree('.')

Subscribers

People subscribed via source and target branches