Platinum Partner

Resolve All SVN Conflicts With The Right Version Of The File

This small PHP shell script recourses through the subdirectories and looks for files that match the "conflict" files that SVN creates when merging from another branch. It chooses the "right" version of the files and resolves the conflict.



$dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("."));
foreach($dir as $file)
{
  $path = $file->getPathname();
  if (preg_match('/\.merge-right\.r\d+$/', $path, $matches)) {
    $orig = str_replace($matches[0], '' , $path);
    copy($path, $orig);
    $cmd = "svn resolved $orig";
    `$cmd`;
  }
}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}