# HG changeset patch # User Matt Mackall # Date 2008-11-18 21:35:34 # Node ID 7e9a15fa6c8f4ab424acfc63e380ea4b534bc317 # Parent 86bfd65532ac4a6fa3568823218b0cede19ce03e update help on git diffs diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1607,7 +1607,7 @@ def qimport(ui, repo, *filename, **opts) An existing changeset may be placed under mq control with --rev (e.g. qimport --rev tip -n patch will place tip under mq control). With --git, patches imported with --rev will use the git diff - format. See the gitdiffs help topic for information on why this is + format. See the diffs help topic for information on why this is important for preserving rename/copy information and permission changes. """ q = repo.mq @@ -1774,9 +1774,10 @@ def new(ui, repo, patch, *args, **opts): -e, -m or -l set the patch header as well as the commit message. If none is specified, the header is empty and the commit message is '[mq]: PATCH'. - Use the --git option to keep the patch in the git extended diff format. - Read the gitdiffs help topic for more information on why this is - important for preserving permission changes and copy/rename information. + Use the --git option to keep the patch in the git extended diff + format. Read the diffs help topic for more information on why this + is important for preserving permission changes and copy/rename + information. """ msg = cmdutil.logmessage(opts) def getmsg(): return ui.edit(msg, ui.username()) @@ -1803,7 +1804,7 @@ def refresh(ui, repo, *pats, **opts): hg add/remove/copy/rename work as usual, though you might want to use git-style patches (--git or [diff] git=1) to track copies and renames. - See the gitdiffs help topic for more information on the git diff format. + See the diffs help topic for more information on the git diff format. """ q = repo.mq message = cmdutil.logmessage(opts) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1005,7 +1005,7 @@ def diff(ui, repo, *pats, **opts): probably with undesirable results. Use the --git option to generate diffs in the git extended diff - format. Read the gitdiffs help topic for more information. + format. Read the diffs help topic for more information. """ node1, node2 = cmdutil.revpair(repo, opts.get('rev')) @@ -1042,7 +1042,7 @@ def export(ui, repo, *changesets, **opts probably with undesirable results. Use the --git option to generate diffs in the git extended diff - format. Read the gitdiffs help topic for more information. + format. Read the diffs help topic for more information. With the --switch-parent option, the diff will be against the second parent. It can be useful to review a merge. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -216,34 +216,31 @@ PYTHONPATH:: gives 3, 4 and 5. Similarly, a range of 4:2 gives 4, 3, and 2. ''')), - (['gitdiffs'], _('Git Extended Diff Format'), + (['diffs'], _('Diff Formats'), _(r''' Mercurial's default format for showing changes between two versions - of a file is compatible to the unified format of GNU diff, which + of a file is compatible with the unified format of GNU diff, which can be used by GNU patch and many other standard tools. - While this de facto standardized format is often enough, there are - cases where additional change information should be included in the - generated diff file: + While this standard format is often enough, it does not encode the + following information: - executable status - copy or rename information - changes in binary files - creation or deletion of empty files - Mercurial adopted the extended diff format which was invented for - the git VCS to support above features. + Mercurial also supports the extended diff format from the git VCS + which addresses these limitations. The git diff format is not + produced by default because there are very few tools which + understand this format. - The git extended diff format is not produced by default, because - there are only very few tools (yet) which understand the additional - information provided by them. - - This means that, when generating diffs from a Mercurial repository + This means that when generating diffs from a Mercurial repository (e.g. with "hg export"), you should be careful about things like file copies and renames or other things mentioned above, because when applying a standard diff to a different repository, this extra information is lost. Mercurial's internal operations (like push and - pull) are not affected by this, because they use a different, binary + pull) are not affected by this, because they use an internal binary format for communicating changes. To make Mercurial produce the git extended diff format, use the diff --git a/tests/test-globalopts.out b/tests/test-globalopts.out --- a/tests/test-globalopts.out +++ b/tests/test-globalopts.out @@ -205,7 +205,7 @@ additional help topics: environment Environment Variables revisions Specifying Single Revisions multirevs Specifying Multiple Revisions - gitdiffs Git Extended Diff Format + diffs Diff Formats use "hg -v help" to show aliases and global options Mercurial Distributed SCM @@ -268,7 +268,7 @@ additional help topics: environment Environment Variables revisions Specifying Single Revisions multirevs Specifying Multiple Revisions - gitdiffs Git Extended Diff Format + diffs Diff Formats use "hg -v help" to show aliases and global options %% not tested: --debugger diff --git a/tests/test-help.out b/tests/test-help.out --- a/tests/test-help.out +++ b/tests/test-help.out @@ -96,7 +96,7 @@ additional help topics: environment Environment Variables revisions Specifying Single Revisions multirevs Specifying Multiple Revisions - gitdiffs Git Extended Diff Format + diffs Diff Formats use "hg -v help" to show aliases and global options add add the specified files on the next commit @@ -155,7 +155,7 @@ additional help topics: environment Environment Variables revisions Specifying Single Revisions multirevs Specifying Multiple Revisions - gitdiffs Git Extended Diff Format + diffs Diff Formats hg add [OPTION]... [FILE]... add the specified files on the next commit @@ -216,7 +216,7 @@ diff repository (or selected files) probably with undesirable results. Use the --git option to generate diffs in the git extended diff - format. Read the gitdiffs help topic for more information. + format. Read the diffs help topic for more information. options: