[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Subversion Merging with New Files

Posted on 2009-02-23
6
Medium Priority
?
2,671 Views
Last Modified: 2013-11-25
I've got a Subversion setup with trunk and branches. If I add a brand-new file to a branch and want to use svn merge to pull the files back into the trunk:

svn merge -r1234:HEAD svn://path/to/repo/branches/mybranch/newfile.jpg /working/copy/trunk/newfile.jpg

I get this:

svn: Use --force to override this restriction
svn: '/working/copy/trunk/newfile.jpg' is not under version control

Now, newfile.jpg doesn't exist locally. I just want to use svn merge to pull it from the branch into the trunk into the right spot.

I -could- use svn copy, but I really need to do files 1-by-1, and svn copy makes changes to the repository, not to the working copy, which also increments the revision number, too. My goal is to bring over a certain set of adds/updates/deletes from the branch, and then commit them to the trunk with one commit.

Where am I going wrong?
0
Comment
Question by:gr8gonzo
  • 3
  • 3
6 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 23717733
By definition, merging is combining two existing entities ... you have one entity - what would you merge it with? You cant merge a file with a trunk!!!
0
 
LVL 35

Author Comment

by:gr8gonzo
ID: 23723068
I am merging a branch with a trunk. In Subversion, branches and trunks are just directories, so you're just merging two folders / directories. Technically speaking, I COULD merge the two corresponding folders between a branch and trunk and it would pull in the new files.

However, it might pull in new files that shouldn't be pulled in yet, so I want to basically run the merge and limit it to 1 or more files that I specify. If "merge" isn't the right word, then that's fine, but if there's another, better word to use instead, all I really care about is the functionality.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 23736711
>My goal is to bring over a certain set of adds/updates/deletes from the branch, and then commit them to the trunk with one commit.
1. svn up trunk
2. use a directory merge tool to bring over the changes one by one
3. svn commit

try beyond compare for directory merge, it is a good tool
http://www.scootersoftware.com/moreinfo.php?zz=moreinfo_compare
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 35

Accepted Solution

by:
gr8gonzo earned 0 total points
ID: 23816751
Ended up using someone else's suggestion on another forum - I used svn merge to bring over all the files in a range of revisions, svn reverted the ones I did not want to bring over yet, and committed, and then marked that latest branch revision in a log so next time I merge, I can start from that revision when merging.

I appreciate the attempts, but sunnycoder, out of the 3 responses you've given me (1 in another question), the only one that was actually a helpful suggestion was the one about directory merge. When you give wisecracks as responses, you're only making Experts Exchange the place I don't want to go for answers about SVN.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 23817642
Wisecracks?

>Where am I going wrong?

I merely pointed out what you were doing wrong!! I thought you were genuinely interested in learning what was wrong with the approach and the reason for error SVN was throwing at you.

In both the questions, I genuinely tried to help you and you never reverted with a response. If you find my behavior unacceptable,  I am afraid I have nothing better to offer.
0
 
LVL 35

Author Comment

by:gr8gonzo
ID: 23817708
It just seemed like your comments were coming off as sarcastic.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was Monday morning and while heading to work those familiar feelings of frustration began to rise: How was I ever going to get my yard work done?! At the end of every weekend I discovered that I spent more time trying to decide what to work on th…
Agile and Scrum have almost become synonymous. Have you wondered what's the difference? Scrum is just one way to be Agile. It is the most popular which leads to the common confusion. Agile actually refers to a philosophy shared by group of developme…
Simple Linear Regression
Progress

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question