How do I totally replace everything in an svn folder and keep my history?

red888
red888
Right now im doing this:   svn co https://sdfsdfsd . --force svn rm * svn add --force . svn ci -m 'lsdkjflsdjflsdjf'  So I want whats in the repo to match the current working copy. When I commit I want to delete any files in the repo that no longer exist in the copy I am commiting. I'm accomplishing this now by just blowing out the whole folder, but when doing this it always says ALL files are updated even though some are the same.  How can I mirror whats in the current working copy to the repo but also preserve history? 

Last updated

DougR
DougR
What you ask for is a job for a script. The first part would be to ask Subversion "What is currently different?" - accomplished by the "svn status" command. The output from "svn st -u" would then need to be processed. Each object shown as "removed" (e.g. the '!' character) would need to have "svn rm" executed on them. Each object added would need to have "svn add" executed on them (assuming they were not supposed to be ignored - a related, critical, topic). And so on until the final "svn ci".  In general, most folks know what they've been changing (or "svn status" will quickly remind them), so the script I'm talking about is almost never needed. Could you say more about your use case?
red888
red888
Im in a situation were I need to using svn as a sort of artifact repository - im aware this is not really appropriate but for now this needs to happen.  Yall got an easy peasy couple of bash lines for me?   Surely someone has already piped svn st -u to xargs and figured out any formatting weirdness. Love to see a working example if anyones got one!

1-3 of 3

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.