Support forums : The Future

Merging to core

The future of this project but not in a "I want a pony" sort of way. This is all about everything meta about Quam Plures. The general direction, the support tools, stuff like that.

Moderator: Dracones

Merging to core

Postby leeturner » Sat Oct 08, 2011 5:25 pm

OK, I have all the branch, update, commit, R2M workflow sorted out and for that I use the command line bzr tools. What I don't know how to do is to take a branch that someone else has done and merge it to core (now I have gate keeper powers and all that).

Can anyone point me in the right direction - preferably with the use of command line goodness ?

Cheers
L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: Merging to core

Postby EdB » Sat Oct 08, 2011 7:12 pm

Tblue will have it down for ya, but I'll try a quick stab at it without ANY actual mechanism defined.

1) Double-triple-quadruple check everything you are about to do.
2) Get fresh brand new shiny bright branch of core (name as you see fit, I always delete my "quam-plures" and get that name again)
3) Repeat step one
4) MERGE branch_you_want_in_core into shiny_new_copy_of_core
5) Repeat step one
6) COMMIT shiny_new_copy_of_core

One thing I almost always forget in #6 is to put the name of the branch author into it. LP/BZR is so friggin stupid about that: it knows everything about changes in everything back to the dawn of time down to the last comma, but it can't seem to figure out who actually contributed to the branch getting merged into something else? Sheesh...

Anyway a good way to figure it out without risk to core is to get core, push it as "testing-whatever", then merge your target branch into your test-whatever. Have you done much of getting changes to your computer that someone else has sent to LP? Have you done much of merging changes into a branch on your computer? If not we can work together on this. You make a new branch for a playground thing. I'll branch it and do some obviously huge changes. You then go through the steps above and see the changes in your playground branch on LP. That'll tell you that you got the steps eh?
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Merging to core

Postby leeturner » Thu Oct 13, 2011 9:25 pm

Sorry for the delay in getting back to you on this. If only I didn't have to deal with client work :-(

OK, my normal workflow when I am making changes is based on what Yabs originally put out on the forums:

Code: Select all
cd ~/qp-stuff/ ## move to my qp folder
bzr branch lp:quam-plures my_new_branch_folder_name ## downloads the latest trunk and slaps it in a folder called my_new_branch_folder
cd my_new_branch_folder ## self explannatory
bzr push lp:~leeturner/quam-plures/my_new_branch_name ## creates a shiny new branch called my_new_branch_name on launchpad and uploads your files to it
bzr bind lp:~leeturner/quam-plures/my_new_branch_name ## links your my_new_branch_folder to my_new_branch for commits etc

Now I have a new folder on my HDD where I can play with the code I want to work on. I make all my code changes in that folder and to send them back to launchpad I just type

bzr commit -m "my groovy reason for committing"


If my changes are taking a long time then I make sure I keep my branch up to date with core by doing a

Code: Select all
bzr merge


If I am testing someone else's branch (which I need to pull my finger out on) then I just grab a copy of their branch like:

Code: Select all
bzr branch lp:~edb/quam-plures/intro_post_tweak


and deploy and test.

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: Merging to core

Postby EdB » Fri Oct 14, 2011 12:28 am

I think you have all the pieces, just got to put them together at the core level.

checkout : new_copy_of_core
bind : to core (which it probably already is)
merge : branch you want INTO your new_copy_of_core
commit : "cute message explaining"

I can see the bzr commands as I use the GUI so this shouldn't take too long...
Code: Select all
bzr checkout lp:quam-plures "C:\Documents and Settings\EdB\Desktop\QP branches\branches_mine\shiny_new_core

My next step is to push it to a home that isn't core, but for core updating you obviously skip this step.
Code: Select all
bzr push lp:~edb/quam-plures/shiny_new_core

Next I have to unbind in order to have the bind option available. Perhaps the bind command automagically unbinds? Perhaps the way you are getting a branch means it is unbound? Dunno! Anyway your core update task will need your shiny_new_core to be bound to core itself.
Code: Select all
bzr unbind
bzr bind lp:~edb/quam-plures/shiny_new_core

Now the good stuff: actually merging something into shiny_new_core:
Code: Select all
bzr merge lp:~edb/quam-plures/intro_post_tweak --directory "C:/Documents and Settings/EdB/Desktop/QP branches/branches_mine/shin...
It truncated that string. It shows me commands, but obviously not in the same way you see them if you actually use command line.

Now I have a new core with a merged in branch, so it is time to commit the changes complete with a fake author credit. Remember I bound this to elsewhere and you need to be bound to core itself. Otherwise it's the same exact thing.
Code: Select all
bzr commit -m "this is my commit message" "--author=Lee <lees_email_addy@lees_domain.tld>"
Connected (version 2.0, client Twisted)
Authentication (publickey) successful!
Secsh channel 1 opened.
Committing to: bzr+ssh://bazaar.launchpad.net/~edb/quam-plures/shiny_new_core/
modified qp_inc/items/model/_item.funcs.php
Committed revision 7636.


So yeah you got it all going on, just got to string it together for a core commit. Single biggest diff is that your new copy of core needs to be bound to core. I can't find a command that will tell me what any given branch I have is bound to, but I did learn that it seems possible to get files that are not bound to anything. Thus you need to figure out how to bind to core. I can probably cheat my way to that because each time I bind and unbind the unbind command defaults to the last bound branch. Which means if I branch and unbind then rebind I'll know the bzr command :)
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Merging to core

Postby leeturner » Fri Oct 14, 2011 9:46 am

OK, cool. Thanks for that. Looks like it is time to have a play.

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: Merging to core

Postby Tblue » Sat Oct 15, 2011 12:50 pm

Weee, I have been quite busy during the last few weeks (uni...) which should explain why I didn't get anything done in regards to QP... Sorry about that.
Tblue
Dracone
 
Posts: 340
Joined: Sat Nov 21, 2009 1:35 pm
Location: Berlin, Germany

Re: Merging to core

Postby leeturner » Sat Oct 15, 2011 1:07 pm

No worries. We all have other things to do. That is why I am getting up to speed with merging to core. What with EdB building QP5 there is only me and you who will merge new changes to core (unless Ed wants to dip in every now and then).

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK


Return to The Future

Who is online

Users browsing this forum: No registered users and 1 guest

cron