[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: SVN Merge !!

From: Erik Hemdal <erik_at_comprehensivepower.com>
Date: 2007-02-05 15:09:44 CET

 

My query is say tow users downloaded the same file.Let's say user A and
B.Now A updates the file a.sh and commits to the repository.Now when B makes
changes to a.sh and does commit he gets error about his file being
out-of-date,now if B wants his changes to be merged with that of A on the
repository how can that be done.what if i don't want to do an svn update
 
Himanshu:
 
For B to commit his changes, he must do the svn update in this situation.
This is because A and B are both working on the same branch. A's changes
have put B's working copy out of date, regardless of whether B's changes are
the latest as far as the project is concerned.
 
The update operation will mix together A's changes and B's changes, possibly
with some conflicts B can fix and possibly by silently undoing some of B's
changes. I think this is what you mean by "losing B's work". What actually
happens depends on how the files were actually changed and B needs to
examine the results carefully to make sure he gets the results he wants.
 
 because i am assuming that the copy that i have with me is the latest one
 
Yes, if B makes that assumption, this will happen. When I return to a
workinig copy that I haven't used in a while, I check the log for updates
and do an svn update if needed before I begin.
 
  and based on that assumption i have now modified the file.In this scenario
if i do svn update whole of my work is lost and i need to modify the a.sh
file again.So is there a method by which i can achieve this and if yes how
can that be done.I tried svn merge but couldn't get the right syntax.
 
I work around these issues by giving each user a development branch, then we
decide together when we should merge. When two people work on the same
branch, they have to talk together a lot to make sure that each one knows
the state of the files they are sharing.
 
This is all described in the Subversion book and in several other books
about SVN. Start with the book to understand merging, because that's how
you will (I believe) resolve your problem. You might find that it's useful
to set up a play repository and practice with some simple files until you
get the merge commands right and can teach your users. That will be time
well spent. Good luck. Erik
 
 
Received on Mon Feb 5 15:10:20 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.