Merge lp:~jr/bzr-builddeb/larstiq-rename into lp:bzr-builddeb

Proposed by Jonathan Riddell
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 614
Merged at revision: 614
Proposed branch: lp:~jr/bzr-builddeb/larstiq-rename
Merge into: lp:bzr-builddeb
Diff against target: 281 lines (+36/-35)
5 files modified
__init__.py (+1/-1)
cmds.py (+16/-16)
properties.py (+4/-4)
source_distiller.py (+4/-4)
util.py (+11/-10)
To merge this branch: bzr merge lp:~jr/bzr-builddeb/larstiq-rename
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+77494@code.launchpad.net

Description of the change

Rename "larstiq" property to "top_level". "larstiq" is meaningless to readers of the code, it's just named after a user on launchpad, use a variable name with meaning to make code more readable.

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

This looks good, though I have to add that LarstiQ isn't just some Launchpad user, he is one of the early maintainers of bzr in Debian and was release manager for a couple of bzr releases.

(having "top_level" in quotes in the comments doesn't seem correct anymore?)

review: Approve

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-06-24 11:37:57 +0000
3+++ __init__.py 2011-09-29 10:36:25 +0000
4@@ -140,7 +140,7 @@
5 t = branch.repository.revision_tree(revid)
6 config = debuild_config(t, False)
7 try:
8- (changelog, larstiq) = find_changelog(t, config.build_type == BUILD_TYPE_MERGE)
9+ (changelog, top_level) = find_changelog(t, config.build_type == BUILD_TYPE_MERGE)
10 except MissingChangelogError:
11 # Not a debian package
12 return None
13
14=== modified file 'cmds.py'
15--- cmds.py 2011-09-09 13:20:42 +0000
16+++ cmds.py 2011-09-29 10:36:25 +0000
17@@ -351,7 +351,7 @@
18 if build_type is None:
19 build_type = config.build_type
20 contains_upstream_source = tree_contains_upstream_source(tree)
21- (changelog, larstiq) = find_changelog(tree, not contains_upstream_source)
22+ (changelog, top_level) = find_changelog(tree, not contains_upstream_source)
23 if build_type is None:
24 build_type = guess_build_type(tree, changelog.version,
25 contains_upstream_source)
26@@ -396,8 +396,8 @@
27 elif not native and config.upstream_branch is not None:
28 upstream_sources.append(LazyUpstreamBranchSource(config.upstream_branch))
29 upstream_sources.extend([
30- GetOrigSourceSource(tree, larstiq),
31- UScanSource(tree, larstiq),
32+ GetOrigSourceSource(tree, top_level),
33+ UScanSource(tree, top_level),
34 ])
35 if build_type == BUILD_TYPE_SPLIT:
36 upstream_sources.append(SelfSplitSource(tree))
37@@ -413,7 +413,7 @@
38 distiller_cls = FullSourceDistiller
39
40 distiller = distiller_cls(tree, upstream_provider,
41- larstiq=larstiq, use_existing=use_existing,
42+ top_level=top_level, use_existing=use_existing,
43 is_working_tree=working_tree)
44
45 build_source_dir = os.path.join(build_dir,
46@@ -604,7 +604,7 @@
47 def _get_changelog_info(self, tree, last_version, package, distribution):
48 current_version = last_version
49 try:
50- (changelog, larstiq) = find_changelog(tree, False, max_blocks=2)
51+ (changelog, top_level) = find_changelog(tree, False, max_blocks=2)
52 if last_version is None:
53 current_version = changelog.version.upstream_version
54 if package is None:
55@@ -614,7 +614,7 @@
56 if distribution is not None:
57 note("Using distribution %s" % distribution)
58 except MissingChangelogError:
59- larstiq = False
60+ top_level = False
61 changelog = None
62 if distribution is None:
63 note("No distribution specified, and no changelog, "
64@@ -631,7 +631,7 @@
65 raise BzrCommandError("Unknown target distribution: %s" \
66 % distribution)
67 return (current_version, package, distribution, distribution_name,
68- changelog, larstiq)
69+ changelog, top_level)
70
71 def run(self, location=None, upstream_branch=None, version=None,
72 distribution=None, package=None,
73@@ -647,7 +647,7 @@
74 "command.")
75 config = debuild_config(tree, tree)
76 (current_version, package, distribution, distribution_name,
77- changelog, larstiq) = self._get_changelog_info(tree, last_version,
78+ changelog, top_level) = self._get_changelog_info(tree, last_version,
79 package, distribution)
80 contains_upstream_source = tree_contains_upstream_source(tree)
81 if changelog is None:
82@@ -702,7 +702,7 @@
83 " branch source")
84 primary_upstream_source = upstream_branch_source
85 else:
86- primary_upstream_source = UScanSource(tree, larstiq)
87+ primary_upstream_source = UScanSource(tree, top_level)
88
89 if revision is not None:
90 if upstream_branch is None:
91@@ -869,7 +869,7 @@
92 dbs = DistributionBranchSet()
93 dbs.add_branch(db)
94 try:
95- (changelog, larstiq) = find_changelog(tree, False)
96+ (changelog, top_level) = find_changelog(tree, False)
97 last_version = changelog.version
98 except MissingChangelogError:
99 last_version = None
100@@ -1034,7 +1034,7 @@
101 except KeyError:
102 command_list = ["/bin/sh"]
103 give_instruction = True
104- (changelog, larstiq) = find_changelog(t, True)
105+ (changelog, top_level) = find_changelog(t, True)
106 build_dir = config.build_dir
107 if build_dir is None:
108 build_dir = default_build_dir
109@@ -1046,11 +1046,11 @@
110 changelog.version.upstream_version, orig_dir,
111 [PristineTarSource(t, t.branch),
112 AptSource(),
113- GetOrigSourceSource(t, larstiq),
114- UScanSource(t, larstiq) ])
115+ GetOrigSourceSource(t, top_level),
116+ UScanSource(t, top_level) ])
117
118 distiller = MergeModeDistiller(t, upstream_provider,
119- larstiq=larstiq)
120+ top_level=top_level)
121
122 build_source_dir = os.path.join(build_dir,
123 changelog.package + "-" + changelog.version.upstream_version)
124@@ -1071,7 +1071,7 @@
125 raise BzrCommandError('Not updating the working tree as the '
126 'command failed.')
127 note("Copying debian/ back")
128- if larstiq:
129+ if top_level:
130 destination = ''
131 else:
132 destination = 'debian/'
133@@ -1113,7 +1113,7 @@
134 config = debuild_config(t, t)
135 if merge is None:
136 merge = (config.build_type == BUILD_TYPE_MERGE)
137- (changelog, larstiq) = find_changelog(t, merge)
138+ (changelog, top_level) = find_changelog(t, merge)
139 if changelog.distributions == 'UNRELEASED':
140 if not force:
141 raise BzrCommandError("The changelog still targets "
142
143=== modified file 'properties.py'
144--- properties.py 2008-08-27 01:13:12 +0000
145+++ properties.py 2011-09-29 10:36:25 +0000
146@@ -22,11 +22,11 @@
147 class BuildProperties(object):
148 """Properties of this specific build"""
149
150- def __init__(self, changelog, build_dir, tarball_dir, larstiq):
151+ def __init__(self, changelog, build_dir, tarball_dir, top_level):
152 self._changelog = changelog
153 self._build_dir = build_dir
154 self._tarball_dir = tarball_dir
155- self._larstiq = larstiq
156+ self._top_level = top_level
157
158 def package(self):
159 return self._changelog.package
160@@ -58,7 +58,7 @@
161 def tarball_dir(self):
162 return self._tarball_dir
163
164- def larstiq(self):
165- return self._larstiq
166+ def top_level(self):
167+ return self._top_level
168
169 # vim: ts=2 sts=2 sw=2
170
171=== modified file 'source_distiller.py'
172--- source_distiller.py 2011-06-15 18:44:09 +0000
173+++ source_distiller.py 2011-09-29 10:36:25 +0000
174@@ -41,21 +41,21 @@
175
176 supports_use_existing = False
177
178- def __init__(self, tree, upstream_provider, larstiq=False,
179+ def __init__(self, tree, upstream_provider, top_level=False,
180 use_existing=False, is_working_tree=False):
181 """Create a SourceDistiller to distill from the specified tree.
182
183 :param tree: The tree to use as the source.
184 :param upstream_provider: an UpstreamProvider to provide the upstream
185 tarball if needed.
186- :param larstiq: if the tree is in the "LarstiQ" layout.
187+ :param top_level: if the tree is in the top level directory instead of inside debian/.
188 :param use_existing: whether the distiller should re-use an existing
189 target if the distiller supports it.
190 :param is_working_tree: if `tree` is a working tree.
191 """
192 self.tree = tree
193 self.upstream_provider = upstream_provider
194- self.larstiq = larstiq
195+ self.top_level = top_level
196 self.use_existing = use_existing
197 if not self.supports_use_existing:
198 assert not self.use_existing, "distiller doesn't support use_existing"
199@@ -138,7 +138,7 @@
200 basetempdir = tempfile.mkdtemp(prefix='builddeb-merge-debian-')
201 try:
202 tempdir = os.path.join(basetempdir,"export")
203- if self.larstiq:
204+ if self.top_level
205 os.makedirs(tempdir)
206 export_dir = os.path.join(tempdir, 'debian')
207 else:
208
209=== modified file 'util.py'
210--- util.py 2011-09-09 13:20:42 +0000
211+++ util.py 2011-09-29 10:36:25 +0000
212@@ -129,7 +129,7 @@
213 'max_blocks' defaults to 1 to try and prevent old broken
214 changelog entries from causing the command to fail,
215
216- "larstiq" is a subset of "merge" mode. It indicates that the
217+ "top_level" is a subset of "merge" mode. It indicates that the
218 '.bzr' dir is at the same level as 'changelog' etc., rather
219 than being at the same level as 'debian/'.
220
221@@ -137,26 +137,27 @@
222 :param merge: whether this is a "merge" package.
223 :param max_blocks: Number of max_blocks to parse (defaults to 1). Use None
224 to parse the entire changelog.
225- :return: (changelog, larstiq) where changelog is the Changelog,
226- and larstiq is a boolean indicating whether the file is at
227- 'changelog' if merge was given, False otherwise.
228+ :return: (changelog, top_level) where changelog is the Changelog,
229+ and top_level is a boolean indicating whether the file is
230+ located at 'changelog' (rather than 'debian/changelog') if
231+ merge was given, False otherwise.
232 """
233 changelog_file = 'debian/changelog'
234- larstiq = False
235+ top_level = False
236 t.lock_read()
237 try:
238 if not t.has_filename(changelog_file):
239 if merge:
240 # Assume LarstiQ's layout (.bzr in debian/)
241 changelog_file = 'changelog'
242- larstiq = True
243+ top_level = True
244 if not t.has_filename(changelog_file):
245 raise MissingChangelogError('"debian/changelog" or '
246 '"changelog"')
247 else:
248 raise MissingChangelogError('"debian/changelog"')
249 elif merge and t.has_filename('changelog'):
250- # If it is a "larstiq" package and debian is a symlink to
251+ # If it is a "top_level" package and debian is a symlink to
252 # "." then it will have found debian/changelog. Try and detect
253 # this.
254 debian_file_id = t.path2id('debian')
255@@ -164,7 +165,7 @@
256 t.kind(debian_file_id) == 'symlink' and
257 t.get_symlink_target(t.path2id('debian')) == '.'):
258 changelog_file = 'changelog'
259- larstiq = True
260+ top_level = True
261 mutter("Using '%s' to get package information", changelog_file)
262 changelog_id = t.path2id(changelog_file)
263 if changelog_id is None:
264@@ -177,7 +178,7 @@
265 changelog.parse_changelog(contents, max_blocks=max_blocks, allow_empty_author=True)
266 except ChangelogParseError, e:
267 raise UnparseableChangelog(str(e))
268- return changelog, larstiq
269+ return changelog, top_level
270
271
272 def strip_changelog_message(changes):
273@@ -583,7 +584,7 @@
274 Ubuntu.
275 """
276 try:
277- cl, larstiq = find_changelog(tree, merge, max_blocks=None)
278+ cl, top_level = find_changelog(tree, merge, max_blocks=None)
279 except UnparseableChangelog:
280 raise UnableToFindPreviousUpload()
281 return _find_previous_upload(cl)

Subscribers

People subscribed via source and target branches