how can i move the content of a svn folder in another? -
we have svn folder stucture this:
svn-repo | +------usera | | | +----projaa | | | +----projab | ... | +------userb | | ... +----projba | +----projbb ...
with sources directly under projaa, proj ab, ...
we want make use of tags , branches in future. therefore want have structure this:
svn-repo | +------usera | | | +----projaa | | | | | +---tags | | | | | +---branches | | | | | +---trunk | | | +----projab | | | | | +---tags | | | | | +---branches | | | | | +---trunk | ... | +------userb | | ... +----projba | | | +---tags | | | +---branches | | | +---trunk | +----projbb | | | +---tags | | | +---branches | | | +---trunk ...
now question how automatically?
so far have written simple script:
@echo off & setlocal set my_bat_file=%~nx0 if [%1]==[] goto missing_param set my_svn_path=%1 set my_tmp_path=%my_svn_path%_tmp set my_svn_trunk=%my_svn_path%/trunk set my_svn_tags=%my_svn_path%/tags set my_svn_branches=%my_svn_path%/branches set my_svn_msg="created/edited by: %my_bat_file%" svn mkdir %my_tmp_path% -m %my_svn_msg% svn move %my_svn_path%/*.* %my_tmp_path% -m %my_svn_msg% svn mkdir %my_svn_path% -m %my_svn_msg% svn mkdir %my_svn_trunk% -m %my_svn_msg% svn mkdir %my_svn_tags% -m %my_svn_msg% svn mkdir %my_svn_branches% -m %my_svn_msg% svn move %my_tmp_path%/*.* %my_svn_trunk% -m %my_svn_msg% goto end :missing_param echo.failed! echo. echo.usage: echo. %my_bat_file% ^<svn_path^> echo. echo.parameter echo. svn_path: echo. path svn repository/folder (without trailing "/"). goto end :end pause
but doesnot work because of svn move %my_svn_path%/*.* %my_tmp_path% -m %my_svn_msg%
, svn move %my_tmp_path%/*.* %my_svn_trunk% -m %my_svn_msg%
.
because wildcards not supported.
if use svn move %my_svn_path% %my_tmp_path% -m %my_svn_msg%
, svn move %my_tmp_path% %my_svn_trunk% -m %my_svn_msg%
(=without wildcards) copies not content of folder, hole folder.
results in svn-rep/usera/projaa/trunk/projaa_tmp/projaa/
, not in svn-rep/usera/projaa/trunk/
.
how can move content of folder folder?
thanks in advance.
i found solution.
here new script. if interested in.
@echo on & setlocal set my_bat_file=%~nx0 if [%1]==[] goto missing_param set my_svn_path=%1 set my_tmp_path=%my_svn_path%_tmp set my_svn_trunk=%my_svn_path%/trunk set my_svn_tags=%my_svn_path%/tags set my_svn_branches=%my_svn_path%/branches set my_svn_msg="created/edited by: %my_bat_file%" :: svn mkdir %my_tmp_path% -m %my_svn_msg% :: dont create tmp-directory ! :: make copy of original folder svn copy %my_svn_path% %my_tmp_path% -m %my_svn_msg% :: delete original folder svn delete %my_svn_path% -m %my_svn_msg% :: re-create initial folder (it empty now) svn mkdir %my_svn_path% -m %my_svn_msg% :: create empty branches , tags folders svn mkdir %my_svn_tags% -m %my_svn_msg% svn mkdir %my_svn_branches% -m %my_svn_msg% :: move (same rename) temp folder trunk svn move %my_tmp_path% %my_svn_trunk% -m %my_svn_msg% goto eof :missing_param echo.failed! echo. echo.usage: echo. %my_bat_file% ^<svn_path^> echo. echo.parameter echo. svn_path: echo. path svn repository/folder (without trailing "/"). goto eof :eof pause
the folders going thru steps:
1: //svn-repo/user/proj 2: //svn-repo/user/proj //svn-repo/user/proj_tmp 3: //svn-repo/user/proj_tmp 4: //svn-repo/user/proj_tmp //svn-repo/user/proj << new created, empty! 5: //svn-repo/user/proj_tmp //svn-repo/user/proj/branches //svn-repo/user/proj/tags 6: //svn-repo/user/proj/branches //svn-repo/user/proj/tags //svn-repo/user/proj/trunk << //svn-repo/user/proj_tmp moved (=renamed)
Comments
Post a Comment