From 4f4a29eaee8fcd84e740bcc305cc83f7cd119269 Mon Sep 17 00:00:00 2001 From: driAn Date: Thu, 11 Dec 2008 01:18:25 +0000 Subject: [PATCH] build enviroonment: branch diff & patch creation script git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3980 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/vcpp/buildEnv/get-patch.ps1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 source/vcpp/buildEnv/get-patch.ps1 diff --git a/source/vcpp/buildEnv/get-patch.ps1 b/source/vcpp/buildEnv/get-patch.ps1 new file mode 100644 index 00000000..352e3fed --- /dev/null +++ b/source/vcpp/buildEnv/get-patch.ps1 @@ -0,0 +1,23 @@ +function get-patch +{ + param($from, $to); + # get diff summary as XML + [xml] $summary = (svn diff $to $from -x --ignore-eol-style --xml --summarize); + # loop through all diff/paths/path nodes + # each node represents a modified/new file + foreach($item in $summary.diff.paths.path) + { + # the SVN url + $url=$_."#text"; + # the relative filename + $file=($_."#text".Substring($to.Length)); + # the parent directory + $dir=($file | split-path -parent); + # create parent directory if it doesn't exist already + if((test-path $dir) -eq $false) { mkdir $dir -force}; + # export current files from the SVN repository + svn export $url $file + } + # package the current dir (.) into patch.zip + sevenzip.exe a patch.zip . +} \ No newline at end of file