overwrote a branch

William Grant william.grant at canonical.com
Tue Jun 5 01:25:15 UTC 2012


On 05/06/12 11:06, Loic J. Duros wrote:
> Hello:
> 
> I have basically two branches in my repository: "dev" in which I do all
> the dev work, and "trunk", in which I mostly merge stuff from dev when
> I'm ready to create a new version.
> 
> My local dev branch is checked out from the remote one (on savannah).
> Today I wanted to do 'bzr merge ../trunk' to get a commit I made on my
> local trunk, but instead I did 'bzr pull ../trunk', and as a result my
> remote and my local dev branch are just a copy of the trunk. I used to
> have 889 revisions in dev, only 539 in trunk, but now both of them show
> 539. How can I get my old branch with the 889 commits? I should mention
> that all the revisions from dev were probably merged to trunk, but it's
> hard to tell since they get aggregated under a new number and commit text.
> 
> here is the dev branch:
> http://bzr.savannah.gnu.org/lh/librejs/dev/changes/541
> and here is the trunk: http://bzr.savannah.gnu.org/lh/librejs/trunk/changes

If you run 'bzr log --include-merges' in dev, you'll see that the latest
revision with a branch nick of 'dev' is r530.1.356, which was merged
into trunk at r540.

So, to recover the original history just run "bzr pull --overwrite
-r530.1.356 ." in the dev branch. r530.1.356 is now r886. You'll need to
then 'bzr push --overwrite' rather than the normal 'bzr push'.

You can set the append_revisions_only flag on the remote branch to
prevent this from happening again. See
<https://lists.ubuntu.com/archives/bazaar/2008q3/046797.html> for details.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20120605/45eff522/attachment-0001.pgp>


More information about the bazaar mailing list