lost commits in our repo!

Jelmer Vernooij jelmer at samba.org
Fri Sep 26 01:04:40 BST 2008


Hi Sebastian,

Am Donnerstag, den 25.09.2008, 14:10 -0600 schrieb Sebastian Kuzminsky:
> Did that get your attention?  It's not quite that bad, all that was 
> really lost was the commit messages, not the changes to the files.  Let 
> me explain.
> 
> I'm working on a project with some other people.  We keep our project in 
> a Subversion repo.
> 
> I made a bzr shared repo and branched our svn repo into it, into a bzr 
> branch that i named "upstream".  I only grabbed /trunk from svn.  That 
> took a while but worked fine.
> 
> Then locally I branched "upstream" to "dev", and loomified dev.  I made 
> some threads and some commits in my threads.  I pushed some of my 
> threads to the svn repo, pulled the svn repo into my bottom thread, ran 
> "bzr combine-thread" to drop the pushed threads, and things worked fine. 
>   I thought "Yay, i can use bzr & loom to work on this project!".
> 
> Then other people woke up and started committing to the svn repo.
> 
> I was happily hacking in my loom, and when I was done i moved down to 
> the lowest thread and ran "bzr pull" from the svn repo.  The other 
> people's commits were pulled into the bottom thread no problem.
> 
> Then I went up to the first thread above the bottom, and all the other 
> people's changes showed up as "M" changed files (there were no conflicts 
> with my commited changes on that thread).  I committed the merge and ran 
> "bzr push" to the svn repo.
> 
> This is where the troubles showed up...
> 
> When I look at the svn repo now, the other people's commits from this 
> morning are gone, replaced by a single commit from me that contains all 
> their file changes, and that has the log message "merge".  Oops!
> 
> I've pastebinned the output of some commands.  Here's what bzr thinks: 
> <http://pastebin.ca/1210846>, and here's what svn thinks: 
> <http://pastebin.ca/1210852>.  Notice that svn revisions 12188 and 12189 
> are missing.  Together they resulted in the same changes to the tree as 
> bzr revision 11532.  Also note that in the svn repo, the first bzr/loom 
> commit that I pushed after others committed in svn is svn rev 12190, and 
> it *replaces* /trunk with svn rev 12187, which is the rev before my 
> friends committed their changes.
> 
> Is this how it's supposed to work?  Or is this some limitation imposed 
> by writing to an SVN repo?  Or is it a bug?
Yes, this is intentional. From the bzr-svn FAQ:

bzr-svn did a replace operation on the branch I pushed to when I tried
to push a merge commit to Subversion
-----------------------------------------------------------------------------------------------------------
Yes, this is because bzr-svn has to preserve the mainline history of
your Bazaar branch in Subversion.

If you would like to avoid this, use a checkout and merge into that
("bzr co") or rebase on trunk rather than merging it.

For example::

 $ bzr push ../trunk
 bzr: ERROR: These branches have diverged.  Try using "merge" and then
"push".
 $ bzr rebase ../trunk
 All changes applied successfully.
 ...
 $ bzr push ../trunk
 All changes applied successfully.
 Pushed up to revision 1075.

If you would like to forbid Bazaar from ever doing these replace
operations, set the ``append_revisions_only`` setting to True for the
repository you're
pushing to.

Cheers,

Jelmer
-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080926/dbe3b9de/attachment-0001.pgp 


More information about the bazaar mailing list