views:

65

answers:

3

A developer in my team has been using a branch bound to the server (IE, only using checkout, update, and commit), but also often uses the --local flag on commit and then commits to the server in a batch. She recently experienced a situation where she is missing some local commits, and can't find them in the repo OR her local code. She suspects that this is because she did a pull at some point in bettween local commits and server commits.

Neither of us are particularly experience with Bazaar -- What may have happened, and where can we look for this missing code? She is fairly certain that she never did anything destructive, and I am fairly certain that Bazaar would have asked her if it was going to do that. I vaguely remember that Bazaar has some notion of "hidden" repos/trees/whatever where it puts things before changing a bunch of code, from which someone might recover lost code, but I can't manage to google for what that is.

A: 

At any time you can do a

bzr status

and this will should you if there are any uncommitted changes, including merges that have not been committed. This may help in determining where everything is at. If you do a merge and you haven't followed it up with a commit (whether or not there were conflicts) then the result of the merge will remain uncommitted.

Doing a bzr pull shouldn't have wiped out any work - as I understand it, it should just fail if the local branch has uncommitted changes.

thomasrutter
Yep, that's the usual workflow, but in this case status showed a clean working tree, even though my code was missing. `bzr heads` showed the dead head, from which I merged in my lost changes.
John
Wasn't aware of dead heads so I learned something here!
thomasrutter
+2  A: 

If all else fails, you can try asking in the bazaar IRC channel.

Go there now* and wander into the #bzr channel. There are usually people there and they are usually helpful.

*That's freenode's web interface. If you haven't used IRC before, you make up your own nickname, choose the #bzr channel, and no need to auth (as long as your nickname is unique).

thomasrutter
Thanks! I actually went there before here, but no one was around. That place is very helpful! Then it became morning in europe and people woke up and answered my question (which I will share after writing this).
John
+3  A: 

I figured out that the "'hidden' repos/trees/whatever" that I was referring to are "dead heads", viewed with bzr heads.

We found our dead head and merged it back in -- code saved!

$ bzr heads
$ # output shows various heads, with names like: revision-id: john@mycomputer-20100630175358-39qro1z5qdq2o9ay(dead)
$ bzr merge john@mycomputer-20100630175358-39qro1z5qdq2o9ay
John
Glad you solved it
thomasrutter
Correct. You need bzrtools plugin installed to make `bzr heads --dead` working.
bialix