Hello everyone. My first post here.

I'm working with an existing SVN structure...something like this

Trunk
 - Folder 1
    - A.txt
    - B.txt
    - C.txt
 - Folder 2

I want to replace the contents of Folder 1 with these files:
A.txt (a new version)
X.txt
Y.txt
Z.txt

I also want to delete B.txt and C.txt.

The actual situation is much more complex (dozens of files added/deleted) I'm not sure how to do this on my windows machine using TortoiseSVN. Must I individually add X,Y, and Z and individually delete B and C? Or is there some automatic way to simply replace a folder's contents?

    sneakyimp;11009421 wrote:

    Hello everyone. My first post here.

    Oops! NOT my first post. I copied the text from my first post on an SVN forum.

      If you're using TortoiseSVN on a Windows machine you can select in Explorer all the files you want to (say) delete, right-click, and go from there. Ditto for adding: right-drag them in and add them from the context menu you get when you release the mouse button.

      If you're talking about automating it, remember that TortoiseSVN is an SVN client - it has a command line interface.

        I am using TortoiseSVN and I'm aware that I can manually select files I want to remove and delete them using svn-delete (via command line or gui context menu) and then subsequently svn-add any new files. However, this is likely to be a substantial chore in some of the directories I'm talking about as there are many many directories and many many files. Having experimented, I see that TortoiseSVN does seem to have some sense of which files are "unversioned" (i.e., new files) and makes it convenient to svn-add them, but I'm concerned about how reliable that might be. I'm also wondering how it determines when a file has been changed -- does it check the modification date (which seems vulnerable to problems in the case of a different version of a file with identical modification date) or does it use a hash function on the file to detect changes?

        Someone else had suggested renaming the old folder to something else and simply adding the new folder. I like this idea except that it interrupts the history of the folder and it's contents and complicates the revisions graph.

        SVN is so complicated sometimes.

          We use TortoiseSVN at work. If you want to delete particular files then just delete them from the folder that's being watched by TortoiseSVN and it will automatically remove them the next time you commit.

            It doesn't seem to be all that simple to me. I keep seeing situations where a locally deleted file prevents an SVN Update because of "conflicts." I'll delete a file locally in windows explorer by just hitting the delete key and it occasionally causes issues. I can usually get them sorted but not without doing a revert or something drastic.

            And what about replacing files by saving over them (or pasting them in windows explorer) ? How does TortoiseSVN know that they have changed? MOdification date? Does it store a file hash?

            Also, the checkmark and X icons don't seem to be in sync sometimes. It's making me nervous.

              sneakyimp wrote:

              It doesn't seem to be all that simple to me. I keep seeing situations where a locally deleted file prevents an SVN Update because of "conflicts." I'll delete a file locally in windows explorer by just hitting the delete key and it occasionally causes issues. I can usually get them sorted but not without doing a revert or something drastic.

              TortoiseSVN documentation wrote:

              If an item is deleted via the explorer instead of using the TortoiseSVN context menu, the commit dialog shows those items as missing and lets you remove them from version control too before the commit. However, if you update your working copy, Subversion will spot the missing item and replace it with the latest version from the repository. If you need to delete a version-controlled file, always use TortoiseSVN → Delete so that Subversion doesn't have to guess what you really want to do.

              http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-rename.html

                Write a Reply...