Rev 3625: Fix bug #264321, properly fetch between non-rich-root formats and rich-root formats. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/bug_264321
John Arbash Meinel
john at arbash-meinel.com
Wed Sep 3 16:38:38 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/bug_264321
------------------------------------------------------------
revno: 3625
revision-id: john at arbash-meinel.com-20080903153836-5tzfnxixepoxgxax
parent: pqm at pqm.ubuntu.com-20080829171523-uocf850tnc8xz6qk
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bug_264321
timestamp: Wed 2008-09-03 10:38:36 -0500
message:
Fix bug #264321, properly fetch between non-rich-root formats and rich-root formats.
In my update to include --1.6.1-rich-root as a format, I also found
there were other formats missing from the InterKnit1And2 fetcher.
I added them, but incorrectly. The code said it was about subtrees,
but that was because it was brought in before rich-roots.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2008-08-29 15:28:46 +0000
+++ b/NEWS 2008-09-03 15:38:36 +0000
@@ -4,6 +4,17 @@
.. contents::
+IN DEVELOPMENT (1.6rc2?)
+------------------------
+
+ BUG FIXES:
+
+ * Copying between ``rich-root`` and ``rich-root-pack`` (and vice
+ versa) was accidentally using the inter-model fetcher, instead of
+ recognizing that both were 'rich root' formats.
+ (John Arbash Meinel, #264321)
+
+
bzr 1.6.1rc1 2008-08-29
-----------------------
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2008-08-29 02:39:18 +0000
+++ b/bzrlib/repository.py 2008-09-03 15:38:36 +0000
@@ -2921,22 +2921,40 @@
RepositoryFormatKnitPack5RichRoot,
RepositoryFormatPackDevelopment0,
RepositoryFormatPackDevelopment0Subtree,
- )
- nosubtrees = (
- RepositoryFormatKnit1,
- RepositoryFormatKnitPack1,
- RepositoryFormatPackDevelopment0,
- RepositoryFormatKnitPack4,
- RepositoryFormatKnitPack5,
- RepositoryFormatKnitPack5RichRoot,
- )
- subtrees = (
- RepositoryFormatKnit3,
- RepositoryFormatKnitPack3,
- RepositoryFormatPackDevelopment0Subtree,
- )
- return (isinstance(source._format, nosubtrees) and
- isinstance(target._format, subtrees))
+ RepositoryFormatPackDevelopment1,
+ RepositoryFormatPackDevelopment1Subtree,
+ )
+ norichroot = (
+ RepositoryFormatKnit1, # no rr, no subtree
+ RepositoryFormatKnitPack1, # no rr, no subtree
+ RepositoryFormatPackDevelopment0, # no rr, no subtree
+ RepositoryFormatPackDevelopment1, # no rr, no subtree
+ RepositoryFormatKnitPack5, # no rr, no subtree
+ )
+ richroot = (
+ RepositoryFormatKnit3, # rr, subtree
+ RepositoryFormatKnitPack3, # rr, subtree
+ RepositoryFormatKnitPack4, # rr, no subtree
+ RepositoryFormatKnitPack5RichRoot,# rr, no subtree
+ RepositoryFormatPackDevelopment0Subtree, # rr, subtree
+ RepositoryFormatPackDevelopment1Subtree, # rr, subtree
+ )
+ for format in norichroot:
+ if format.rich_root_data:
+ raise AssertionError('Format %s is a rich-root format'
+ ' but is included in the non-rich-root list'
+ % (format,))
+ for format in richroot:
+ if not format.rich_root_data:
+ raise AssertionError('Format %s is not a rich-root format'
+ ' but is included in the rich-root list'
+ % (format,))
+ # TODO: One alternative is to just check format.rich_root_data,
+ # instead of keeping membership lists. However, the formats
+ # *also* have to use the same 'Knit' style of storage
+ # (line-deltas, fulltexts, etc.)
+ return (isinstance(source._format, norichroot) and
+ isinstance(target._format, richroot))
except AttributeError:
return False
More information about the bazaar-commits
mailing list