Merge lp:~jelmer/bzr-builddeb/521341-builddeb-strict into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Superseded
Proposed branch: lp:~jelmer/bzr-builddeb/521341-builddeb-strict
Merge into: lp:bzr-builddeb
Diff against target: 107 lines (+30/-2) (has conflicts)
4 files modified
cmds.py (+10/-2)
debian/changelog (+8/-0)
errors.py (+6/-0)
tests/blackbox/test_builddeb.py (+6/-0)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/521341-builddeb-strict
Reviewer Review Type Date Requested Status
James Westby Needs Fixing
Review via email: mp+48456@code.launchpad.net

This proposal has been superseded by a proposal from 2011-02-07.

Description of the change

Add a --strict option to 'bzr builddeb'.

To post a comment you must log in.
510. By Jelmer Vernooij

Add test.

Revision history for this message
James Westby (james-w) wrote :

Could we either put the unknowns in the error message, or tell the user
what to run to find out what they are?

I think I would prefer the latter.

Thanks,

James

review: Needs Fixing
511. By Jelmer Vernooij

Hint the user at 'bzr unknowns'.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I've changed it to:

bzr: ERROR: Build refused because there are unknown files in the tree. To list all known files, run 'bzr unknowns'.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmds.py'
2--- cmds.py 2011-02-04 11:30:52 +0000
3+++ cmds.py 2011-02-07 15:26:52 +0000
4@@ -70,6 +70,7 @@
5 BuildFailedError,
6 MissingChangelogError,
7 NoPreviousUpload,
8+ StrictBuildFailed,
9 )
10 from bzrlib.plugins.builddeb.hooks import run_hook
11 from bzrlib.plugins.builddeb.import_dsc import (
12@@ -198,6 +199,9 @@
13 +"and --use-existing.")
14 source_opt = Option('source', help="Build a source package.",
15 short_name='S')
16+ strict_opt = Option('strict',
17+ help='Refuse to build if there are unknown files in'
18+ ' the working tree, --no-strict disables the check.')
19 result_compat_opt = Option('result', help="Present only for compatibility "
20 "with bzr-builddeb <= 2.0. Use --result-dir instead.")
21 package_merge_opt = Option('package-merge', help="Build using the "
22@@ -210,7 +214,7 @@
23 build_dir_opt, orig_dir_opt, split_opt,
24 export_upstream_opt, export_upstream_revision_opt,
25 quick_opt, reuse_opt, native_opt,
26- source_opt, 'revision',
27+ source_opt, 'revision', strict_opt,
28 result_compat_opt, package_merge_opt]
29
30 def _get_tree_and_branch(self, location):
31@@ -331,13 +335,17 @@
32 export_upstream=None, export_upstream_revision=None,
33 orig_dir=None, split=None,
34 quick=False, reuse=False, native=None,
35- source=False, revision=None, result=None, package_merge=None):
36+ source=False, revision=None, result=None, package_merge=None,
37+ strict=False):
38 if result is not None:
39 warning("--result is deprecated, use --result-dir instead")
40 location, build_options, source = self._branch_and_build_options(
41 branch_or_build_options_list, source)
42 tree, branch, is_local, location = self._get_tree_and_branch(location)
43 tree, working_tree = self._get_build_tree(revision, tree, branch)
44+ if strict:
45+ for unknown in tree.unknowns():
46+ raise StrictBuildFailed()
47
48 if len(tree.conflicts()) > 0:
49 raise BzrCommandError(
50
51=== modified file 'debian/changelog'
52--- debian/changelog 2011-02-06 13:25:43 +0000
53+++ debian/changelog 2011-02-07 15:26:52 +0000
54@@ -45,14 +45,22 @@
55 kind of compression is supported on tarballs. LP: #627718
56 * Support upstream version strings containing dashes. Patch by Stefano
57 Rivera. LP: #711826
58+<<<<<<< TREE
59 * Run test suite unless nocheck is set (consistent with policy).
60 * Fix build dependencies for test suite.
61 * Support unversioned debian/ symlink in working tree when finding
62 changelog and larstiq mode. LP: #619295
63 * The deb: directory service has been renamed to apt: to avoid
64 confusion.
65+=======
66+ * Add --strict argument to 'bzr builddeb'. LP: #521341
67+>>>>>>> MERGE-SOURCE
68
69+<<<<<<< TREE
70 -- Jelmer Vernooij <jelmer@debian.org> Sun, 06 Feb 2011 14:25:32 +0100
71+=======
72+ -- Jelmer Vernooij <jelmer@debian.org> Thu, 03 Feb 2011 12:39:51 +0100
73+>>>>>>> MERGE-SOURCE
74
75 bzr-builddeb (2.5) unstable; urgency=low
76
77
78=== modified file 'errors.py'
79--- errors.py 2011-01-24 04:17:20 +0000
80+++ errors.py 2011-02-07 15:26:52 +0000
81@@ -225,3 +225,9 @@
82 class WatchFileMissing(BzrError):
83
84 _fmt = "No watch file found."
85+
86+
87+class StrictBuildFailed(BzrError):
88+
89+ _fmt = ("Build refused because there are unknown files in the tree."
90+ "To list all known files, run 'bzr unknowns'.")
91
92=== modified file 'tests/blackbox/test_builddeb.py'
93--- tests/blackbox/test_builddeb.py 2010-09-10 02:51:38 +0000
94+++ tests/blackbox/test_builddeb.py 2011-02-07 15:26:52 +0000
95@@ -110,6 +110,12 @@
96 ['There are conflicts in the working tree. You must resolve these'],
97 "builddeb --native --builder true --dont-purge")
98
99+ def test_builddeb_strict(self):
100+ tree = self.build_really_simple_tree()
101+ self.run_bzr_error(
102+ ['bzr: ERROR: Build refused because there are unknown files in the tree'],
103+ "builddeb --strict")
104+
105 def test_builddeb_uses_revision_when_told(self):
106 self.build_really_simple_tree()
107 self.run_bzr("builddeb --native --builder true --dont-purge -r-1")

Subscribers

People subscribed via source and target branches