Decentralized with shared mainline - commits to the mainline

Asked by Paweł Gajewski

How does users commit their local changes into the main repository?
Branching is described everywhere in much details but how about contributing back to the mainline?

Let's assume that I use the "Decentralized with shared mainline" pattern so there's an branch on the server. (Is the bzr needed to be installed on the server in this case?)
1. As a developer I do "bzr branch"
2. Make some changes to the code and do local "bzr commit"
3. More changes...
4. Ok it's ready to put my code into the main repo. How do I do it? "bzr push"?

In other words I want to merge my branch into server's branch. Can I do it without logging via ssh to the server? Does the push executes any "intelligent" merging or it just overrides the code?
What about the situation when two developers try to push in the same time?

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
John A Meinel (jameinel) said :
#1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/2/2011 2:06 AM, lubiluk wrote:
> New question #147462 on Bazaar:
> https://answers.launchpad.net/bzr/+question/147462
>
> How does users commit their local changes into the main repository?
> Branching is described everywhere in much details but how about contributing back to the mainline?
>
> Let's assume that I use the "Decentralized with shared mainline" pattern so there's an branch on the server. (Is the bzr needed to be installed on the server in this case?)
> 1. As a developer I do "bzr branch"
> 2. Make some changes to the code and do local "bzr commit"
> 3. More changes...
> 4. Ok it's ready to put my code into the main repo. How do I do it? "bzr push"?
>
> In other words I want to merge my branch into server's branch. Can I do it without logging via ssh to the server? Does the push executes any "intelligent" merging or it just overrides the code?
> What about the situation when two developers try to push in the same time?
>

You could get some hints from here:
http://doc.bazaar.canonical.com/bzr.dev/en/tutorials/centralized_workflow.html

There are a few ways to do it. The one I like the most is:

1) bzr co $project/trunk
2) bzr branch trunk mywork
3) cd mywork
4) bzr commit, etc.
5) cd ../trunk
6) bzr up
7) bzr merge ../mywork
8) bzr commit -m "Merge mywork into trunk"

The alternative to using a checkout, is to just use a regular branch,
and then pushing your changes back onto the remote mainline branch. The
main downside to doing it that way is that you can get divergence
between the time you commit, and the time you push. Especially if you
forget to update/pull first.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1uZlAACgkQJdeBCYSNAAPADQCfRrsIb0q8pBUn3x6xVf7bJ0lE
HVMAoK8UjVXZ7vr6Fh9ajxi1O3pXRAK5
=BSRa
-----END PGP SIGNATURE-----

Revision history for this message
Paweł Gajewski (lubiluk) said :
#2

Yes, that works but it's a bit tricky.

Is it possible to do in bazaar something like in git:
1) git clone ...
2) work, work
3) git add, git commit
4) git push

Everything nicely synchronized because git push takes care of the integrity of the data.
So why bzr push doesn't? Is there any way to use bzr in this manner?

Bazaar is designed to be very simple to use but actually it so confusing.

Revision history for this message
John A Meinel (jameinel) said :
#3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/4/2011 3:50 PM, Paweł Gajewski wrote:
> Question #147462 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/147462
>
> Status: Answered => Open
>
> Paweł Gajewski is still having a problem:
> Yes, that works but it's a bit tricky.
>
> Is it possible to do in bazaar something like in git:
> 1) git clone ...
> 2) work, work
> 3) git add, git commit
> 4) git push
>
> Everything nicely synchronized because git push takes care of the integrity of the data.
> So why bzr push doesn't? Is there any way to use bzr in this manner?
>
> Bazaar is designed to be very simple to use but actually it so
> confusing.
>

That works fine in bzr as well. Except you are oversimplifying the
problem. If you actually have more than one person using your branches,
that breaks in git. You have to do some sort of resolution process to
handle the fact that someone else pushed to your branch.

The workflow I described has a lot of benefits once you have more than 1
person working on the branch. Which is what "decentralized with shared
mainline" is all about.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1yKakACgkQJdeBCYSNAAOuUACg13+2lsB975Rp3+YCknh5Rs+n
FFIAoNC0YTwXs8xiWiZzl+ivI6fijKhr
=TdvW
-----END PGP SIGNATURE-----

Can you help with this problem?

Provide an answer of your own, or ask Paweł Gajewski for more information if necessary.

To post a message you must log in.