Show More
@@ -216,33 +216,39 b' PYTHONPATH::' | |||||
216 | gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2. |
|
216 | gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2. | |
217 | ''')), |
|
217 | ''')), | |
218 |
|
218 | |||
219 |
(['gitdiffs'], _(' |
|
219 | (['gitdiffs'], _('Git Extended Diff Format'), | |
220 | _(r''' |
|
220 | _(r''' | |
221 | In several places, Mercurial supports two separate variations on |
|
221 | Mercurial's default format for showing changes between two versions | |
222 | the unified diff format: normal diffs, as are de facto standardized |
|
222 | of a file is compatible to the unified format of GNU diff, which | |
223 | by GNU's patch utility, and git diffs, invented for the git VCS. |
|
223 | can be used by GNU patch and many other standard tools. | |
224 |
|
224 | |||
225 | The git diff format is an addition of some information to the normal |
|
225 | While this de facto standardized format is often enough, there are | |
226 | diff format, which allows diff to convey changes in file permissions |
|
226 | cases where additional change information should be included in the | |
227 | as well as the creation, deletion, renaming and copying of files, as |
|
227 | generated diff file: | |
228 | well as diffs for binary files (unsupported by standard diff), |
|
228 | ||
229 | operations which are very useful to modern version control systems |
|
229 | - executable status | |
230 | such as Mercurial, in trying to faithfully replay your changes. |
|
230 | - copy or rename information | |
|
231 | - changes in binary files | |||
|
232 | - creation or deletion of empty files | |||
231 |
|
233 | |||
232 | In building Mercurial, we made a choice to support the git diff |
|
234 | Mercurial adopted the extended diff format which was invented for | |
233 | format, but we haven't made it the default. This is because for a |
|
235 | the git VCS to support above features. | |
234 | long time, the format for unified diffs we usually use has been |
|
236 | ||
235 | defined by GNU patch, and it doesn't (yet) support git's extensions |
|
237 | The git extended diff format is not produced by default, because | |
236 | to the diff format. This means that, when extracting diffs from a |
|
238 | there are only very few tools (yet) which understand the additional | |
237 | Mercurial repository (through the diff command, for example), you |
|
239 | information provided by them. | |
238 | must be careful about things like file copies and renames (file |
|
|||
239 | creation and deletion are mostly handled fine by the traditional |
|
|||
240 | diff format, with some rare edge cases for which the git extensions |
|
|||
241 | can be used). Mercurial's internal operations (like push and pull) |
|
|||
242 | are not affected by these differences, because they use a different, |
|
|||
243 | binary format for communicating changes. |
|
|||
244 |
|
240 | |||
245 | To use git diffs, use the --git option for relevant commands, or |
|
241 | This means that, when generating diffs from a Mercurial repository | |
246 | enable them in a hgrc, setting 'git = True' in the [diff] section. |
|
242 | (e.g. with "hg export"), you should be careful about things like | |
|
243 | file copies and renames or other things mentioned above, because | |||
|
244 | when applying a standard diff to a different repository, this extra | |||
|
245 | information is lost. Mercurial's internal operations (like push and | |||
|
246 | pull) are not affected by this, because they use a different, binary | |||
|
247 | format for communicating changes. | |||
|
248 | ||||
|
249 | To make Mercurial produce the git extended diff format, use the | |||
|
250 | --git option available for many commands, or set 'git = True' in the | |||
|
251 | [diff] section of your hgrc. You do not need to set this option when | |||
|
252 | importing diffs in this format or using them in the mq extension. | |||
247 | ''')), |
|
253 | ''')), | |
248 | ) |
|
254 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now