You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Maher <Jo...@rotair.com> on 2012/09/12 19:39:41 UTC

Problem with merging

Hello

I started using subversion a while back and doing a merge I lost a bunch
of source code which prohibited me from updating production for weeks.
I now have a stable code base and wish to use subversion so I tried to
follow chapter 4, branching and merging.  It failed.  I was hoping
someone could tell me what I am doing wrong.  I went through the process
twice and got the same result, so at least I make the same mistake
consistently.  There are a couple of weird unexplained behaviors I am
noting along with a log of what I did.

1)	I was on revision 4.  I then branced it, made a change and it
jumped to revision 7.  Why?  Does the revision apply to all folders
under a repository?
2)	I made a change to the branch, commited it to revision 6.  Then
made a change to the trunk to revision 7 (from 4).  Then I tried to
merge the change from the trunk to the branch and it required an update.
Why?
3)	Now it says text conflict.  What does that mean?

Is there another section in the book that may explain merging?  Another
read?  I would like to get subversion working without any more code
loss.
Here's what I did:

1.	Create repository on the server called "test" with trunk and
branches directories.
2.	Issue the command G:\Code\st>svn checkout
https://server.com/svn/test/trunk .
3.	Added the project using tortoise (14 files/directories).
4.	Made a change to the project.
5.	Issue the command G:\Code\st>svn commit -m "Two"
Adding         WindowsApplication1
Adding         WindowsApplication1\Form1.Designer.vb
Adding         WindowsApplication1\Form1.resx
Adding         WindowsApplication1\Form1.vb
Adding         WindowsApplication1\My Project
Adding         WindowsApplication1\My Project\Application.Designer.vb
Adding         WindowsApplication1\My Project\Application.myapp
Adding         WindowsApplication1\My Project\AssemblyInfo.vb
Adding         WindowsApplication1\My Project\Resources.Designer.vb
Adding         WindowsApplication1\My Project\Resources.resx
Adding         WindowsApplication1\My Project\Settings.Designer.vb
Adding         WindowsApplication1\My Project\Settings.settings
Adding         WindowsApplication1\WindowsApplication1.sln
Adding         WindowsApplication1\WindowsApplication1.vbproj
Transmitting file data ............
Committed revision 2.
6.	Made a change to the project.
7.	Issue the command G:\Code\st>svn commit -m "Three"
Sending        WindowsApplication1\Form1.Designer.vb
Transmitting file data .
Committed revision 3.
8.	Made a change to the project to simulate a feature.
9.	Issue the command G:\Code\st>svn commit -m "Four"
Sending        WindowsApplication1\Form1.Designer.vb
Transmitting file data .
Committed revision 4.
10.	Issue the command G:\Code\st>svn copy
https://server.com/svn/test/trunk
https://server.com/svn/test/branches/feature -m "Feature"
Committed revision 5.
11.	Changed the current directory from st (subversion test) to stb
(subversion test branch.
12.	Issue the command G:\Code\stb>svn checkout
https://server.com/svn/test/branches/feature .
A    WindowsApplication1
A    WindowsApplication1\WindowsApplication1.vbproj
A    WindowsApplication1\Form1.resx
A    WindowsApplication1\Form1.Designer.vb
A    WindowsApplication1\Form1.vb
A    WindowsApplication1\WindowsApplication1.sln
A    WindowsApplication1\My Project
A    WindowsApplication1\My Project\Resources.Designer.vb
A    WindowsApplication1\My Project\Settings.settings
A    WindowsApplication1\My Project\AssemblyInfo.vb
A    WindowsApplication1\My Project\Settings.Designer.vb
A    WindowsApplication1\My Project\Application.Designer.vb
A    WindowsApplication1\My Project\Application.myapp
A    WindowsApplication1\My Project\Resources.resx
Checked out revision 5.
13.	Made a change to the feature branch.
14.	Issue the command G:\Code\stb>svn commit -m "Six-feature"
Sending        WindowsApplication1\Form1.Designer.vb
Transmitting file data .
Committed revision 6.
15.	Changed the current directory from stb to st.
16.	Made a change to the project to simulate a bug fix.
17.	Issue the command G:\Code\st>svn commit -m "Five-bug fix"
Sending        WindowsApplication1\Form1.Designer.vb
Transmitting file data .
Committed revision 7.
*** Why 7?
18.	Changed the current directory from st to stb to try to merge the
bug fix to the feature branch.
19.	Issue the command G:\Code\stb>svn merge
https://server.com/svn/test/trunk --dry-run
svn: E195020: Cannot merge into mixed-revision working copy [5:6]; try
updating first
*** Why update?  No one else is doing anything!!
20.	Issue the command G:\Code\stb>svn update
Updating '.':
At revision 7.
*** Why go to 7?
21.	Issue the command G:\Code\stb>svn diff -r6:7
(Nothing returned using -r5:7 displays the changes I made)
22.	Issue the command G:\Code\stb>svn merge
https://server.com/svn/test/trunk --dry-run
--- Merging r5 through r7 into '.':
C    WindowsApplication1\Form1.Designer.vb
Summary of conflicts:
  Text conflicts: 1
What does that mean?


Thanks
John


RE: Problem with merging

Posted by John Maher <Jo...@rotair.com>.
Thanks Ryan, sent them a suggestion.  Don't know if they'll like it, but
we'll find out.

John

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2012c@ryandesign.com] 
Sent: Thursday, September 13, 2012 4:46 PM
To: John Maher
Cc: Stefan Sperling; users@subversion.apache.org
Subject: Re: Problem with merging


On Sep 13, 2012, at 08:23, John Maher wrote:

> How hard is it to change the book?  I know what it means now, but the
> next person may get confused.  I would bet that someone will
eventually
> get confused.  If it said "repository tree" like the FAQ I would bet
it
> helps.

Book feedback should be sent to the book's authors. Go to:

http://svnbook.org/

and scroll down to the "Feedback/Contributing" heading.





Re: Problem with merging

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 13, 2012, at 08:23, John Maher wrote:

> How hard is it to change the book?  I know what it means now, but the
> next person may get confused.  I would bet that someone will eventually
> get confused.  If it said "repository tree" like the FAQ I would bet it
> helps.

Book feedback should be sent to the book's authors. Go to:

http://svnbook.org/

and scroll down to the "Feedback/Contributing" heading.





RE: Problem with merging

Posted by John Maher <Jo...@rotair.com>.
Thank you Stefan.  Very helpful.

John

-----Original Message-----
From: Stefan Sperling [mailto:stsp@elego.de] 
Sent: Friday, September 14, 2012 10:24 AM
To: John Maher
Cc: users@subversion.apache.org
Subject: Re: Problem with merging

On Thu, Sep 13, 2012 at 09:23:54AM -0400, John Maher wrote:
> How hard is it to change the book?

Check out the book sources, make changes, and either send a
patch (i.e. the output of "svn diff" showing your changes) to
the svnbook development list, or file an issue in the book's
issue tracker and attach the patch to the issue.
You can create a patch file like this from the top of your
book sources working copy:
  svn diff > my-changes.patch
See "Feedback / Contributing" on http://svnbook.red-bean.com/
for more information.

If you want to compile your edited book sources before submitting
your changes, which is a good idea in case you're not just making
simple tweaks to the text but also add or change XML tags, see
http://svnbook.googlecode.com/svn/trunk/en/README

Re: Problem with merging

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Sep 13, 2012 at 09:23:54AM -0400, John Maher wrote:
> How hard is it to change the book?

Check out the book sources, make changes, and either send a
patch (i.e. the output of "svn diff" showing your changes) to
the svnbook development list, or file an issue in the book's
issue tracker and attach the patch to the issue.
You can create a patch file like this from the top of your
book sources working copy:
  svn diff > my-changes.patch
See "Feedback / Contributing" on http://svnbook.red-bean.com/
for more information.

If you want to compile your edited book sources before submitting
your changes, which is a good idea in case you're not just making
simple tweaks to the text but also add or change XML tags, see
http://svnbook.googlecode.com/svn/trunk/en/README

RE: Problem with merging

Posted by John Maher <Jo...@rotair.com>.
Thanks Stefan.

I did read most of the links.  I didn't know about the FAQ, thanks.
Your statement was key:

"Note that the "tree" being talked about there is not an individual
branch, but all nodes in the repository, including the /trunk directory
and the /branches/feature directory."


Basically in the book in that section tree means repository.  But you
cleared it up and the FAQ helped because the fact calls it the
repository tree.

How hard is it to change the book?  I know what it means now, but the
next person may get confused.  I would bet that someone will eventually
get confused.  If it said "repository tree" like the FAQ I would bet it
helps.

John

