Merge lp:~jelmer/bzr-builddeb/move-config-to-debian-dir into lp:bzr-builddeb
- move-config-to-debian-dir
- Merge into trunk
Proposed by
Jelmer Vernooij
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | James Westby | ||||
Approved revision: | 620 | ||||
Merged at revision: | 630 | ||||
Proposed branch: | lp:~jelmer/bzr-builddeb/move-config-to-debian-dir | ||||
Merge into: | lp:bzr-builddeb | ||||
Diff against target: |
345 lines (+76/-59) (has conflicts) 11 files modified
__init__.py (+2/-0) config.py (+3/-1) debian/changelog (+6/-0) doc/user_manual/configuration.rst (+3/-2) doc/user_manual/hooks.rst (+1/-1) doc/user_manual/merge.rst (+3/-4) doc/user_manual/native.rst (+3/-4) doc/user_manual/split.rst (+3/-3) import_dsc.py (+34/-36) tests/test_import_dsc.py (+5/-7) util.py (+13/-1) Text conflict in debian/changelog |
||||
To merge this branch: | bzr merge lp:~jelmer/bzr-builddeb/move-config-to-debian-dir | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bzr-builddeb-hackers | Pending | ||
Review via email: mp+78989@code.launchpad.net |
This proposal supersedes a proposal from 2011-09-28.
Commit message
Description of the change
Move versioned configuration to debian/
To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote : Posted in a previous version of this proposal | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '__init__.py' | |||
2 | --- __init__.py 2011-10-07 10:57:44 +0000 | |||
3 | +++ __init__.py 2011-10-11 14:49:23 +0000 | |||
4 | @@ -57,6 +57,8 @@ | |||
5 | 57 | from bzrlib.config import config_dir | 57 | from bzrlib.config import config_dir |
6 | 58 | return os.path.join(config_dir(), 'builddeb.conf') | 58 | return os.path.join(config_dir(), 'builddeb.conf') |
7 | 59 | local_conf = os.path.join(builddeb_dir, 'local.conf') | 59 | local_conf = os.path.join(builddeb_dir, 'local.conf') |
8 | 60 | new_local_conf = 'debian/local.conf.local' | ||
9 | 61 | new_conf = 'debian/bzr-builddeb.conf' | ||
10 | 60 | 62 | ||
11 | 61 | default_build_dir = '../build-area' | 63 | default_build_dir = '../build-area' |
12 | 62 | default_orig_dir = '..' | 64 | default_orig_dir = '..' |
13 | 63 | 65 | ||
14 | === modified file 'config.py' | |||
15 | --- config.py 2011-10-07 10:57:44 +0000 | |||
16 | +++ config.py 2011-10-11 14:49:23 +0000 | |||
17 | @@ -56,7 +56,9 @@ | |||
18 | 56 | class DebBuildConfig(object): | 56 | class DebBuildConfig(object): |
19 | 57 | """Holds the configuration settings for builddeb. These are taken from | 57 | """Holds the configuration settings for builddeb. These are taken from |
20 | 58 | a hierarchy of config files. .bzr-builddeb/local.conf then | 58 | a hierarchy of config files. .bzr-builddeb/local.conf then |
22 | 59 | ~/.bazaar/builddeb.conf, finally .bzr-builddeb/default.conf. The value is | 59 | debian/bzr-builddeb.conf.local, |
23 | 60 | ~/.bazaar/builddeb.conf, debian/bzr-builddeb.conf, | ||
24 | 61 | finally .bzr-builddeb/default.conf. The value is | ||
25 | 60 | taken from the first file in which it is specified.""" | 62 | taken from the first file in which it is specified.""" |
26 | 61 | 63 | ||
27 | 62 | section = 'BUILDDEB' | 64 | section = 'BUILDDEB' |
28 | 63 | 65 | ||
29 | === modified file 'debian/changelog' | |||
30 | --- debian/changelog 2011-10-08 21:45:17 +0000 | |||
31 | +++ debian/changelog 2011-10-11 14:49:23 +0000 | |||
32 | @@ -17,7 +17,10 @@ | |||
33 | 17 | 17 | ||
34 | 18 | [ Jelmer Vernooij ] | 18 | [ Jelmer Vernooij ] |
35 | 19 | * Support .tar.xz Debian files rather than .tar.lzma. | 19 | * Support .tar.xz Debian files rather than .tar.lzma. |
36 | 20 | * Move .bzr-builddeb/default.conf to debian/bzr-builddeb.conf. LP: | ||
37 | 21 | #793137 | ||
38 | 20 | 22 | ||
39 | 23 | <<<<<<< TREE | ||
40 | 21 | [ Martin Packman ] | 24 | [ Martin Packman ] |
41 | 22 | * Support non-ascii characters in changelog entry when determining | 25 | * Support non-ascii characters in changelog entry when determining |
42 | 23 | commit message. LP: #853664 | 26 | commit message. LP: #853664 |
43 | @@ -26,6 +29,9 @@ | |||
44 | 26 | * Use more complete control file during examples. Closes: #642818 | 29 | * Use more complete control file during examples. Closes: #642818 |
45 | 27 | 30 | ||
46 | 28 | -- Jelmer Vernooij <jelmer@debian.org> Sat, 01 Oct 2011 21:27:05 +0200 | 31 | -- Jelmer Vernooij <jelmer@debian.org> Sat, 01 Oct 2011 21:27:05 +0200 |
47 | 32 | ======= | ||
48 | 33 | -- Jelmer Vernooij <jelmer@debian.org> Wed, 28 Sep 2011 15:15:14 +0200 | ||
49 | 34 | >>>>>>> MERGE-SOURCE | ||
50 | 29 | 35 | ||
51 | 30 | bzr-builddeb (2.7.8) unstable; urgency=low | 36 | bzr-builddeb (2.7.8) unstable; urgency=low |
52 | 31 | 37 | ||
53 | 32 | 38 | ||
54 | === modified file 'doc/user_manual/configuration.rst' | |||
55 | --- doc/user_manual/configuration.rst 2011-10-07 11:14:44 +0000 | |||
56 | +++ doc/user_manual/configuration.rst 2011-10-11 14:49:23 +0000 | |||
57 | @@ -6,7 +6,8 @@ | |||
58 | 6 | 6 | ||
59 | 7 | * .bzr-builddeb/local.conf (in the package directory) | 7 | * .bzr-builddeb/local.conf (in the package directory) |
60 | 8 | * ~/.bazaar/builddeb.conf | 8 | * ~/.bazaar/builddeb.conf |
62 | 9 | * .bzr-builddeb/default.conf (in the package directory) | 9 | * debian/bzr-builddeb.conf (in the package directory) |
63 | 10 | * .bzr-builddeb/default.conf (in the package directory, deprecated) | ||
64 | 10 | 11 | ||
65 | 11 | The last of these should be used for values that will be used by all users of | 12 | The last of these should be used for values that will be used by all users of |
66 | 12 | the package, for instance 'merge = True'. The others are for the user to add | 13 | the package, for instance 'merge = True'. The others are for the user to add |
67 | @@ -138,7 +139,7 @@ | |||
68 | 138 | (Defaults to ``fakeroot debian/rules binary``). Will only be read from | 139 | (Defaults to ``fakeroot debian/rules binary``). Will only be read from |
69 | 139 | the config file in your home directory. | 140 | the config file in your home directory. |
70 | 140 | 141 | ||
72 | 141 | The idea is that certain options can be set in ``.bzr-builddeb/default.conf`` | 142 | The idea is that certain options can be set in ``debian/bzr-builddeb.conf`` |
73 | 142 | that apply to the package on all systems, or that there is a default that is | 143 | that apply to the package on all systems, or that there is a default that is |
74 | 143 | wanted that differs from the default provided. ``merge = True`` is a perfect | 144 | wanted that differs from the default provided. ``merge = True`` is a perfect |
75 | 144 | example of this. | 145 | example of this. |
76 | 145 | 146 | ||
77 | === modified file 'doc/user_manual/hooks.rst' | |||
78 | --- doc/user_manual/hooks.rst 2011-02-27 16:15:50 +0000 | |||
79 | +++ doc/user_manual/hooks.rst 2011-10-11 14:49:23 +0000 | |||
80 | @@ -48,7 +48,7 @@ | |||
81 | 48 | Hooks are set by editing the configuration files. The normal precedence | 48 | Hooks are set by editing the configuration files. The normal precedence |
82 | 49 | rules for these files are followed (see `configuration`_ for details). This | 49 | rules for these files are followed (see `configuration`_ for details). This |
83 | 50 | means that you should set hooks needed to build the package in | 50 | means that you should set hooks needed to build the package in |
85 | 51 | ``.bzr-builddeb/default.conf``, and any hooks that you would like to run | 51 | ``debian/bzr-builddeb.conf``, and any hooks that you would like to run |
86 | 52 | that would not be appropriate for everyone in ``.bzr-builddeb/local.conf``. | 52 | that would not be appropriate for everyone in ``.bzr-builddeb/local.conf``. |
87 | 53 | Note however that the latter overrides the formula, so your local hooks should | 53 | Note however that the latter overrides the formula, so your local hooks should |
88 | 54 | run all necessary commands from the default hooks that are necessary to build | 54 | run all necessary commands from the default hooks that are necessary to build |
89 | 55 | 55 | ||
90 | === modified file 'doc/user_manual/merge.rst' | |||
91 | --- doc/user_manual/merge.rst 2011-10-03 11:03:46 +0000 | |||
92 | +++ doc/user_manual/merge.rst 2011-10-11 14:49:23 +0000 | |||
93 | @@ -48,14 +48,13 @@ | |||
94 | 48 | 48 | ||
95 | 49 | Now you have a branch that you will create the package in you need to tell | 49 | Now you have a branch that you will create the package in you need to tell |
96 | 50 | `bzr-builddeb` that it will be built in merge mode. To do this you need to | 50 | `bzr-builddeb` that it will be built in merge mode. To do this you need to |
98 | 51 | create the configuration file ``.bzr-builddeb/default.conf``. This contains | 51 | create the configuration file ``debian/bzr-builddeb.conf``. This contains |
99 | 52 | the default options for the package. The file starts with a ``[BUILDDEB]`` | 52 | the default options for the package. The file starts with a ``[BUILDDEB]`` |
100 | 53 | header which states that the file is for use by `bzr-builddeb`. The option | 53 | header which states that the file is for use by `bzr-builddeb`. The option |
101 | 54 | we are interested in is the ``merge`` option. The commands to do this are:: | 54 | we are interested in is the ``merge`` option. The commands to do this are:: |
102 | 55 | 55 | ||
106 | 56 | $ mkdir .bzr-builddeb/ | 56 | $ echo -e '[BUILDDEB]\nmerge = True' > debian/bzr-builddeb.conf |
107 | 57 | $ echo -e '[BUILDDEB]\nmerge = True' > .bzr-builddeb/default.conf | 57 | $ bzr add debian/bzr-builddeb.conf |
105 | 58 | $ bzr add .bzr-builddeb/default.conf | ||
108 | 59 | 58 | ||
109 | 60 | Now you should add the packaging files to the branch. You have a choice | 59 | Now you should add the packaging files to the branch. You have a choice |
110 | 61 | here, either you can add a ``debian/`` directory containing the files, | 60 | here, either you can add a ``debian/`` directory containing the files, |
111 | 62 | 61 | ||
112 | === modified file 'doc/user_manual/native.rst' | |||
113 | --- doc/user_manual/native.rst 2009-02-18 22:50:44 +0000 | |||
114 | +++ doc/user_manual/native.rst 2011-10-11 14:49:23 +0000 | |||
115 | @@ -53,14 +53,13 @@ | |||
116 | 53 | 53 | ||
117 | 54 | Now you have a branch that you will create the package in you need to tell | 54 | Now you have a branch that you will create the package in you need to tell |
118 | 55 | `bzr-builddeb` that it will be a native package. To do this you need to | 55 | `bzr-builddeb` that it will be a native package. To do this you need to |
120 | 56 | create the configuration file ``.bzr-builddeb/default.conf``. This contains | 56 | create the configuration file ``debian/bzr-builddeb.conf``. This contains |
121 | 57 | the default options for the package. The file starts with a ``[BUILDDEB]`` | 57 | the default options for the package. The file starts with a ``[BUILDDEB]`` |
122 | 58 | header which states that the file is for use by `bzr-builddeb`. The option | 58 | header which states that the file is for use by `bzr-builddeb`. The option |
123 | 59 | we are interested in is the ``native`` option. The commands to do this are:: | 59 | we are interested in is the ``native`` option. The commands to do this are:: |
124 | 60 | 60 | ||
128 | 61 | $ mkdir .bzr-builddeb/ | 61 | $ echo -e '[BUILDDEB]\nnative = True' > debian/bzr-builddeb.conf |
129 | 62 | $ echo -e '[BUILDDEB]\nnative = True' > .bzr-builddeb/default.conf | 62 | $ bzr add dbian/bzr-builddeb.conf |
127 | 63 | $ bzr add .bzr-builddeb/default.conf | ||
130 | 64 | 63 | ||
131 | 65 | Now you are ready to create the package. Add all of the files for the | 64 | Now you are ready to create the package. Add all of the files for the |
132 | 66 | package, and the packaging in ``debian/``, and then you can add the files | 65 | package, and the packaging in ``debian/``, and then you can add the files |
133 | 67 | 66 | ||
134 | === modified file 'doc/user_manual/split.rst' | |||
135 | --- doc/user_manual/split.rst 2009-02-18 18:36:18 +0000 | |||
136 | +++ doc/user_manual/split.rst 2011-10-11 14:49:23 +0000 | |||
137 | @@ -60,14 +60,14 @@ | |||
138 | 60 | which will create a branch and add all of your current code to it. | 60 | which will create a branch and add all of your current code to it. |
139 | 61 | 61 | ||
140 | 62 | The next step is to tell `bzr-builddeb` that it is a split mode package. To | 62 | The next step is to tell `bzr-builddeb` that it is a split mode package. To |
142 | 63 | do this create the configuration file ``.bzr-builddeb/default.conf`` in the | 63 | do this create the configuration file ``debian/bzr-builddeb.conf`` in the |
143 | 64 | branch. This contains the options that are default for building the package. | 64 | branch. This contains the options that are default for building the package. |
144 | 65 | The file starts with a ``[BUILDDEB]`` header to identify the options that | 65 | The file starts with a ``[BUILDDEB]`` header to identify the options that |
145 | 66 | the plugin should use, and the option that you need to set is ``split``. | 66 | the plugin should use, and the option that you need to set is ``split``. |
146 | 67 | The following commands will set up the configuration files for you:: | 67 | The following commands will set up the configuration files for you:: |
147 | 68 | 68 | ||
150 | 69 | $ echo -e '[BUILDDEB]\nsplit = True' > .bzr-builddeb/default.conf | 69 | $ echo -e '[BUILDDEB]\nsplit = True' > debian/bzr-builddeb.conf |
151 | 70 | $ bzr add .bzr-builddeb/default.conf | 70 | $ bzr add debian/bzr-builddeb.conf |
152 | 71 | 71 | ||
153 | 72 | When you are happy with the code you can commit, and then build the package. | 72 | When you are happy with the code you can commit, and then build the package. |
154 | 73 | `bzr-builddeb` will see that it is a split mode package and create the | 73 | `bzr-builddeb` will see that it is a split mode package and create the |
155 | 74 | 74 | ||
156 | === modified file 'import_dsc.py' | |||
157 | --- import_dsc.py 2011-09-27 00:48:16 +0000 | |||
158 | +++ import_dsc.py 2011-10-11 14:49:23 +0000 | |||
159 | @@ -451,23 +451,24 @@ | |||
160 | 451 | 451 | ||
161 | 452 | def _default_config_for_tree(self, tree): | 452 | def _default_config_for_tree(self, tree): |
162 | 453 | # FIXME: shouldn't go to configobj directly | 453 | # FIXME: shouldn't go to configobj directly |
168 | 454 | path = '.bzr-builddeb/default.conf' | 454 | for path in ('debian/bzr-builddeb.conf', '.bzr-builddeb/default.conf',): |
169 | 455 | c_fileid = tree.path2id(path) | 455 | c_fileid = tree.path2id(path) |
170 | 456 | config = None | 456 | if c_fileid is not None: |
171 | 457 | if c_fileid is not None: | 457 | break |
172 | 458 | tree.lock_read() | 458 | else: |
173 | 459 | return None, None | ||
174 | 460 | tree.lock_read() | ||
175 | 461 | try: | ||
176 | 462 | config = ConfigObj(tree.get_file(c_fileid, path)) | ||
177 | 459 | try: | 463 | try: |
186 | 460 | config = ConfigObj(tree.get_file(c_fileid, path)) | 464 | config['BUILDDEB'] |
187 | 461 | try: | 465 | except KeyError: |
188 | 462 | config['BUILDDEB'] | 466 | config['BUILDDEB'] = {} |
189 | 463 | except KeyError: | 467 | finally: |
190 | 464 | config['BUILDDEB'] = {} | 468 | tree.unlock() |
191 | 465 | finally: | 469 | return c_fileid, config |
184 | 466 | tree.unlock() | ||
185 | 467 | return config | ||
192 | 468 | 470 | ||
195 | 469 | def _is_tree_native(self, tree): | 471 | def _is_tree_native(self, config): |
194 | 470 | config = self._default_config_for_tree(tree) | ||
196 | 471 | if config is not None: | 472 | if config is not None: |
197 | 472 | try: | 473 | try: |
198 | 473 | current_value = config['BUILDDEB']['native'] | 474 | current_value = config['BUILDDEB']['native'] |
199 | @@ -486,7 +487,8 @@ | |||
200 | 486 | """ | 487 | """ |
201 | 487 | revid = self.revid_of_version(version) | 488 | revid = self.revid_of_version(version) |
202 | 488 | rev_tree = self.branch.repository.revision_tree(revid) | 489 | rev_tree = self.branch.repository.revision_tree(revid) |
204 | 489 | if self._is_tree_native(rev_tree): | 490 | config_fileid, current_config = self._default_config_for_tree(rev_tree) |
205 | 491 | if self._is_tree_native(current_config): | ||
206 | 490 | return True | 492 | return True |
207 | 491 | rev = self.branch.repository.get_revision(revid) | 493 | rev = self.branch.repository.get_revision(revid) |
208 | 492 | try: | 494 | try: |
209 | @@ -918,22 +920,20 @@ | |||
210 | 918 | 920 | ||
211 | 919 | def _mark_native_config(self, native): | 921 | def _mark_native_config(self, native): |
212 | 920 | poss_native_tree = self.branch.basis_tree() | 922 | poss_native_tree = self.branch.basis_tree() |
216 | 921 | current_native = self._is_tree_native(poss_native_tree) | 923 | config_fileid, current_config = self._default_config_for_tree(poss_native_tree) |
217 | 922 | current_config = self._default_config_for_tree(poss_native_tree) | 924 | current_native = self._is_tree_native(current_config) |
215 | 923 | dirname = os.path.join(self.tree.basedir, '.bzr-builddeb') | ||
218 | 924 | if current_config is not None: | 925 | if current_config is not None: |
219 | 925 | # Add that back to the current tree | 926 | # Add that back to the current tree |
224 | 926 | if not os.path.exists(dirname): | 927 | current_config.filename = os.path.join(self.tree.basedir, |
225 | 927 | os.mkdir(dirname) | 928 | poss_native_tree.id2path(config_fileid)) |
226 | 928 | current_config.filename = os.path.join(dirname, | 929 | dir_path = osutils.dirname(current_config.filename) |
227 | 929 | 'default.conf') | 930 | if not os.path.exists(dir_path): |
228 | 931 | os.mkdir(dir_path) | ||
229 | 930 | current_config.write() | 932 | current_config.write() |
236 | 931 | dir_id = poss_native_tree.path2id('.bzr-builddeb') | 933 | dirname = osutils.dirname(poss_native_tree.id2path(config_fileid)) |
237 | 932 | file_id = poss_native_tree.path2id( | 934 | dir_id = poss_native_tree.path2id(dirname) |
238 | 933 | '.bzr-builddeb/default.conf') | 935 | self.tree.add([dirname, poss_native_tree.id2path(config_fileid)], |
239 | 934 | self.tree.add(['.bzr-builddeb/', | 936 | ids=[dir_id, config_fileid]) |
234 | 935 | '.bzr-builddeb/default.conf'], | ||
235 | 936 | ids=[dir_id, file_id]) | ||
240 | 937 | if native != current_native: | 937 | if native != current_native: |
241 | 938 | if current_config is None: | 938 | if current_config is None: |
242 | 939 | needs_add = True | 939 | needs_add = True |
243 | @@ -949,17 +949,15 @@ | |||
244 | 949 | del current_config['BUILDDEB'] | 949 | del current_config['BUILDDEB'] |
245 | 950 | if len(current_config) == 0: | 950 | if len(current_config) == 0: |
246 | 951 | self.tree.remove(['.bzr-builddeb', | 951 | self.tree.remove(['.bzr-builddeb', |
248 | 952 | '.bzr-builddeb/default.conf'], | 952 | '.bzr-builddeb/default.conf', |
249 | 953 | 'debian/bzr-builddeb.conf'], | ||
250 | 953 | keep_files=False) | 954 | keep_files=False) |
251 | 954 | else: | 955 | else: |
256 | 955 | if needs_add: | 956 | current_config.filename = os.path.join( |
257 | 956 | os.mkdir(dirname) | 957 | self.tree.basedir, 'debian', 'bzr-builddeb.conf') |
254 | 957 | current_config.filename = os.path.join(dirname, | ||
255 | 958 | 'default.conf') | ||
258 | 959 | current_config.write() | 958 | current_config.write() |
259 | 960 | if needs_add: | 959 | if needs_add: |
262 | 961 | self.tree.add(['.bzr-builddeb/', | 960 | self.tree.add(['debian', 'debian/bzr-builddeb.conf']) |
261 | 962 | '.bzr-builddeb/default.conf']) | ||
263 | 963 | 961 | ||
264 | 964 | def import_debian(self, debian_part, version, parents, md5, | 962 | def import_debian(self, debian_part, version, parents, md5, |
265 | 965 | native=False, timestamp=None, file_ids_from=None): | 963 | native=False, timestamp=None, file_ids_from=None): |
266 | 966 | 964 | ||
267 | === modified file 'tests/test_import_dsc.py' | |||
268 | --- tests/test_import_dsc.py 2011-09-26 23:40:46 +0000 | |||
269 | +++ tests/test_import_dsc.py 2011-10-11 14:49:23 +0000 | |||
270 | @@ -1196,7 +1196,8 @@ | |||
271 | 1196 | self.addCleanup(self.tree1.unlock) | 1196 | self.addCleanup(self.tree1.unlock) |
272 | 1197 | self.assertTrue(self.db1.is_version_native(version)) | 1197 | self.assertTrue(self.db1.is_version_native(version)) |
273 | 1198 | revtree = self.tree1.branch.repository.revision_tree(rh1[0]) | 1198 | revtree = self.tree1.branch.repository.revision_tree(rh1[0]) |
275 | 1199 | self.assertTrue(self.db1._is_tree_native(revtree)) | 1199 | config_fileid, current_config = self.db1._default_config_for_tree(revtree) |
276 | 1200 | self.assertTrue(self.db1._is_tree_native(current_config)) | ||
277 | 1200 | 1201 | ||
278 | 1201 | def test_import_native_two(self): | 1202 | def test_import_native_two(self): |
279 | 1202 | version1 = Version("1.0") | 1203 | version1 = Version("1.0") |
280 | @@ -1288,8 +1289,7 @@ | |||
281 | 1288 | self.assertEqual(rev_tree1.get_parent_ids(), [rh1[0]]) | 1289 | self.assertEqual(rev_tree1.get_parent_ids(), [rh1[0]]) |
282 | 1289 | self.assertEqual(rev_tree2.get_parent_ids(), [rh1[1]]) | 1290 | self.assertEqual(rev_tree2.get_parent_ids(), [rh1[1]]) |
283 | 1290 | self.check_changes(rev_tree2.changes_from(rev_tree1), | 1291 | self.check_changes(rev_tree2.changes_from(rev_tree1), |
286 | 1291 | added=["NEWS", ".bzr-builddeb/", | 1292 | added=["NEWS", "debian/bzr-builddeb.conf"], |
285 | 1292 | ".bzr-builddeb/default.conf"], | ||
287 | 1293 | removed=["BUGS"], modified=["debian/changelog", "COPYING"]) | 1293 | removed=["BUGS"], modified=["debian/changelog", "COPYING"]) |
288 | 1294 | self.assertEqual(self.db1.revid_of_version(version1), rh1[1]) | 1294 | self.assertEqual(self.db1.revid_of_version(version1), rh1[1]) |
289 | 1295 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) | 1295 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) |
290 | @@ -1329,14 +1329,12 @@ | |||
291 | 1329 | self.assertEqual(up_rev_tree1.get_parent_ids(), [rh1[0]]) | 1329 | self.assertEqual(up_rev_tree1.get_parent_ids(), [rh1[0]]) |
292 | 1330 | self.check_changes(rev_tree2.changes_from(rev_tree1), | 1330 | self.check_changes(rev_tree2.changes_from(rev_tree1), |
293 | 1331 | added=["NEWS"], | 1331 | added=["NEWS"], |
296 | 1332 | removed=["BUGS", ".bzr-builddeb/", | 1332 | removed=["BUGS", "debian/bzr-builddeb.conf"], |
295 | 1333 | ".bzr-builddeb/default.conf"], | ||
297 | 1334 | modified=["debian/changelog", "COPYING"]) | 1333 | modified=["debian/changelog", "COPYING"]) |
298 | 1335 | self.check_changes(up_rev_tree1.changes_from(rev_tree1), | 1334 | self.check_changes(up_rev_tree1.changes_from(rev_tree1), |
299 | 1336 | added=["NEWS"], | 1335 | added=["NEWS"], |
300 | 1337 | removed=["debian/", "debian/changelog", "debian/control", | 1336 | removed=["debian/", "debian/changelog", "debian/control", |
303 | 1338 | "BUGS", "README", ".bzr-builddeb/", | 1337 | "BUGS", "README", "debian/bzr-builddeb.conf"], |
302 | 1339 | ".bzr-builddeb/default.conf"], | ||
304 | 1340 | modified=["COPYING"]) | 1338 | modified=["COPYING"]) |
305 | 1341 | self.check_changes(rev_tree2.changes_from(up_rev_tree1), | 1339 | self.check_changes(rev_tree2.changes_from(up_rev_tree1), |
306 | 1342 | added=["debian/", "debian/changelog", "debian/control", | 1340 | added=["debian/", "debian/changelog", "debian/control", |
307 | 1343 | 1341 | ||
308 | === modified file 'util.py' | |||
309 | --- util.py 2011-09-29 10:11:07 +0000 | |||
310 | +++ util.py 2011-10-11 14:49:23 +0000 | |||
311 | @@ -55,6 +55,7 @@ | |||
312 | 55 | default_conf, | 55 | default_conf, |
313 | 56 | local_conf, | 56 | local_conf, |
314 | 57 | global_conf, | 57 | global_conf, |
315 | 58 | new_conf, | ||
316 | 58 | ) | 59 | ) |
317 | 59 | from bzrlib.plugins.builddeb.config import ( | 60 | from bzrlib.plugins.builddeb.config import ( |
318 | 60 | DebBuildConfig, | 61 | DebBuildConfig, |
319 | @@ -533,14 +534,25 @@ | |||
320 | 533 | """ | 534 | """ |
321 | 534 | config_files = [] | 535 | config_files = [] |
322 | 535 | user_config = None | 536 | user_config = None |
323 | 537 | if (working_tree and tree.has_filename(new_local_conf)): | ||
324 | 538 | if tree.path2id(new_local_conf) is None: | ||
325 | 539 | config_files.append((tree.get_file_byname(new_local_conf), True, | ||
326 | 540 | "local.conf")) | ||
327 | 541 | else: | ||
328 | 542 | warning('Not using configuration from %s as it is versioned.', | ||
329 | 543 | new_local_conf) | ||
330 | 536 | if (working_tree and tree.has_filename(local_conf)): | 544 | if (working_tree and tree.has_filename(local_conf)): |
331 | 537 | if tree.path2id(local_conf) is None: | 545 | if tree.path2id(local_conf) is None: |
332 | 538 | config_files.append((tree.get_file_byname(local_conf), True, | 546 | config_files.append((tree.get_file_byname(local_conf), True, |
333 | 539 | "local.conf")) | 547 | "local.conf")) |
334 | 540 | else: | 548 | else: |
336 | 541 | warning('Not using configuration from %s as it is versioned.') | 549 | warning('Not using configuration from %s as it is versioned.', |
337 | 550 | local_conf) | ||
338 | 542 | config_files.append((global_conf(), True)) | 551 | config_files.append((global_conf(), True)) |
339 | 543 | user_config = global_conf() | 552 | user_config = global_conf() |
340 | 553 | if tree.path2id(new_conf): | ||
341 | 554 | config_files.append((tree.get_file(tree.path2id(new_conf)), False, | ||
342 | 555 | "bzr-builddeb.conf")) | ||
343 | 544 | if tree.path2id(default_conf): | 556 | if tree.path2id(default_conf): |
344 | 545 | config_files.append((tree.get_file(tree.path2id(default_conf)), False, | 557 | config_files.append((tree.get_file(tree.path2id(default_conf)), False, |
345 | 546 | "default.conf")) | 558 | "default.conf")) |
241 if needs_add:
242 os.mkdir(dirname)
It looks like that would still create .bzr-builddeb?
Also, what do you think about moving local.conf as discussed on IRC?
Thanks,
James