Diferència entre revisions de la pàgina «Patch»

Dreceres ràpides: navegació, cerca

Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

(Shifted to dev docs)
Línia 1: Línia 1:
A patch, sometimes also called a diff, is a file that shows what changes have been made to a file, or group of files. They are a common way for developers to exchange changes to software. For practical instructions see:
* [[Development:How_to_create_a_patch|How to create a patch]]
* [[Development:How_to_apply_a_patch|How to apply a patch]]
For more information about the patch format, read on. Here is a simple sample patch file:
Index: lang/en_utf8/quiz.php
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/quiz.php,v
retrieving revision
diff -u -r1.57.2.10 quiz.php
--- lang/en_utf8/quiz.php 29 May 2007 17:47:25 -0000
+++ lang/en_utf8/quiz.php 25 Jun 2007 12:58:34 -0000
@@ -252,7 +255,6 @@
$string['indivresp'] = 'Responses of Individuals to Each Item';
$string['info'] = 'Info';
$string['introduction'] = 'Introduction';
-$string['invalidcategory'] = 'Category ID is invalid';
$string['invalidnumericanswer'] = 'One of the answers you entered was not a valid number.';
$string['invalidnumerictolerance'] = 'One of the tolerances you entered was not a valid number.';
$string['invalidsource'] = 'The source is not accepted as valid.';
@@ -375,8 +377,10 @@
$string['questiontypesetupoptions'] = 'Setup options for question types:';
$string['quiz:attempt'] = 'Attempt quizzes';
$string['quiz:deleteattempts'] = 'Delete quiz attempts';
+$string['quiz:emailconfirmsubmission'] = 'Receive own quiz submission notification';
+$string['quiz:emailnotifysubmission'] = 'Receive student quiz submission notifications';
$string['quiz:grade'] = 'Grade quizzes manually';
-$string['quiz:ignoretimelimits'] = 'Ignores time limit on quizzes';
+$string['quiz:ignoretimelimits'] = 'Ignores time limit on quizs';
$string['quiz:manage'] = 'Manage quizzes';
$string['quiz:preview'] = 'Preview quizzes';
$string['quiz:view'] = 'View quiz information';
At the top it says which file is being affected. Changes to several files can be included in one patch. Lines added are shown with a '+', lines removed are shown with a '-', lines changed are shown as the old line being removed and the new one added.
Patch files are good because they only show the changed parts of the file. This has two advantages: it easy to understand the change; and if other parts of the same files change between the patch being made an being used, there is no problem, the patch will still apply.
Note that there are several slight variants of the patch format. The example above is a 'unified' patch, which is now the standard.
==See also==
* [[Development:How_to_create_a_patch|How to create a patch]]
* [[Development:How_to_apply_a_patch|How to apply a patch]]

Revisió de 07:56, 22 juny 2011

This development related page is now located in the Dev docs.

See the Patch page in the Dev docs.