<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Operating_the_Patch_Automated_Reintegration_Tool</id>
	<title>Operating the Patch Automated Reintegration Tool - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Operating_the_Patch_Automated_Reintegration_Tool"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Operating_the_Patch_Automated_Reintegration_Tool&amp;action=history"/>
	<updated>2026-05-08T00:15:45Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Operating_the_Patch_Automated_Reintegration_Tool&amp;diff=4539&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Operating_the_Patch_Automated_Reintegration_Tool&amp;diff=4539&amp;oldid=prev"/>
		<updated>2024-10-18T06:43:13Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 06:43, 18 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Operating_the_Patch_Automated_Reintegration_Tool&amp;diff=4538&amp;oldid=prev</id>
		<title>1&gt;Tim@horizoneducationnetwork.org: clean up, typos fixed: particularily → particularly, blility → bility</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Operating_the_Patch_Automated_Reintegration_Tool&amp;diff=4538&amp;oldid=prev"/>
		<updated>2021-12-09T17:00:10Z</updated>

		<summary type="html">&lt;p&gt;clean up, typos fixed: particularily → particularly, blility → bility&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[https://docs.moodle.org/24/en/Patch_Report | back to index]]&lt;br /&gt;
&lt;br /&gt;
The Patch Reintegration Tool is located in directory &lt;br /&gt;
&lt;br /&gt;
&amp;lt;moodleroot&amp;gt;/report/patches/__command_line_tool/patch_reintegrator&lt;br /&gt;
&lt;br /&gt;
It might be a good idea to keep it in development instance on your own computer, and remove it from production servers.&lt;br /&gt;
&lt;br /&gt;
== Step 0: Preliminary Patch Markup ==&lt;br /&gt;
&lt;br /&gt;
All patchs that need to be identified should be marked from start to end.  The default markup is identical to the patterns used by the Patch Report : &lt;br /&gt;
&lt;br /&gt;
Patch start : // PATCH : Some reason&lt;br /&gt;
Patch end : // /PATCH&lt;br /&gt;
&lt;br /&gt;
Patch comments should be alone on their code line: &lt;br /&gt;
&lt;br /&gt;
avoid having this&lt;br /&gt;
&lt;br /&gt;
   foreach($loops as $loop){ // PATCH : starting change here&lt;br /&gt;
     ....&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
but integrate loop start in patch section like this: &lt;br /&gt;
&lt;br /&gt;
   // PATCH : starting change here&lt;br /&gt;
   foreach($loops as $loop){ &lt;br /&gt;
     ....&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Some config keys define the sart and end pattern of the detector: &lt;br /&gt;
&lt;br /&gt;
   //start pattern consider a full line patch mark pattern &lt;br /&gt;
   $CFG-&amp;gt;patchstartpattern = &amp;quot;\\s*\/\/\/?\\s*PATCH [^\\n]*\\n+&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
   //end pattern consider a full line patch mark pattern &lt;br /&gt;
   $CFG-&amp;gt;patchendpattern = &amp;quot;\\n*\\s*\/\/\/?\\s*\/PATCH\\s*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
You might change the patterns to cope with your marking syntax.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Setting up code bases ==&lt;br /&gt;
&lt;br /&gt;
The first step is to setup copies ready for processing in the right place. the default tool configuration uses the &amp;quot;test&amp;quot; subdirectory with three subvolumes : &lt;br /&gt;
&lt;br /&gt;
* customized : is the location where your actual moodle code should come.&lt;br /&gt;
* target : is the location where the upgraded standard download of Moodle should be dropped&lt;br /&gt;
* merged : will be the location where the mix of both will be produced. You shall let it empty.&lt;br /&gt;
&lt;br /&gt;
[[Image:directories_for_operations.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note 1:&amp;#039;&amp;#039;&amp;#039; drop the top level of Moodle in those dirs, that is, config.php will be in &amp;quot;customized&amp;quot; or &amp;quot;target&amp;quot;.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note 2:&amp;#039;&amp;#039;&amp;#039; some options of the configuration file allow to patch directly the source version (customized). This setting is rather for patching directly the moodle &amp;quot;in place&amp;quot;. It is not recommended as experience shows that the probability of having unresolved patch relocation is about 10% for a jump of several minor releases (f.e. jumping from 1.9.7 to 1.9.18, or 2.3.0 to 2.3.4).&lt;br /&gt;
&lt;br /&gt;
== Step 2: Processing ==&lt;br /&gt;
&lt;br /&gt;
Run the processor by invoking the main.php script from CLI command line: &lt;br /&gt;
&lt;br /&gt;
    &amp;gt;php main.php&lt;br /&gt;
&lt;br /&gt;
You may obtain command line syntax for options asking for help:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;php main.php -h&lt;br /&gt;
&lt;br /&gt;
[[Image:processing.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Getting result and checking unresolved patchs ==&lt;br /&gt;
&lt;br /&gt;
Once processed, a file called : &lt;br /&gt;
&lt;br /&gt;
   patch.log&lt;br /&gt;
&lt;br /&gt;
is generated in the root of the merged codebase. &lt;br /&gt;
&lt;br /&gt;
[[Image:patch_log_location_in_merged.jpg]]&lt;br /&gt;
&lt;br /&gt;
If this does not happen, check the tool&amp;#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
The patch.log file summaries all patch operations and particularly reintegration issues. &lt;br /&gt;
&lt;br /&gt;
These are known cases of reintegration failures: &lt;br /&gt;
&lt;br /&gt;
*patch neighbourhood has light or severe changes&lt;br /&gt;
*destination file does not exist any more&lt;br /&gt;
*there are two consequent patchs that are too close in code : the second one collides with the post-detecton pattern.&lt;br /&gt;
*a patch gets too close from file start an end boundaries&lt;br /&gt;
&lt;br /&gt;
Get each failure report and reintroduce the change manually, after checking it is still needed for your purpose.&lt;br /&gt;
&lt;br /&gt;
Here comes a failure sample: &lt;br /&gt;
&lt;br /&gt;
[[Image:error_in_patch_log_sample.jpg]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
And what happened there: &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Image:error_sample.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 4 : Getting missing stuff ==&lt;br /&gt;
&lt;br /&gt;
The patch reintegrator do check some known locations for non standard additions, in order to get them back in the merged&lt;br /&gt;
version. Usually all kind of plugins will be recovered. &lt;br /&gt;
&lt;br /&gt;
One special place is /lib. &lt;br /&gt;
&lt;br /&gt;
/lib is not likely to be changed or added non standard libraries. Thus if some extra developements havve asked to move some additional&lt;br /&gt;
libraries there, they will NOT be recovered and you have to copy them by your own.&lt;br /&gt;
&lt;br /&gt;
From Moodle 2.0 and upper, new contrib rules try to discourage bringing extra libraries to /lib. In place, it will be promoted to build a &amp;#039;local&amp;#039; plugin where a contributor can put his extra framework libs together.&lt;br /&gt;
&lt;br /&gt;
== Step 5 : Get merged code base to the original execution location ==&lt;br /&gt;
&lt;br /&gt;
You (of course) have made a prior backup of the source, database and moodledata file container.&lt;br /&gt;
&lt;br /&gt;
Now you can update all data and check the stability of your upgraded customization.&lt;/div&gt;</summary>
		<author><name>1&gt;Tim@horizoneducationnetwork.org</name></author>
	</entry>
</feed>