views:

39

answers:

3

I have recent source in branch containing some features. I want to merge them to the trunk source.

1) I cannot pull the source locally. Because, I have to merge nearly for 30+ sources in different different locations.
2) I cannot delete the trunk source location and move the branch sources using the Copy To option.

So, I just want to merge sources by providing the Source and Target locations alone without pulling the source locally. Or Is there any automated way available?

I saw lot of post in SO related to this. None of them address, the context what I'm looking for.

+2  A: 

I don't think this is possible, but that's a good thing. Do you really want a mindless, automated merge of all these sources (finished with a commit)? The point of merging in a local copy is so you can sanity check it all, and resolve all the conflicts you'll get if you have changes in the same place in multiple branches....

Dave
I want it to be more like a absolute replace. But, if i delete the old source and use the `Copy To` option. Then, I'll lose old revision details. I want the revision details of the old source for tracking the revisions. I'm not familiar with svn. or Is it possible to retain the old revision details and delete the old source and move the new source?
Avatar
+1 Thanks. I end up delete merge. :)
Avatar
Hey, not sure how much help I was, but I'm glad you got it sorted in the end mate, Dave.
Dave
+2  A: 

As pointed out in this tortoise svn article

... merging always takes place within a working copy.

You might use svn merge --accept theirs-full URL1 URL2 WCPATH in order to resolve all conflicts with the version from a given URL.

Sources deleted with svn delete will still be part of the history.

zellus
+1 Thanks for the point.
Avatar
+1  A: 

No, what you're asking is not possible. Merging takes place in your working copy. There are several reasons why this it is a good idea to keep it this way:

  • Conflicts may appear and must be dealt with.
  • Users usually build and test before committing new code, and should do so after merging as well.
  • If the merge fails or if you do something stupid, you haven't messed up anything until you actually commit.

If you have to merge 30+ sources, you're best choice is to automate things using the command line client. This is how I would do it (in bash, you'll have to translate it to .bat or whatever you're comfortable with):

REPOS= \
    http://... \
    http://...

for f in REPO; do
    svn co REPO/target      
    svn merge REPO/source target
    svn commit -m "Merged target into source" target
    rm -r target
done

Tips:

  • Use svn help <command> to see how to invoke each of the svn commands.
  • Use svn merge --dry-run without svn commit first, to make sure you can do the merge without any conflicts (svn commit will fail unless you resolve the conflicts first).
JesperE
+1 Thanks yoda. --dry-run is such cool thing. You rock :)
Avatar