Re: Problem with merging

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Sep 12, 2012 at 01:39:41PM -0400, John Maher wrote:
> Here's what I did:

Hi John,

your questions are about fundamental Subversion concepts, and
that's fine. Just please understand that I don't want to type
another explanation since good documentation has already been
written. So, below, I'll throw you some links to the FAQ and
the Subversion book for further reading, hoping that these will
answer your questions.

> 1.	Create repository on the server called "test" with trunk and
> branches directories.
> 2.	Issue the command G:\Code\st>svn checkout
> https://server.com/svn/test/trunk .
> 3.	Added the project using tortoise (14 files/directories).
> 4.	Made a change to the project.
> 5.	Issue the command G:\Code\st>svn commit -m "Two"
> Adding         WindowsApplication1
> Adding         WindowsApplication1\Form1.Designer.vb
> Adding         WindowsApplication1\Form1.resx
> Adding         WindowsApplication1\Form1.vb
> Adding         WindowsApplication1\My Project
> Adding         WindowsApplication1\My Project\Application.Designer.vb
> Adding         WindowsApplication1\My Project\Application.myapp
> Adding         WindowsApplication1\My Project\AssemblyInfo.vb
> Adding         WindowsApplication1\My Project\Resources.Designer.vb
> Adding         WindowsApplication1\My Project\Resources.resx
> Adding         WindowsApplication1\My Project\Settings.Designer.vb
> Adding         WindowsApplication1\My Project\Settings.settings
> Adding         WindowsApplication1\WindowsApplication1.sln
> Adding         WindowsApplication1\WindowsApplication1.vbproj
> Transmitting file data ............
> Committed revision 2.
> 6.	Made a change to the project.
> 7.	Issue the command G:\Code\st>svn commit -m "Three"
> Sending        WindowsApplication1\Form1.Designer.vb
> Transmitting file data .
> Committed revision 3.
> 8.	Made a change to the project to simulate a feature.
> 9.	Issue the command G:\Code\st>svn commit -m "Four"
> Sending        WindowsApplication1\Form1.Designer.vb
> Transmitting file data .
> Committed revision 4.
> 10.	Issue the command G:\Code\st>svn copy
> https://server.com/svn/test/trunk
> https://server.com/svn/test/branches/feature -m "Feature"
> Committed revision 5.
> 11.	Changed the current directory from st (subversion test) to stb
> (subversion test branch.
> 12.	Issue the command G:\Code\stb>svn checkout
> https://server.com/svn/test/branches/feature .
> A    WindowsApplication1
> A    WindowsApplication1\WindowsApplication1.vbproj
> A    WindowsApplication1\Form1.resx
> A    WindowsApplication1\Form1.Designer.vb
> A    WindowsApplication1\Form1.vb
> A    WindowsApplication1\WindowsApplication1.sln
> A    WindowsApplication1\My Project
> A    WindowsApplication1\My Project\Resources.Designer.vb
> A    WindowsApplication1\My Project\Settings.settings
> A    WindowsApplication1\My Project\AssemblyInfo.vb
> A    WindowsApplication1\My Project\Settings.Designer.vb
> A    WindowsApplication1\My Project\Application.Designer.vb
> A    WindowsApplication1\My Project\Application.myapp
> A    WindowsApplication1\My Project\Resources.resx
> Checked out revision 5.
> 13.	Made a change to the feature branch.
> 14.	Issue the command G:\Code\stb>svn commit -m "Six-feature"
> Sending        WindowsApplication1\Form1.Designer.vb
> Transmitting file data .
> Committed revision 6.
> 15.	Changed the current directory from stb to st.
> 16.	Made a change to the project to simulate a bug fix.
> 17.	Issue the command G:\Code\st>svn commit -m "Five-bug fix"
> Sending        WindowsApplication1\Form1.Designer.vb
> Transmitting file data .
> Committed revision 7.
> *** Why 7?

See http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs
and http://subversion.apache.org/faq.html#globalrev

Note that the "tree" being talked about there is not an individual
branch, but all nodes in the repository, including the /trunk directory
and the /branches/feature directory.

> 18.	Changed the current directory from st to stb to try to merge the
> bug fix to the feature branch.
> 19.	Issue the command G:\Code\stb>svn merge
> https://server.com/svn/test/trunk --dry-run
> svn: E195020: Cannot merge into mixed-revision working copy [5:6]; try
> updating first
> *** Why update?  No one else is doing anything!!

Please see
http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.mixedrevs
and http://subversion.apache.org/faq.html#hidden-log

> 20.	Issue the command G:\Code\stb>svn update
> Updating '.':
> At revision 7.
> *** Why go to 7?

See above.

> 21.	Issue the command G:\Code\stb>svn diff -r6:7
> (Nothing returned using -r5:7 displays the changes I made)
> 22.	Issue the command G:\Code\stb>svn merge
> https://server.com/svn/test/trunk --dry-run
> --- Merging r5 through r7 into '.':
> C    WindowsApplication1\Form1.Designer.vb
> Summary of conflicts:
>   Text conflicts: 1
> What does that mean?

See http://svnbook.red-bean.com/en/1.7/svn.tour.cycle.html#svn.tour.cycle.resolve

Re: Problem with merging

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
John Maher wrote on Thu, Sep 13, 2012 at 10:26:39 -0400:
> Yes that is what I did.  Now that I know that causes problems with the
> subversion mailing list I won't do it again.
> 

For completeness...

http://subversion.apache.org/docs/community-guide/mailing-lists#fresh-post

Re: Problem with merging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag John Maher,
am Donnerstag, 13. September 2012 um 16:26 schrieben Sie:

> Yes that is what I did.  Now that I know that causes problems with the
> subversion mailing list I won't do it again.

It causes problems on nearly every mailing list as they each work
similar. The first mail you sent has a "References" header referring
the mail you answered to and changed the subject, new mails don't.
That's what most mail clients etc. use to identify and build threads.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon.............030-2 1001-310
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Problem with merging

Posted by Giulio Troccoli <gi...@mediatelgroup.co.uk>.
On 13/09/12 15:26, John Maher wrote:
> Yes that is what I did.  Now that I know that causes problems with the
> subversion mailing list I won't do it again.
>
> John
>

Thank you

Giulio

RE: Problem with merging

Posted by John Maher <Jo...@rotair.com>.
Yes that is what I did.  Now that I know that causes problems with the
subversion mailing list I won't do it again.

John

-----Original Message-----
From: Giulio Troccoli [mailto:giulio.troccoli@mediatelgroup.co.uk] 
Sent: Thursday, September 13, 2012 10:25 AM
To: John Maher
Cc: users@subversion.apache.org
Subject: Re: Problem with merging


On 13/09/12 15:15, John Maher wrote:
> Can you tell me what that means?  I had a question on merging so I
sent
> it to the mailing list.  Are you saying I'm not supposed to do that?
If
> not then can you explain the procedure?

You are hijacking someone else's email. Presumably you have clicked on 
Reply or ReplyAll to a previous email and changed the subject and text. 
Unfortunately this means that your email is going in the same thread as 
the one you replied to, which is not related to your problem. When 
asking a new question simply send a new email, don't reply to one.

I hope I was clearer now.

Giulio

Re: Problem with merging

Posted by Giulio Troccoli <gi...@mediatelgroup.co.uk>.
On 13/09/12 15:15, John Maher wrote:
> Can you tell me what that means?  I had a question on merging so I sent
> it to the mailing list.  Are you saying I'm not supposed to do that?  If
> not then can you explain the procedure?

You are hijacking someone else's email. Presumably you have clicked on 
Reply or ReplyAll to a previous email and changed the subject and text. 
Unfortunately this means that your email is going in the same thread as 
the one you replied to, which is not related to your problem. When 
asking a new question simply send a new email, don't reply to one.

I hope I was clearer now.

Giulio

RE: Problem with merging

Posted by John Maher <Jo...@rotair.com>.
Can you tell me what that means?  I had a question on merging so I sent
it to the mailing list.  Are you saying I'm not supposed to do that?  If
not then can you explain the procedure?

John

-----Original Message-----
From: Giulio Troccoli [mailto:giulio.troccoli@mediatelgroup.co.uk] 
Sent: Thursday, September 13, 2012 4:56 AM
To: John Maher
Cc: users@subversion.apache.org
Subject: Re: Problem with merging


On 12/09/12 18:39, John Maher wrote:
> Hello
[CUT]

Can you please stop reusing an already existing thread and instead start

a new one for a new question?
> Thanks
> John

Thanks
Giulio

Re: Problem with merging

Posted by Giulio Troccoli <gi...@mediatelgroup.co.uk>.
On 12/09/12 18:39, John Maher wrote:
> Hello
[CUT]

Can you please stop reusing an already existing thread and instead start 
a new one for a new question?
> Thanks
> John

Thanks
Giulio

Re: Problem with merging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag John Maher,
am Donnerstag, 13. September 2012 um 15:35 schrieben Sie:

> In reality we should've had code control a long time ago.  I only
> got here a few years ago.  And when I first got here I met extreme
> resistance about incorporating something like subversion.  I finally
> got the green light, quite possibly because they didn't have to
> spend any money.  Now I must learn to use it. :)

