Merge lp:~joe.julian/bzr/bdist_rpm into lp:bzr

Proposed by Joe Julian
Status: Merged
Merged at revision: not available
Proposed branch: lp:~joe.julian/bzr/bdist_rpm
Merge into: lp:bzr
Diff against target: 187 lines (+78/-20)
7 files modified
MANIFEST.in (+3/-0)
NEWS (+9/-0)
README_BDIST_RPM (+8/-0)
bzrlib/builtins.py (+19/-15)
bzrlib/tests/blackbox/test_annotate.py (+18/-4)
bzrlib/tests/test_trace.py (+15/-0)
bzrlib/trace.py (+6/-1)
To merge this branch: bzr merge lp:~joe.julian/bzr/bdist_rpm
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+17085@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Joe Julian (joe.julian) wrote :

This patch creates a MANIFEST.in file so the include files and tools directory are included in the rpmbuild source. There is also a README_BDIST_RPM explaining about the bug in disttools that prevents a successful build on some distributions and how to fix that bug.

This README can be removed once disttools is repaired and released.

Revision history for this message
John A Meinel (jameinel) wrote :

The diff doesn't look quite right, as it includes a bunch of things other than just MANIFEST.in and README_BDIST_RPM. And the other things look like changes that Andrew and myself had done...

Anyway, I'm sure the MANIFEST.in needs at least a *.txt, since we use bzrlib/help_topics/en/* as part of the runtime system (eg, bzr help authentication).

Using:
  bzr ls -R bzrlib/ | sed 's/.*\(\..*\)/\1/' | grep -v '/' | sort -u

We have these extensions:
.c
.crt
.csr
.h
.key
.patch
.pxd
.py
.pyc
.pyd
.pyx
.txt

Assuming we don't care about the test suite, the .crt and .csr aren't needed (we also have a few files without extensions used by the test suite). Same for .patch .key. Certainly .pyc isn't needed, and we wouldn't want to bundle .pyd (or .so). So I think the line should be:
recursive-include bzrlib *.py *.pyx *.pxd *.txt *.c *.h

review: Needs Fixing
Revision history for this message
John A Meinel (jameinel) wrote :

I went ahead and cleaned it up a bit, added a NEWS entry, and submitted it from:
lp:~jameinel/bzr/bdist_rpm

I also submitted this to the 2.0 branch since it seems reasonable and linked it to bug #175839.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'MANIFEST.in'
--- MANIFEST.in 1970-01-01 00:00:00 +0000
+++ MANIFEST.in 2010-01-10 02:33:27 +0000
@@ -0,0 +1,3 @@
1include bzr README setup.py
2recursive-include bzrlib *.py *.pyx *.pxd *.c *.h
3recursive-include tools *.py
04
=== modified file 'NEWS'
--- NEWS 2010-01-08 09:27:39 +0000
+++ NEWS 2010-01-10 02:33:27 +0000
@@ -177,6 +177,9 @@
177Bug Fixes177Bug Fixes
178*********178*********
179179
180* ``bzr annotate`` on another branch with ``-r branch:...`` no longer
181 fails with an ``ObjectNotLocked`` error. (Andrew Bennetts, #496590)
182
180* ``bzr export dir`` now requests all file content as a record stream,183* ``bzr export dir`` now requests all file content as a record stream,
181 rather than requsting the file content one file-at-a-time. This can make184 rather than requsting the file content one file-at-a-time. This can make
182 exporting over the network significantly faster (54min => 9min in one185 exporting over the network significantly faster (54min => 9min in one
@@ -195,6 +198,12 @@
195* Give a clearer message if the lockdir disappears after being apparently198* Give a clearer message if the lockdir disappears after being apparently
196 successfully taken. (Martin Pool, #498378)199 successfully taken. (Martin Pool, #498378)
197200
201* If we fail to open ``~/.bzr.log`` write a clear message to stderr rather
202 than using ``warning()``. The log file is opened before logging is set
203 up, and it leads to very confusing: 'no handlers for "bzr"' messages for
204 users, rather than something nicer.
205 (John Arbash Meinel, Barry Warsaw, #503886)
206
198* The 2a format wasn't properly restarting autopacks when something207* The 2a format wasn't properly restarting autopacks when something
199 changed underneath it (like another autopack). Now concurrent208 changed underneath it (like another autopack). Now concurrent
200 autopackers will properly succeed. (John Arbash Meinel, #495000)209 autopackers will properly succeed. (John Arbash Meinel, #495000)
201210
=== added file 'README_BDIST_RPM'
--- README_BDIST_RPM 1970-01-01 00:00:00 +0000
+++ README_BDIST_RPM 2010-01-10 02:33:27 +0000
@@ -0,0 +1,8 @@
1There is a bug in disttools for distributions who's rpmbuild compresses
2the man pages. This causes an error building the final packages as it's
3expecting bzr.1 and not finding it, but finding bzr.1.gz that's unpackaged.
4
5This bug is known to affect Fedora, RHEL, and Centos distributions.
6
7There is a preliminary patch at http://bugs.python.org/issue644744 that
8fixes this issue with disttools.
09
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2009-12-23 05:42:33 +0000
+++ bzrlib/builtins.py 2010-01-10 02:33:27 +0000
@@ -4537,21 +4537,25 @@
4537 branch.lock_read()4537 branch.lock_read()
4538 try:4538 try:
4539 tree = _get_one_revision_tree('annotate', revision, branch=branch)4539 tree = _get_one_revision_tree('annotate', revision, branch=branch)
4540 if wt is not None:4540 tree.lock_read()
4541 file_id = wt.path2id(relpath)4541 try:
4542 else:4542 if wt is not None:
4543 file_id = tree.path2id(relpath)4543 file_id = wt.path2id(relpath)
4544 if file_id is None:4544 else:
4545 raise errors.NotVersionedError(filename)4545 file_id = tree.path2id(relpath)
4546 file_version = tree.inventory[file_id].revision4546 if file_id is None:
4547 if wt is not None and revision is None:4547 raise errors.NotVersionedError(filename)
4548 # If there is a tree and we're not annotating historical4548 file_version = tree.inventory[file_id].revision
4549 # versions, annotate the working tree's content.4549 if wt is not None and revision is None:
4550 annotate_file_tree(wt, file_id, self.outf, long, all,4550 # If there is a tree and we're not annotating historical
4551 show_ids=show_ids)4551 # versions, annotate the working tree's content.
4552 else:4552 annotate_file_tree(wt, file_id, self.outf, long, all,
4553 annotate_file(branch, file_version, file_id, long, all, self.outf,4553 show_ids=show_ids)
4554 show_ids=show_ids)4554 else:
4555 annotate_file(branch, file_version, file_id, long, all,
4556 self.outf, show_ids=show_ids)
4557 finally:
4558 tree.unlock()
4555 finally:4559 finally:
4556 if wt is not None:4560 if wt is not None:
4557 wt.unlock()4561 wt.unlock()
45584562
=== modified file 'bzrlib/tests/blackbox/test_annotate.py'
--- bzrlib/tests/blackbox/test_annotate.py 2009-03-23 14:59:43 +0000
+++ bzrlib/tests/blackbox/test_annotate.py 2010-01-10 02:33:27 +0000
@@ -29,6 +29,7 @@
29from bzrlib.branch import Branch29from bzrlib.branch import Branch
30from bzrlib.config import extract_email_address30from bzrlib.config import extract_email_address
31from bzrlib.tests import TestCaseWithTransport31from bzrlib.tests import TestCaseWithTransport
32from bzrlib.urlutils import joinpath
3233
3334
34class TestAnnotate(TestCaseWithTransport):35class TestAnnotate(TestCaseWithTransport):
@@ -153,14 +154,27 @@
153class TestSimpleAnnotate(TestCaseWithTransport):154class TestSimpleAnnotate(TestCaseWithTransport):
154 """Annotate tests with no complex setup."""155 """Annotate tests with no complex setup."""
155156
156 def _setup_edited_file(self):157 def _setup_edited_file(self, relpath='.'):
157 """Create a tree with a locally edited file."""158 """Create a tree with a locally edited file."""
158 tree = self.make_branch_and_tree('.')159 tree = self.make_branch_and_tree(relpath)
159 self.build_tree_contents([('file', 'foo\ngam\n')])160 file_relpath = joinpath(relpath, 'file')
161 self.build_tree_contents([(file_relpath, 'foo\ngam\n')])
160 tree.add('file')162 tree.add('file')
161 tree.commit('add file', committer="test@host", rev_id="rev1")163 tree.commit('add file', committer="test@host", rev_id="rev1")
162 self.build_tree_contents([('file', 'foo\nbar\ngam\n')])164 self.build_tree_contents([(file_relpath, 'foo\nbar\ngam\n')])
163 tree.branch.get_config().set_user_option('email', 'current@host2')165 tree.branch.get_config().set_user_option('email', 'current@host2')
166 return tree
167
168 def test_annotate_cmd_revspec_branch(self):
169 tree = self._setup_edited_file('trunk')
170 tree.branch.create_checkout(self.get_url('work'), lightweight=True)
171 os.chdir('work')
172 out, err = self.run_bzr('annotate file -r branch:../trunk')
173 self.assertEqual('', err)
174 self.assertEqual(
175 '1 test@ho | foo\n'
176 ' | gam\n',
177 out)
164178
165 def test_annotate_edited_file(self):179 def test_annotate_edited_file(self):
166 tree = self._setup_edited_file()180 tree = self._setup_edited_file()
167181
=== modified file 'bzrlib/tests/test_trace.py'
--- bzrlib/tests/test_trace.py 2009-12-16 22:29:31 +0000
+++ bzrlib/tests/test_trace.py 2010-01-10 02:33:27 +0000
@@ -27,6 +27,7 @@
2727
28from bzrlib import (28from bzrlib import (
29 errors,29 errors,
30 trace,
30 )31 )
31from bzrlib.tests import TestCaseInTempDir, TestCase32from bzrlib.tests import TestCaseInTempDir, TestCase
32from bzrlib.trace import (33from bzrlib.trace import (
@@ -248,6 +249,20 @@
248 tmp1.close()249 tmp1.close()
249 tmp2.close()250 tmp2.close()
250251
252 def test__open_bzr_log_uses_stderr_for_failures(self):
253 # If _open_bzr_log cannot open the file, then we should write the
254 # warning to stderr. Since this is normally happening before logging is
255 # set up.
256 self.addCleanup(setattr, sys, 'stderr', sys.stderr)
257 self.addCleanup(setattr, trace, '_bzr_log_filename',
258 trace._bzr_log_filename)
259 sys.stderr = StringIO()
260 # Set the log file to something that cannot exist
261 os.environ['BZR_LOG'] = os.getcwd() + '/no-dir/bzr.log'
262 logf = trace._open_bzr_log()
263 self.assertIs(None, logf)
264 self.assertContainsRe(sys.stderr.getvalue(),
265 'failed to open trace file: .*/no-dir/bzr.log')
251266
252class TestVerbosityLevel(TestCase):267class TestVerbosityLevel(TestCase):
253268
254269
=== modified file 'bzrlib/trace.py'
--- bzrlib/trace.py 2009-12-01 05:35:52 +0000
+++ bzrlib/trace.py 2010-01-10 02:33:27 +0000
@@ -250,7 +250,12 @@
250 bzr_log_file.write("bug reports to https://bugs.launchpad.net/bzr/+filebug\n\n")250 bzr_log_file.write("bug reports to https://bugs.launchpad.net/bzr/+filebug\n\n")
251 return bzr_log_file251 return bzr_log_file
252 except IOError, e:252 except IOError, e:
253 warning("failed to open trace file: %s" % (e))253 # If we are failing to open the log, then most likely logging has not
254 # been set up yet. So we just write to stderr rather than using
255 # 'warning()'. If we using warning(), users get the unhelpful 'no
256 # handlers registered for "bzr"' when something goes wrong on the
257 # server. (bug #503886)
258 sys.stderr.write("failed to open trace file: %s\n" % (e,))
254 # TODO: What should happen if we fail to open the trace file? Maybe the259 # TODO: What should happen if we fail to open the trace file? Maybe the
255 # objects should be pointed at /dev/null or the equivalent? Currently260 # objects should be pointed at /dev/null or the equivalent? Currently
256 # returns None which will cause failures later.261 # returns None which will cause failures later.