Wednesday, April 13, 2011

How do I overwrite the contents of the repository with my working copy in TortoiseSVN?

Lets say, I know there is going to be a conflict with me committing but I don't want to deal with merging or anything.

I simply want to overwrite the repositories version with my own. What is the tortoisesvn command to do so?

From stackoverflow
  • commit and then use local version?

    1. First you have to make an update (SVN Update), so the conflict is actually happening.
    2. Then you get three files in your directory: yourfilename.mine yourfilename.rX yourfilename.rY (X and Y are the original and the new revision numbers)
    3. Rename the .mine file to the original file name.
    4. Mark the conflicted file as resolved. (TortoiseSVN -> Resolved) (The .r? files will be deleted automatically)
    5. After that you can commit the file as it were a normal change. (SVN Commit)
    Michael Brewer-Davis : You need to be careful here that the working copy version is right when you mark it "resolved"--otherwise, your repository may be full of the "===" diff markers.
    DR : Of course, you are right. Fixed my answer.
  • Another (horrible) possibility:

    • Check out the version you know you are going to conflict with into a separate directory from your own stuff
    • Copy your working files over the ones in the separate directory - take care not to copy the .svn files
    • Commit from the separate directory
  • Look at the svn resolve command from the red book. With a command line client, you would be able to run

    svn update
    svn resolve -R --accept mine-full
    

    It doesn't appear that TortoiseSVN makes this available, but if you have the command line client as backup, it may be handy. Otherwise, I'd go with a hack of the sort Neil describes (move working copy files, update, replace working copy files).

    A big caution: Using the Resolved... command instead will accept the conflict-containing version after the update; you really want the file before the update.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.