Merge lp:~jelmer/brz/quilt-more 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/quilt-more
Merge into: lp:brz
Diff against target: 115 lines (+53/-5)
3 files modified
breezy/plugins/quilt/quilt.py (+8/-2)
breezy/plugins/quilt/tests/test_wrapper.py (+17/-1)
breezy/plugins/quilt/wrapper.py (+28/-2)
To merge this branch: bzr merge lp:~jelmer/brz/quilt-more
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+371831@code.launchpad.net

Commit message

Add quilt_delete call.

Description of the change

Add quilt_delete call.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve
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
=== modified file 'breezy/plugins/quilt/quilt.py'
--- breezy/plugins/quilt/quilt.py 2019-06-16 13:10:54 +0000
+++ breezy/plugins/quilt/quilt.py 2019-08-31 10:25:49 +0000
@@ -83,12 +83,18 @@
83 series_file=self.series_file, quiet=quiet, force=force,83 series_file=self.series_file, quiet=quiet, force=force,
84 refresh=refresh)84 refresh=refresh)
8585
86 def push(self, patch, quiet=None):86 def push(self, patch, quiet=None, force=None, refresh=None):
87 return wrapper.quilt_push(87 return wrapper.quilt_push(
88 self.tree.basedir, patch, patches_dir=self.patches_dir,88 self.tree.basedir, patch, patches_dir=self.patches_dir,
89 series_file=self.series_file, quiet=quiet)89 series_file=self.series_file, quiet=quiet, force=force,
90 refresh=refresh)
9091
91 def pop(self, patch, quiet=None):92 def pop(self, patch, quiet=None):
92 return wrapper.quilt_pop(93 return wrapper.quilt_pop(
93 self.tree.basedir, patch, patches_dir=self.patches_dir,94 self.tree.basedir, patch, patches_dir=self.patches_dir,
94 series_file=self.series_file, quiet=quiet)95 series_file=self.series_file, quiet=quiet)
96
97 def delete(self, patch, remove=False):
98 return wrapper.quilt_delete(
99 self.tree.basedir, patch, patches_dir=self.patches_dir,
100 series_file=self.series_file, remove=remove)
95101
=== modified file 'breezy/plugins/quilt/tests/test_wrapper.py'
--- breezy/plugins/quilt/tests/test_wrapper.py 2019-06-15 11:47:16 +0000
+++ breezy/plugins/quilt/tests/test_wrapper.py 2019-08-31 10:25:49 +0000
@@ -23,6 +23,7 @@
23import os23import os
2424
25from ..wrapper import (25from ..wrapper import (
26 quilt_delete,
26 quilt_pop_all,27 quilt_pop_all,
27 quilt_applied,28 quilt_applied,
28 quilt_unapplied,29 quilt_unapplied,
@@ -71,7 +72,7 @@
71 self.make_empty_quilt_dir("source")72 self.make_empty_quilt_dir("source")
72 quilt_push_all("source", quiet=True)73 quilt_push_all("source", quiet=True)
7374
74 def test_poph_all_empty(self):75 def test_pop_all_empty(self):
75 self.make_empty_quilt_dir("source")76 self.make_empty_quilt_dir("source")
76 quilt_pop_all("source", quiet=True)77 quilt_pop_all("source", quiet=True)
7778
@@ -97,3 +98,18 @@
97 ("source/patches/patch2.diff", "bazb ar")])98 ("source/patches/patch2.diff", "bazb ar")])
98 self.assertEquals(["patch1.diff", "patch2.diff"],99 self.assertEquals(["patch1.diff", "patch2.diff"],
99 quilt_unapplied("source", "patches"))100 quilt_unapplied("source", "patches"))
101
102 def test_delete(self):
103 source = self.make_empty_quilt_dir("source")
104 self.build_tree_contents([
105 ("source/patches/series", "patch1.diff\npatch2.diff"),
106 ("source/patches/patch1.diff", "foob ar"),
107 ("source/patches/patch2.diff", "bazb ar")])
108 quilt_delete("source", "patch1.diff", "patches", remove=False)
109 self.assertEqual(
110 ['patch2.diff'],
111 quilt_series(source, 'patches/series'))
112 quilt_delete("source", "patch2.diff", "patches", remove=True)
113 self.assertTrue(os.path.exists('source/patches/patch1.diff'))
114 self.assertFalse(os.path.exists('source/patches/patch2.diff'))
115 self.assertEqual([], quilt_series(source, 'patches/series'))
100116
=== modified file 'breezy/plugins/quilt/wrapper.py'
--- breezy/plugins/quilt/wrapper.py 2019-06-16 13:10:54 +0000
+++ breezy/plugins/quilt/wrapper.py 2019-08-31 10:25:49 +0000
@@ -159,19 +159,45 @@
159 patches_dir=patches_dir, series_file=series_file, quiet=quiet)159 patches_dir=patches_dir, series_file=series_file, quiet=quiet)
160160
161161
162def quilt_push(working_dir, patch, patches_dir=None, series_file=None, quiet=None):162def quilt_push(working_dir, patch, patches_dir=None, series_file=None,
163 quiet=None, force=False, refresh=False):
163 """Push a patch.164 """Push a patch.
164165
165 :param working_dir: Directory to work in166 :param working_dir: Directory to work in
166 :param patch: Patch to push167 :param patch: Patch to push
167 :param patches_dir: Optional patches directory168 :param patches_dir: Optional patches directory
168 :param series_file: Optional series file169 :param series_file: Optional series file
170 :param force: Force push
171 :param refresh: Refresh
169 """172 """
173 args = []
174 if force:
175 args.append("-f")
176 if refresh:
177 args.append("--refresh")
170 return run_quilt(178 return run_quilt(
171 ["push", patch], working_dir=working_dir,179 ["push", patch] + args, working_dir=working_dir,
172 patches_dir=patches_dir, series_file=series_file, quiet=quiet)180 patches_dir=patches_dir, series_file=series_file, quiet=quiet)
173181
174182
183def quilt_delete(working_dir, patch, patches_dir=None, series_file=None,
184 remove=False):
185 """Delete a patch.
186
187 :param working_dir: Directory to work in
188 :param patch: Patch to push
189 :param patches_dir: Optional patches directory
190 :param series_file: Optional series file
191 :param remove: Remove the patch file as well
192 """
193 args = []
194 if remove:
195 args.append("-r")
196 return run_quilt(
197 ["delete", patch] + args, working_dir=working_dir,
198 patches_dir=patches_dir, series_file=series_file)
199
200
175def quilt_upgrade(working_dir):201def quilt_upgrade(working_dir):
176 return run_quilt(["upgrade"], working_dir=working_dir)202 return run_quilt(["upgrade"], working_dir=working_dir)
177203

Subscribers

People subscribed via source and target branches