Prepare yourself for the day you loose a repository. I had a lot of
fun explaining my manager why I'm working two days on restoring things
from our corrupted NTFS file system and why it's worth the time to not
just drop version control. :-)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon.............030-2 1001-310
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


RE: Problem with merging

Posted by John Maher <Jo...@rotair.com>.
Thanks Thorsten.

While its true that I didn't technically lose code, it was probably in there somewhere.  The loss was discovered weeks later and we have a lot of code.  It would take days going over everything then we would have to *hope* we got everything.  Some things would let us know if we missed them, others things may not.  We could go days or weeks before we noticed we were losing data.  Since we were a few weeks away from the next release I decided to put off updating production.  Basically it would cost too much to possibly not get all the code sprinkled with a slim chance of data loss.  So from a business perspective, the code was lost.

In reality we should've had code control a long time ago.  I only got here a few years ago.  And when I first got here I met extreme resistance about incorporating something like subversion.  I finally got the green light, quite possibly because they didn't have to spend any money.  Now I must learn to use it. :)

Revisions are global is what I needed to know, thanks.

John

-----Original Message-----
From: Thorsten Schöning [mailto:tschoening@am-soft.de] 
Sent: Wednesday, September 12, 2012 2:39 PM
To: users@subversion.apache.org
Subject: Re: Problem with merging

