Question/idea about multiple developers committing to one branch

Nicholas Allen allen at ableton.com
Wed Nov 29 13:44:13 GMT 2006


Hi,

As I understand it, when multiple develops commit their changes to the 
same branch there is 3 ways of doing this in bzr:

 1 They all do a push to the shared branch. If others have pushed before 
then they have to merge into their local branch, resolve conflicts, 
commit and try push again.
 2 They use checkouts (or bound branches) and must first update their 
branch before they can commit their changes (or they commit locally).
 3 PQM

The first approach has the advantage it needs no setup but has the 
disadvantage that the revision history changes order on the shared 
branch. So if one developer pushes his changes to the main branch then 
revision history contains his revisions. Then when another developer 
merges these changes into his local branch and then pushes his branch, 
the revision history changes so that his commits come before the first 
developers (even though he committed his changes after the first 
developer). This means that the revision numbers do not always refer to 
the same revisions. So on the main branch revision 10 could be one 
developer's change and a while later it could be an entirely different 
change altogether possibly from a different developer. I know this is 
not really a problem as all revisions have a unique identifier but this 
changing of the log history may not be desired on certain shared branches.

So if you don't want this behavior in a shared branch then you have to 
use one of the other 2 approaches. In the case of the second option 
though it is the user of the branch that decides if they use a checkout 
(or bind an existing branch). If all developers don't do this then you 
have the same problem. So there is no way to force this mode for all 
commits to the main branch. Setting up PQM may also be overkill in many 
situations or just too difficult so this may not be the most appropriate 
solution.

What I think would be cool is if the smart server could enforce that all 
commits coming into it are through bound branches or checkouts. This 
would ensure that multiple developers could checkin to a shared branch 
and the revision history would never change order. Revision 10 would 
always be the same revision and change by the same developer. It would 
also be easier to setup than the PQM.

Not sure if I explained that very well but is this something that could 
be done in the smart server?

Cheers,

Nick




More information about the bazaar mailing list