Merge lp:~jelmer/brz/quilt-fix 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-fix
Merge into: lp:brz
Diff against target: 46 lines (+15/-4)
2 files modified
breezy/plugins/quilt/tests/test_wrapper.py (+8/-0)
breezy/plugins/quilt/wrapper.py (+7/-4)
To merge this branch: bzr merge lp:~jelmer/brz/quilt-fix
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+375653@code.launchpad.net

Commit message

Don't strip directory name when determining unapplied patches.

Description of the change

Don't strip directory name when determining unapplied patches.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/quilt/tests/test_wrapper.py'
2--- breezy/plugins/quilt/tests/test_wrapper.py 2019-08-26 22:01:15 +0000
3+++ breezy/plugins/quilt/tests/test_wrapper.py 2019-11-18 04:31:38 +0000
4@@ -90,6 +90,14 @@
5 ("source/patches/patch1.diff", "foob ar")])
6 self.assertEquals(["patch1.diff"], quilt_unapplied("source"))
7
8+ def test_unapplied_dir(self):
9+ self.make_empty_quilt_dir("source")
10+ self.build_tree_contents([
11+ ("source/patches/series", "debian/patch1.diff\n"),
12+ ("source/patches/debian/", ),
13+ ("source/patches/debian/patch1.diff", "foob ar")])
14+ self.assertEquals(["debian/patch1.diff"], quilt_unapplied("source"))
15+
16 def test_unapplied_multi(self):
17 self.make_empty_quilt_dir("source")
18 self.build_tree_contents([
19
20=== modified file 'breezy/plugins/quilt/wrapper.py'
21--- breezy/plugins/quilt/wrapper.py 2019-08-26 22:01:15 +0000
22+++ breezy/plugins/quilt/wrapper.py 2019-11-18 04:31:38 +0000
23@@ -226,16 +226,19 @@
24 :param patches_dir: Optional patches directory
25 :param series_file: Optional series file
26 """
27+ working_dir = os.path.abspath(working_dir)
28+ if patches_dir is None:
29+ patches_dir = os.path.join(working_dir, DEFAULT_PATCHES_DIR)
30 try:
31 unapplied_patches = run_quilt(
32 ["unapplied"],
33 working_dir=working_dir, patches_dir=patches_dir,
34 series_file=series_file).splitlines()
35- patch_basenames = []
36+ patch_names = []
37 for patch in unapplied_patches:
38- patch = os.path.basename(patch)
39- patch_basenames.append(patch.decode(osutils._fs_enc))
40- return patch_basenames
41+ patch = patch.decode(osutils._fs_enc)
42+ patch_names.append(os.path.relpath(patch, patches_dir))
43+ return patch_names
44 except QuiltError as e:
45 if e.retcode == 1:
46 return []

Subscribers

People subscribed via source and target branches