Thursday 22 December 2016

Create a patch interdiff (Drupal)

Create a patch interdiff (Drupal)



Introduction



Laptop on which installation was performed: HP Elite Pro running Windows 10.



To be able to use Ubuntu, I used a virtualisation software. It is the Virtual Box which has enabled me to install Linux on Windows.

            Download Virtual box:https://www.virtualbox.org/


Ubuntu is a Linux distribution which is a free and open source software.



    Download Ubuntu 16.10:https://www.ubuntu.com/download/desktop


I will endeavour to find any issues, document them; while providing feedback on how to resolve these issues. I will classified this task into 4 steps.


Step 1:Selecting two relevant patch.



Go to Issue queue and select two relevant patches. In my case, I have chose two relevant from the link below.


     Link for two relevant patch:https://www.drupal.org/node/2834291


I have decided to do an interdiff  for patch 2834291-29.patch and 2834291-27.patch


List of patch


Step 2:Download the two relevant patch


I am going to download  the  two relevant patch that is 2834291-29.patch and 2834291-27.patch using  my terminal.


We need to know both link for the two relevant patch, in order to download them.


1.Downloading patch 2834291-29.patch


In this part, I  am going to download patch 2834291-29.patch  




CODE:




Downloading patch 2834291-29.patch


2.Downloading patch 2834291-27.patch



In this part, I  am going to download patch 2834291-27.patch.




CODE:




Downloading patch 2834291-27.patch


Step 3: Creating an interdiff


In this step, I am going to create an interdiff for my two relevant patch.


There at two ways to create an interdiff


     1.Create interdiff using git


     2.Create interdiff using patchutils



I am going to use patchutils in order to create an interdiff.


1.Installing patchutils



CODE:


            sudo apt-get install patchutils


Installing patchutils


2.Interdiff the two relevant patch



In this part, I am going to interdiff the two relevant patch.


CODE:


         interdiff 283491-27_0.patch 283491-29.patch > interdiff-29-27-45




Note:


         My new comment number is 45.


3.Then we need to cat the new interdiff patch.



CODE:


             cat inderdiff-29-27-45.txt

Interdiff and cat file



Step 4:Uploading the patch on the issue queue.


1.First of all, i have copied the output of my cat interdiff as show below and I am going to paste it in the comment box.


only in patch2:
unchanged:
--- a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php
+++ b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php
@@ -66,6 +66,9 @@ public function testPublishedEntityKey() {
     // Check that the entity key exists and it has the correct value.
     $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('comment');
     $this->assertEqual('status', $entity_type->getKey('published'));
+
+    // Check that the {comment_field_data} table status index has been created.
+    $this->assertTrue(\Drupal::database()->schema()->indexExists('comment_field_data', 'comment__status_comment_type'));
   }

}






2.Then, I am going to attach the interdiff file with it and click upload.After uploading the interdiff file, click save.


Adding comment


Adding file


Result




Outcome


I have learned how to compare 2 patches and see the differences between them.









No comments:

Post a Comment