Pushing after merge considered harmful

Alexander Belchenko bialix at ukr.net
Tue Jan 26 09:20:05 GMT 2010


Eli Zaretskii пишет:
>> From: Alexander Belchenko <bialix at ukr.net>
>> Date: Tue, 26 Jan 2010 00:12:10 +0200
>>
>> Stefan Monnier пишет:
>>> Would it be possible to refuse a "bzr push" if it would change the
>>> destination's history by changing the order of the ancestors?
>> There is append_revisions_only option in branch.conf to do so.
>>
>> It can be set when branch created:
>>
>> bzr init --append-revisions-only
>>
>> Or after creation by editing .bzr/branch/branch.conf on the server, just add the line
>>
>> append_revisions_only = True
> 
> What operations on the repository does this option disable, exactly?
> The documentation in the manual, both for the option and for the
> "--append-revisions-only" switch to "bzr init" ("never change revnos
> or the existing log"), is less than minimal, really.  Can you please
> translate that into user-understandable English?  For example, would
> it be possible to add branches to the repository? how about deleting
> branches?

This option works on the individual branch level, not at the repo level.

I will try to explain the option, but I'm not native Englishman.

It prevents push to change revno for existing revisions in the branch.
So if you do:

bzr branch url/to/foo
cd foo
# hack-hack-hack
bzr commit -m "my hacks"
bzr push

then push will works, because your commits are direct children of the 
branch tip.

But if you do:

bzr branch url/to/foo
cd foo
# hack-hack-hack
bzr commit -m "my hacks"
# rats, can't push because branches diverged
# but what about merge?
bzr merge url/to/foo
bzr commit -m "merge trunk :-)"
bzr push

Then push won't work (with append option set) because in the result the 
mainline history will change: your local commits become mainline, and 
diverged mainline become merged (dotted) revisions.

Also `push --overwrite` won't work if branches are diverged.

Also this option prevents uncommit for this branch. (Again because it 
will change mainline history).




More information about the bazaar mailing list