[BUG] bogus name_version in bzr.newformat

John A Meinel john at arbash-meinel.com
Wed Oct 5 02:56:55 BST 2005


John A Meinel wrote:
> Martin Pool wrote:
>
>>On 05/10/05, John A Meinel <john at arbash-meinel.com> wrote:
>> The one thing I thought about is the statement:
>>
>>
>>>   On regular commits without merges, files that are unchanged retain
>>>   the same text_version they had in the basis version, and files whose
>>>   text is changed get a text_version equal to the new revision id. For
>>>   merges, files that had different versions in any of the parent trees
>>>   have their text version updated, even if the text is the same in all
>>>   of them.
>>>
>>>So some of this might be because of a merge. But why is the revision
>>>number for the "bzrlib" directory changing? As far as I know, it was
>>>only changed one time. Does that mean from then on, because somewhere in
>>>the ancestry (not the diverged ancestry, the common ancestry) it
>>>changed, now it always gets a new revision id.
>>>
>>>That is my guess. That the code which says "if this has changed in the
>>>ancestry, give it a new revision id", doesn't track the fact that the
>>>change occurred in the common portion of the ancestry.
>>>
>>>Which make me think we need to update it. It should be more thorough
>>>saying that "if the revision id for an entry is the same in both
>>>branches, then it should not be updated". I think that gives us the
>>>behaviour that we want.
>>
>>
>>That is what it's meant to mean; that seems to imply there should be
>>very few revisions of the bzrlib directory.
>
>
> The current code says this:
...

> I believe that means that it will check, and if all parent inventories
> say exactly the same thing about the file/directory, then they will
> continue to say the exact same thing about it.
>
> John
> =:->

Attached is the same code, only tested, and in changeset format.

Here is the simple test I used (which we might want to include as a test
case):

$ mkdir a
$ cd a
$ bzr init
$ echo "hello" > a
$ bzr add
added a
$ bzr commit -m "Added a"
added a
$ echo "changed a" > a
$ bzr commit -m "Changed a"
modified a
$ cd ..
$ bzr branch a b
$ cd b
$ echo "added c" > c
$ bzr add c
added c
$ bzr commit -m "Added c"
added c
$ cd ..
$ cd a
$ echo "added b" > b
$ bzr add
bzr added b
$ bzr commit -m "Added b"
added b
$ bzr merge ../b
0 conflicts encountered.

$ bzr st
added:
  c
pending merges:
  john at arbash-meinel.com-20051005014326-f16f4eeb71e08738
$ bzr commit -m "Merged branch b"
added c
$ bzr5 upgrade
bzr: starting upgrade of /Users/jameinel/dev/bzr/c
bzr: making backup of tree history
bzr: ./.bzr has been backed up to ./.bzr.backup
bzr: if conversion fails, you can move this directory back to .bzr
bzr: if it succeeds, you can remove this directory if you wish
bzr: starting upgrade
bzr: note: upgrade may be faster if all store files are ungzipped first
bzr: upgraded to weaves:

bzr:        5 revisions and inventories
bzr:        0 revisions not present
bzr:        4 texts


Now, if I use your version of the code I believe I get an extra version
of 'a', if I use my version, I don't.

John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: upgrade-picks-revison.cset
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20051004/005f9616/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051004/005f9616/attachment.pgp 


More information about the bazaar mailing list