Latest Posts

Topic: Bazaar won't update branch

GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2014-01-22, 09:15

I tried to do some work on https://code.launchpad.net/~widelands-dev/widelands/bug-1074353, but since there have been some changes done by someone else I need to grab those.

I tried bzr pull first, which seems to have updated from trunk instead of from the branch. I didn't see a problem with that, so I did a merge without committing. Then I tried bzr update, and I'm allegedly up to date with revision 6823. This is a lie, the current revision is 6825.

So I did a bzr revert and then a bzr update. bzr is still of the opinion that "Tree is up to date at revision 6823 of branch". What now?

All the documentation I have read assumes that you create a new branch and then work on it on your own and pull in changes from trunk, but not for the branch. I did grab changes from branches before, but I can't remember how I managed to do that face-sad.png


Busy indexing nil values

Top Quote
SirVer

Joined: 2009-02-19, 14:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2014-01-23, 05:51

Well, as soon as you have branched something you should no longer pull from trunk. only pull from the branch and only push to the branch. if you need something from master, you should merge that in. So in your case your starting workflow should look something like this:

$ bzr pull --remember lp:~widelands-dev/widelands/bug-1074353 
$ bzr push --remember lp:~widelands-dev/widelands/bug-1074353 # needed only once for the remember
$ bzr merge lp:widelands 
$ bzr commit -m "Merged master."  # After removing all merge conflicts, but before doing any more changes.
hack, hack, hack 
$ bzr commit -m "Added something new and cool" 
$ bzr push  #will push to the branch, not master.

the --remember means that you can just write bzr push or bzr pull in the future. Hope this helps.


Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2014-01-23, 09:48

$ bzr commit -m "Merged master." - this implies that I merged master? The point of my question is that I don't want to get the master, i just want to get the updates for the branch.

And for future reference: I take it that I'd have to change the remember every time I switch the branch I'm working on?


Busy indexing nil values

Top Quote
SirVer

Joined: 2009-02-19, 14:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2014-01-24, 10:22

GunChleoc wrote:

$ bzr commit -m "Merged master." - this implies that I merged master?

Yes, the two commands:

$ bzr merge lp:widelands  
$ bzr commit -m "Merged master."

are the commands to merge master, the first pulls in the changes, the second creates the merge commit (this is different to for example git, where the first command already creates the merge commit).

The point of my question is that I don't want to get the master, i just want to get the updates for the branch.

Right, I misunderstood. Then you only need the pull command.

And for future reference: I take it that I'd have to change the remember every time I switch the branch I'm working on?

That depends on how you switch. If you use bzr switch then no - each branch has its own history of its parents, so you should not need the remember each time.


Top Quote