Guten Tag John Maher,
am Mittwoch, 12. September 2012 um 19:39 schrieben Sie:

> I started using subversion a while back and doing a merge I lost a bunch
> of source code which prohibited me from updating production for weeks.

Unless you didn't commit, you can't loose source code, that's what
version control is all about. Even if you didn't commit Subversion
would always try everything to preserve your current modifications,
which may result in the conflicts you describe later. The easiest way
to never ever loose anything it always commit before doing any
changes to your working copy like merges and whatever goes wrong after
a commit can be restored.

> I now have a stable code base and wish to use subversion so I tried to
> follow chapter 4, branching and merging.  It failed.

If you mean your later mentioned conflicts with "failed", this isn't
exactly true, as a conflict is a normal operation and the merge may
succeed. Conflicts only mean that there are changes which Subversion
can't merge automatically safely and the user needs to do something to
merge the changes. This is not the same as an error during the merge
or else.

> 1)      I was on revision 4.  I then branced it, made a change and it
> jumped to revision 7.  Why?  Does the revision apply to all folders
> under a repository?

Yes, revisions are global, that's one of the fundamental concepts of
Subversion and is normally considered as a major benefit over previous
centralized version control like CVS.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon.............030-2 1001-310
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Problem with merging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag John Maher,
am Mittwoch, 12. September 2012 um 19:39 schrieben Sie:

> I started using subversion a while back and doing a merge I lost a bunch
> of source code which prohibited me from updating production for weeks.

Unless you didn't commit, you can't loose source code, that's what
version control is all about. Even if you didn't commit Subversion
would always try everything to preserve your current modifications,
which may result in the conflicts you describe later. The easiest way
to never ever loose anything it always commit before doing any
changes to your working copy like merges and whatever goes wrong after
a commit can be restored.

> I now have a stable code base and wish to use subversion so I tried to
> follow chapter 4, branching and merging.  It failed.

If you mean your later mentioned conflicts with "failed", this isn't
exactly true, as a conflict is a normal operation and the merge may
succeed. Conflicts only mean that there are changes which Subversion
can't merge automatically safely and the user needs to do something to
merge the changes. This is not the same as an error during the merge
or else.

> 1)      I was on revision 4.  I then branced it, made a change and it
> jumped to revision 7.  Why?  Does the revision apply to all folders
> under a repository?

Yes, revisions are global, that's one of the fundamental concepts of
Subversion and is normally considered as a major benefit over previous
centralized version control like CVS.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon.............030-2 1001-310
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow