Merge lp:~lifeless/bzr/bug-416732 into lp:~bzr/bzr/trunk-old

Proposed by Robert Collins
Status: Merged
Approved by: Andrew Bennetts
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr/bug-416732
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 98 lines (has conflicts)
Text conflict in NEWS
To merge this branch: bzr merge lp:~lifeless/bzr/bug-416732
Reviewer Review Type Date Requested Status
Martin Pool Approve
Vincent Ladeuil Approve
Andrew Bennetts Approve
Review via email: mp+10828@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Do not add the root directory entry to the list of expected keys during
check in non rich-root repositories. (#416732)

Basically a very shallow bug - read inventory.py in the diff :)

-Rob

Revision history for this message
Andrew Bennetts (spiv) wrote :

Makes sense to me.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

One-liner indeed, but the comment says: 'is da... below' if that's not a typo for 'is as... below',
I fail to understand it.

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

This should actually be merged into 2.0.

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

I'll send this to pqm for 2.0.

vila, the 'da...' means the hex number starting with da.

Revision history for this message
Martin Pool (mbp) wrote :

2009/8/28 Martin Pool <email address hidden>:
> I'll send this to pqm for 2.0.

OK, this can't actually be directly merged because it's based off
trunk not 2.0. I'll leave it for Robert to cherrypick it out, to
avoid errors.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Robert Collins (lifeless) wrote :

On Fri, 2009-08-28 at 07:18 +0000, Martin Pool wrote:
> 2009/8/28 Martin Pool <email address hidden>:
> > I'll send this to pqm for 2.0.
>
> OK, this can't actually be directly merged because it's based off
> trunk not 2.0. I'll leave it for Robert to cherrypick it out, to
> avoid errors.

Just merge -c should work fine; the 'da' typo should indeed be 'is as',
and the start_series typo will need to be start_server.

I'll correct and land first thing Monday if noone beats me to it.

-Rob

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-08-28 22:24:40 +0000
+++ NEWS 2009-08-29 03:35:20 +0000
@@ -101,6 +101,7 @@
101Bug Fixes101Bug Fixes
102*********102*********
103103
104<<<<<<< TREE
104* Further tweaks to handling of ``bzr add`` messages about ignored files.105* Further tweaks to handling of ``bzr add`` messages about ignored files.
105 (Jason Spashett, #76616)106 (Jason Spashett, #76616)
106107
@@ -110,6 +111,12 @@
110 recombining to work, switching to 'unordered' fetches avoids the111 recombining to work, switching to 'unordered' fetches avoids the
111 fragmentation. (John Arbash Meinel, #402645)112 fragmentation. (John Arbash Meinel, #402645)
112113
114=======
115* ``bzr check`` in pack-0.92, 1.6 and 1.9 format repositories will no
116 longer report incorrect errors about ``Missing inventory ('TREE_ROOT', ...)``
117 (Robert Collins, #416732)
118
119>>>>>>> MERGE-SOURCE
113* Fix a pycurl related test failure on karmic by recognizing an error120* Fix a pycurl related test failure on karmic by recognizing an error
114 raised by newer versions of pycurl.121 raised by newer versions of pycurl.
115 (Vincent Ladeuil, #306264)122 (Vincent Ladeuil, #306264)
116123
=== modified file 'bzrlib/inventory.py'
--- bzrlib/inventory.py 2009-08-28 05:00:33 +0000
+++ bzrlib/inventory.py 2009-08-29 03:35:20 +0000
@@ -437,7 +437,13 @@
437 self.text_id is not None):437 self.text_id is not None):
438 checker._report_items.append('directory {%s} has text in revision {%s}'438 checker._report_items.append('directory {%s} has text in revision {%s}'
439 % (self.file_id, rev_id))439 % (self.file_id, rev_id))
440 # Directories are stored as ''.440 # In non rich root repositories we do not expect a file graph for the
441 # root.
442 if self.name == '' and not checker.rich_roots:
443 return
444 # Directories are stored as an empty file, but the file should exist
445 # to provide a per-fileid log. The hash of every directory content is
446 # da... below (sha1sum('')).
441 checker.add_pending_item(rev_id,447 checker.add_pending_item(rev_id,
442 ('texts', self.file_id, self.revision), 'text',448 ('texts', self.file_id, self.revision), 'text',
443 'da39a3ee5e6b4b0d3255bfef95601890afd80709')449 'da39a3ee5e6b4b0d3255bfef95601890afd80709')
444450
=== modified file 'bzrlib/repository.py'
--- bzrlib/repository.py 2009-08-28 05:00:33 +0000
+++ bzrlib/repository.py 2009-08-29 03:35:20 +0000
@@ -1222,7 +1222,7 @@
1222 for record in getattr(self, kind).check(keys=keys[kind]):1222 for record in getattr(self, kind).check(keys=keys[kind]):
1223 if record.storage_kind == 'absent':1223 if record.storage_kind == 'absent':
1224 checker._report_items.append(1224 checker._report_items.append(
1225 'Missing inventory {%s}' % (record.key,))1225 'Missing %s {%s}' % (kind, record.key,))
1226 else:1226 else:
1227 last_object = self._check_record(kind, record,1227 last_object = self._check_record(kind, record,
1228 checker, last_object, current_keys[(kind,) + record.key])1228 checker, last_object, current_keys[(kind,) + record.key])
12291229
=== modified file 'bzrlib/tests/per_repository/test_check.py'
--- bzrlib/tests/per_repository/test_check.py 2009-05-12 05:34:15 +0000
+++ bzrlib/tests/per_repository/test_check.py 2009-08-29 03:35:20 +0000
@@ -17,9 +17,13 @@
1717
18"""Test operations that check the repository for corruption"""18"""Test operations that check the repository for corruption"""
1919
20import os
2021
21from bzrlib import (22from bzrlib import (
23 check,
24 config as _mod_config,
22 errors,25 errors,
26 inventory,
23 revision as _mod_revision,27 revision as _mod_revision,
24 )28 )
25from bzrlib.tests import TestNotApplicable29from bzrlib.tests import TestNotApplicable
@@ -125,3 +129,23 @@
125 def branch_callback(self, refs):129 def branch_callback(self, refs):
126 self.callbacks.append(('branch', refs))130 self.callbacks.append(('branch', refs))
127 return self.branch_check(refs)131 return self.branch_check(refs)
132
133
134class TestCleanRepository(TestCaseWithRepository):
135
136 def test_new_repo(self):
137 repo = self.make_repository('foo')
138 repo.lock_write()
139 self.addCleanup(repo.unlock)
140 config = _mod_config.Config()
141 os.environ['BZR_EMAIL'] = 'foo@sample.com'
142 builder = repo.get_commit_builder(None, [], config)
143 list(builder.record_iter_changes(None, _mod_revision.NULL_REVISION, [
144 ('TREE_ROOT', (None, ''), True, (False, True), (None, None),
145 (None, ''), (None, 'directory'), (None, False))]))
146 builder.finish_inventory()
147 rev_id = builder.commit('first post')
148 result = repo.check(None, check_repo=True)
149 result.report_results(True)
150 log = self._get_log(keep_log_file=True)
151 self.assertFalse('Missing' in log, "Something was missing in %r" % log)