RE: Need to restructure repo folders: Problem: SVN COPY is recursive
Hi folks, We are changing our folder structure in the SVN repository and need to map content from old folders to the new folders. I was investigating the use of SVN COPY but the command is recursive, which leads to problems for us. For example, let's say our structure looks like: Original Folders \a \a\b \a\b\c And we are moving to a new structure where content from \a is copied to \d, \b to \e and \c also to \e: New Folders \d \d\e I can't do a SVN COPY of \b to \e because I would get: \d\e\c The only solution I can think of is to script a copy process on a file-by-file basis by first getting a list of files in folder \c, then SVN COPY each file individually into folder \e. Repeat for all folders. I can this in PERL but it seems like a long journey to get to the result. What am I missing? Is my approach flawed? That's pretty common because after all, a does contain folder b so when you copy a it is going to copy b. All you have to do is work bottom up copy \a\b\c \e copy \a\b \e Then of course you would have to remove \c from \e. Also, the svn copy command doesn't have advanced options like your shell does to copy files exclusive of folders and stuff. Hth, BOb Note that we want to keep the original structure in place as well as have the new one which is why I am playing with COPY instead of MOVE or SWITCH.
Re: Need to restructure repo folders: Problem: SVN COPY is recursive
On 03/15/2013 03:11 PM, tim.willi...@ucb.com wrote: The only solution I can think of is to script a copy process on a file-by-file basis by first getting a list of files in folder \c, then SVN COPY each file individually into folder \e. Repeat for all folders. I can this in PERL but it seems like a long journey to get to the result… I confess I got a bit lost in your description, but many times when folks have had major directory reorganization to do in Subversion, they've found the 'svnmucc' took helpful. svnmucc will be shipped as a first-class binary in Subversion 1.8, but has existed in Subversion's tools/ directory for many years. I recently(ish) documented for Version Control With Subversion the gist of the tool. See http://svnbook.red-bean.com/nightly/en/svn.advanced.working-without-a-wc.html#svn.advanced.working-without-a-wc.svnmucc for that write-up. -- C. Michael Pilato cmpil...@collab.net CollabNet www.collab.net Enterprise Cloud Development signature.asc Description: OpenPGP digital signature
RE: Need to restructure repo folders: Problem: SVN COPY is recursive
I am not very good at giving examples on a Friday afternoon, admittedly. I will try again. Original Folders \Barn\livestockNames.txt \Barn\chickens\chickenNames.txt \Barn\chickens\food\chickenFeed.txt New Structure I want: \NewBarn\livestockNames.txt \NewBarn\birds\chickenNames.txt \NewBarn\birds\chickenFeed.txt If I use SVN COPY to copy chickenNames.txt to the new folder: svn copy \Barn\chickens\ \NewBarn\birds\ I will get: \NewBarn\birds\food\chickenFeed.txt and I don’t want that folder called \food and its content. Ugh. This is another bad analogy. It is much more complicated because I have MANY files in each folder remapped to many different folders and subfolders, which is why I had hoped to use a non-recursive way to getting just the folder contents and not subfolders. I will look into svnmucc. Thanks for the tip! Tim UCB BIOSCIENCES, Inc. Mail P.O. Box 110167 - Research Triangle Park - NC 27709 - USA Via Courier 8010 Arco Corporate Drive - Suite 100 - Raleigh - NC 27617 - USA Phone +1 919 767 2555 - Fax +1 919 767 2570 (Ref: #*UBI0111) [Ref-UBI0111] Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107) [Ref-UG1107]
Re: Need to restructure repo folders: Problem: SVN COPY is recursive
On 2013-03-15 21:07, tim.willi...@ucb.com wrote: I am not very good at giving examples on a Friday afternoon, admittedly. I will try again. Original Folders \Barn\livestockNames.txt \Barn\chickens\chickenNames.txt \Barn\chickens\food\chickenFeed.txt New Structure I want: \NewBarn\livestockNames.txt \NewBarn\birds\chickenNames.txt \NewBarn\birds\chickenFeed.txt If I use SVN COPY to copy chickenNames.txt to the new folder: svn copy \Barn\chickens\ \NewBarn\birds\ I will get: \NewBarn\birds\food\chickenFeed.txt and I don’t want that folder called \food and its content. Hm, why do you copy the folder instead the single file ? svn copy \Barn\chickens\chickenFeed.txt \NewBarn\birds\ If you have a bunch of files you can do this quickly with a wrapper script
Re: Need to restructure repo folders: Problem: SVN COPY is recursive
On 03/15/2013 04:07 PM, tim.willi...@ucb.com wrote: I am not very good at giving examples on a Friday afternoon, admittedly. I will try again. Original Folders \Barn\livestockNames.txt \Barn\chickens\chickenNames.txt \Barn\chickens\food\chickenFeed.txt New Structure I want: \NewBarn\livestockNames.txt \NewBarn\birds\chickenNames.txt \NewBarn\birds\chickenFeed.txt If I use SVN COPY to copy chickenNames.txt to the new folder: svn copy \Barn\chickens\ \NewBarn\birds\ I will get: \NewBarn\birds\food\chickenFeed.txt and I don’t want that folder called \food and its content. Ugh. This is another bad analogy. It is much more complicated because I have MANY files in each folder remapped to many different folders and subfolders, which is why I had hoped to use a non-recursive way to getting just the folder contents and not subfolders. I will look into svnmucc. Thanks for the tip! Just to be clear: svnmucc will also do recursive copies. The benefit it brings is the ability to do several remote commit-ish operations in a single revision (where 'svn' can only do a single thing -- or at least a single type of thing -- at a time). -- C. Michael Pilato cmpil...@collab.net CollabNet www.collab.net Enterprise Cloud Development signature.asc Description: OpenPGP digital signature
RE: Need to restructure repo folders: Problem: SVN COPY is recursive
Yes, it appears I am headed toward a wrapper script to copy one file at a time. I wanted to make sure I was not missing something in SVN that would make it easier (a non-recursive copy, or something in svnmucc where I could copy a bunch a files and commit them all in a single new revision, for example). It appears that I am stuck creating a new revision for every single file I need to move. This will make the SVN Log history long and boring, but it appears there is not much else that can be done if my users want to retain the development history. Otherwise I would just SVN export it, remap it in a work area and commit it all in one big go. Thanks for the sanity check, folks. Tim UCB BIOSCIENCES, Inc. Mail P.O. Box 110167 - Research Triangle Park - NC 27709 - USA Via Courier 8010 Arco Corporate Drive - Suite 100 - Raleigh - NC 27617 - USA Phone +1 919 767 2555 - Fax +1 919 767 2570 (Ref: #*UBI0111) [Ref-UBI0111] Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107) [Ref-UG1107]
Re: Need to restructure repo folders: Problem: SVN COPY is recursive
On 2013-03-15 21:30, tim.willi...@ucb.com wrote: Yes, it appears I am headed toward a wrapper script to copy one file at a time. I wanted to make sure I was not missing something in SVN that would make it easier (a non-recursive copy, or something in svnmucc where I could copy a bunch a files and commit them all in a single new revision, for example). It appears that I am stuck creating a new revision for every single file I need to move. This will make the SVN Log history long and boring, but it appears there is not much else that can be done if my users want to retain the development history. Otherwise I would just SVN export it, remap it in a work area and commit it all in one big go. Thanks for the sanity check, folks. Tim Maybe something to test (but maybe totally wrong ...) svn move \Barn\chickens\food \tmp\ svn copy \Barn\chickens\ \NewBarn\birds\ svn revert \Barn\chickens\food svn commit Increasing the revision will be done only if you do a commit.
Re: Need to restructure repo folders: Problem: SVN COPY is recursive
Am 15.03.2013 21:30, schrieb tim.willi...@ucb.com: Yes, it appears I am headed toward a wrapper script to copy one file at a time. I wanted to make sure I was not missing something in SVN that would make it easier (a non-recursive copy, or something in svnmucc where I could copy a bunch a files and commit them all in a single new revision, for example). It appears that I am stuck creating a new revision for every single file I need to move. This will make the SVN Log history long and boring, but it appears there is not much else that can be done if my users want to retain the development history. Otherwise I would just SVN export it, remap it in a work area and commit it all in one big go. I dont think you have to create a new revision for each single file. Just do svn copy and then do a svn delete for all files that you dont want to have copied. e.g. svn copy /foo/bar /new svn delete /new/bar/baz svn copy /foo/qwx /new/bar svn delete /new/bar/qwx/abc ... svn commit
Re: Need to restructure repo folders: Problem: SVN COPY is recursive
Guten Tag tim.willi...@ucb.com, am Freitag, 15. März 2013 um 21:30 schrieben Sie: It appears that I am stuck creating a new revision for every single file I need to move. As already said, you aren't, just checkout a working copy, do you copies, moves and deletes and commit after you are finished. If you are using Windows you can rework your directory structure really fast with TortoiseSVN: Just right click and DragDrop will do most of the work. Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail:thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow