cidico Posted December 5, 2011 Report Share Posted December 5, 2011 Hello, Can you guys help give me a script to generate a replication package from all branches? Would be much appreciated any help on this. Link to comment Share on other sites More sharing options...
deanaug Posted December 5, 2011 Report Share Posted December 5, 2011 Hi cidico, Here's a quick batch file I put together to try this out (note I am using Plastic 3.0): @echo OFF setlocal ENABLEDELAYEDEXPANSION REM Define path for replication package files produced set pkg_path=C:\PlasticSCM\Triggers REM Get repo name, server name, server port from batch arguments set repo_name=%1 set server_name=%2 set server_port=%3 REM For each branch in specified repo, create replication package in path defined above for /f "usebackq tokens=*" %%a in (`cm find branch on repositories '%repo_name%' --nototal "--format={name}"`) do ( set branch_name=%%a set src_branch="br:!branch_name!@rep:%repo_name%@repserver:%server_name%:%server_port%" set branch_pkg=!branch_name:/=_! set pkg_name="%pkg_path%\%repo_name%!branch_pkg!.rep" echo. echo Creating replication package !pkg_name! for source branch !src_branch!: cm replicate !src_branch! --package=!pkg_name! ) It takes 3 args: repo name, server name, server port; and generates .rep files in the directory defined (change that to your favorite location). Files are named after repo and its branches; so if you repo is Code and your branches are /main and /main/fred, it will produce Code_main.rep and Code_main_fred.rep. Hope this helps! Dean Link to comment Share on other sites More sharing options...
manu Posted December 7, 2011 Report Share Posted December 7, 2011 Simple and straight to the target! We definitively need a site to publish this kind of contributions.... Thanks deanaug! Link to comment Share on other sites More sharing options...
deanaug Posted December 8, 2011 Report Share Posted December 8, 2011 Simple and straight to the target! We definitively need a site to publish this kind of contributions.... Thanks deanaug! Maybe just a separate forum on this site, similar to the way you've broken out things like branching/merging and selectors into their own forums to make them easier to find. Otherwise these tend to get "lost in the sauce" as we say here. Link to comment Share on other sites More sharing options...
epeleg Posted March 20, 2016 Report Share Posted March 20, 2016 I know this is from quite a while ago, but still... was a repository for this type of scripts ever created ? Link to comment Share on other sites More sharing options...
manu Posted March 21, 2016 Report Share Posted March 21, 2016 Well this is some kind of experimental stuff and it's not 100% public but since it can't hurt here it goes: cm replicate /main@repo@srcserver:8087 mirror@dstserver:8087 --clone Although a source branch is specified in the command syntax, it will replicate the whole repository. It's available from the release 5.4.16.704. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.