comparison mercurial/help.py @ 7328:3909e2c2622b

Enhance gitdiffs help text
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 07 Nov 2008 13:02:03 +0100
parents 0e2e371c7406
children 7e9a15fa6c8f
comparison
equal deleted inserted replaced
7327:a1758089ee35 7328:3909e2c2622b
214 214
215 A range acts as a closed interval. This means that a range of 3:5 215 A range acts as a closed interval. This means that a range of 3:5
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'], _('Using git Diffs'), 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 231 - changes in binary files
232 In building Mercurial, we made a choice to support the git diff 232 - creation or deletion of empty files
233 format, but we haven't made it the default. This is because for a 233
234 long time, the format for unified diffs we usually use has been 234 Mercurial adopted the extended diff format which was invented for
235 defined by GNU patch, and it doesn't (yet) support git's extensions 235 the git VCS to support above features.
236 to the diff format. This means that, when extracting diffs from a 236
237 Mercurial repository (through the diff command, for example), you 237 The git extended diff format is not produced by default, because
238 must be careful about things like file copies and renames (file 238 there are only very few tools (yet) which understand the additional
239 creation and deletion are mostly handled fine by the traditional 239 information provided by them.
240 diff format, with some rare edge cases for which the git extensions 240
241 can be used). Mercurial's internal operations (like push and pull) 241 This means that, when generating diffs from a Mercurial repository
242 are not affected by these differences, because they use a different, 242 (e.g. with "hg export"), you should be careful about things like
243 binary format for communicating changes. 243 file copies and renames or other things mentioned above, because
244 244 when applying a standard diff to a different repository, this extra
245 To use git diffs, use the --git option for relevant commands, or 245 information is lost. Mercurial's internal operations (like push and
246 enable them in a hgrc, setting 'git = True' in the [diff] section. 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 )