Before everyone freaks - this is about scripts used while updating your own addons.
For example. I use some code which automatically places a comment with the SVN revision number, and commit comment on a specific issue number if i include the issue number in the commit message
I was kinda hoping to get the ticket commenting/closing via server-side repo hooks, but development of features isn't really going so well..
Anyhow, i use Shadoweds Locale Scrapper, which extracts all L[..] strings from your files, and uploads them automatically to your project page using the import feature.
I was kinda hoping to get the ticket commenting/closing via server-side repo hooks, but development of features isn't really going so well..
Anyhow, i use Shadoweds Locale Scrapper, which extracts all L[..] strings from your files, and uploads them automatically to your project page using the import feature.
Here is a script in a windows bat file I use to update hg, git and svn repos at once
0) checkout normally the repo with your favorite client
1) place repos_git.txt, repos_hg.txt, repos_svn.txt, update.bat in a folder
2) edit the txt files to match the local directory path of your cloned repo
3) change the integer 44 in update.bat to match the starting column number of the addon name in your directory path
4) run update.bat, output is
To note that hg.exe, git.exe and svn.exe must be found in your global env variable PATH so the simplest method is to install all the windows stuffs for this to work tortoisesvn, tortoisegit, tortoisehg, msysgit, and make sure when opening a command prompt the commands hg, git and svn returns something, if not then add the dir path in the global env variable called PATH
output of update.bat
[SIZE=1][COLOR=Gray]git update of LibAboutPanel: Already up-to-date.
git update of LibDeformat-3.0: Already up-to-date.
git update of LibDualSpec-1.0: Already up-to-date.
git update of Mapster: remote: Counting objects: 8, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From git://git.wowace.com/wow/mapster/mainline
fec02aa..2b3b890 master -> origin/master
Updating fec02aa..2b3b890
Fast-forward
Mapster.lua | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
git update of Omen: Already up-to-date.
svn update of Broker_CPU: At revision 4.
svn update of Ace2: At revision 1101.
svn update of Ace3: At revision 998.
hg update of ACP: pulling from http://hg.wowace.com/wow/acp/mainline
searching for changes
no changes found
0 files updated, 0 files merged, 0 files removed, 0 files unresolved[/COLOR][/SIZE]
update.bat
[SIZE=1]
@ECHO OFF
CLS
SETLOCAL EnableDelayedExpansion
FOR /F "eol=; delims=," %%G IN (repos_git.txt) DO (
SET _path=%%G
SET _name=!_path:~44!
SET /P var=git update of !_name!: <NUL
SET PATH = "%PATH%"
cd !_path! >NUL 2>&1
IF ERRORLEVEL 1 ( ECHO FAIL ) ELSE (
git pull
IF ERRORLEVEL 1 ( ECHO FAIL )
)
)
ENDLOCAL
SETLOCAL EnableDelayedExpansion
FOR /F "eol=; delims=," %%G IN (repos_svn.txt) DO (
SET _path=%%G
SET _name=!_path:~44!
SET /P var=svn update of !_name!: <NUL
SET PATH = "%PATH%"
cd !_path! >NUL 2>&1
IF ERRORLEVEL 1 ( ECHO FAIL ) ELSE (
svn update --ignore-externals
IF ERRORLEVEL 1 ( ECHO FAIL )
)
)
ENDLOCAL
SETLOCAL EnableDelayedExpansion
FOR /F "eol=; delims=," %%G IN (repos_hg.txt) DO (
SET _path=%%G
SET _name=!_path:~44!
SET /P var=hg update of !_name!: <NUL
SET PATH = "%PATH%"
cd !_path! >NUL 2>&1
IF ERRORLEVEL 1 ( ECHO FAIL ) ELSE (
hg pull & hg update
IF ERRORLEVEL 1 ( ECHO FAIL )
)
)
ENDLOCAL
PAUSE[/SIZE]
repos_xxx.txt, you can comment a line with ;
[SIZE=1]E:\Games\World of Warcraft\Interface\AddOns\Ace2
E:\Games\World of Warcraft\Interface\AddOns\Ace3
E:\Games\World of Warcraft\Interface\AddOns\Broker_CPU[/SIZE]
Known caveat: dont update addons with ! symbol in its name because setlocal in the batch is stripping out the ! from being used in the string, so put out !Buggrabber from this script.
Slightly changed my script for svn 1.7 that adds one more line of flood to standard output, if anyone interested, code below
update.bat
[SIZE=1]
@ECHO OFF
CLS
SETLOCAL EnableDelayedExpansion
SET PATH=D:\LIBRARIES\msysgit\msysgit\bin;D:\LIBRARIES\msysgit\msysgit\mingw\bin;%PATH%
FOR /F "eol=; delims=," %%G IN (.\repos_git.txt) DO (
SET _path=%%G
SET _name=!_path:~44!
SET /P var=git update of !_name!: <NUL
cd !_path! >NUL 2>&1
IF ERRORLEVEL 1 ( ECHO FAIL ) ELSE (
git pull
IF ERRORLEVEL 1 ( ECHO FAIL )
)
)
ENDLOCAL
SETLOCAL EnableDelayedExpansion
SET PATH=C:\Program Files\TortoiseSVN\bin;%PATH%
FOR /F "eol=; delims=," %%G IN (.\repos_svn.txt) DO (
SET _path=%%G
SET _name=!_path:~44!
SET /P var=svn update of !_name!: <NUL
cd !_path! >NUL 2>&1
IF %ERRORLEVEL% NEQ 0 ( ECHO FAIL ) ELSE (
svn update --ignore-externals | find /v "Updating"
IF %ERRORLEVEL% NEQ 0 ( ECHO FAIL )
)
)
ENDLOCAL
SETLOCAL EnableDelayedExpansion
SET PATH=C:\Program Files\TortoiseHg;%PATH%
FOR /F "eol=; delims=," %%G IN (.\repos_hg.txt) DO (
SET _path=%%G
SET _name=!_path:~44!
SET /P var=hg update of !_name!: <NUL
cd !_path! >NUL 2>&1
IF ERRORLEVEL 1 ( ECHO FAIL ) ELSE (
hg pull & hg update
IF ERRORLEVEL 1 ( ECHO FAIL )
)
)
PAUSE[/SIZE]
Not sure if it fits here. Here is a Python script that interprets a [FONT=Courier New].pkgmeta[/FONT] file and retrieves any externals defined in it. (no git yet, hg and svn only)
I have not added any argument parsing (yet), so you just put it in the same folder where a [FONT=Courier New].pkgmeta[/FONT] file is and run the script.
The reason for the script is that sub-repositories are considered a last-resort feature in Mercurial and I found no other way to retrieve libraries used in an addon - other than just getting the libraries manually. An implicit minor feature is that the used library (libyaml) will syntax-check the [FONT=Courier New].pkgmeta[/FONT] file and abort if there is an error. It will also notify you if you request a tag that does not exist and some other stuff.
The script is a bit longer, so I put it up as an attachment. Consider it licensed under GPLv3 (or newer)
For example. I use some code which automatically places a comment with the SVN revision number, and commit comment on a specific issue number if i include the issue number in the commit message
Here is an example:
http://www.wowace.com/addons/prat-3-0/tickets/451-scrolling-top-to-bottom/
As you can see there is a comment:
I'd like to know if anyone else has created automation scripts, and I'd like to compile a list, and possible create a holding project for them all.
Does this sound like a good idea?
Anyhow, i use Shadoweds Locale Scrapper, which extracts all L[..] strings from your files, and uploads them automatically to your project page using the import feature.
http://www.wowace.com/addons/localescrapper/
And of course Mikk's FindGlobals for the occasional sanity check;
http://www.wowace.com/addons/findglobals/
Thanks, these are resources I was unaware of.
0) checkout normally the repo with your favorite client
1) place repos_git.txt, repos_hg.txt, repos_svn.txt, update.bat in a folder
2) edit the txt files to match the local directory path of your cloned repo
3) change the integer 44 in update.bat to match the starting column number of the addon name in your directory path
4) run update.bat, output is
To note that hg.exe, git.exe and svn.exe must be found in your global env variable PATH so the simplest method is to install all the windows stuffs for this to work tortoisesvn, tortoisegit, tortoisehg, msysgit, and make sure when opening a command prompt the commands hg, git and svn returns something, if not then add the dir path in the global env variable called PATH
output of update.bat
update.bat
repos_xxx.txt, you can comment a line with ;
Known caveat: dont update addons with ! symbol in its name because setlocal in the batch is stripping out the ! from being used in the string, so put out !Buggrabber from this script.
update.bat
I have not added any argument parsing (yet), so you just put it in the same folder where a [FONT=Courier New].pkgmeta[/FONT] file is and run the script.
The reason for the script is that sub-repositories are considered a last-resort feature in Mercurial and I found no other way to retrieve libraries used in an addon - other than just getting the libraries manually. An implicit minor feature is that the used library (libyaml) will syntax-check the [FONT=Courier New].pkgmeta[/FONT] file and abort if there is an error. It will also notify you if you request a tag that does not exist and some other stuff.
The script is a bit longer, so I put it up as an attachment. Consider it licensed under GPLv3 (or newer)