##// END OF EJS Templates
Enhance gitdiffs help text
Thomas Arendsen Hein -
r7328:3909e2c2 default
parent child Browse files
Show More
@@ -1,248 +1,254 b''
1 # help.py - help data for mercurial
1 # help.py - help data for mercurial
2 #
2 #
3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 from i18n import _
8 from i18n import _
9
9
10 helptable = (
10 helptable = (
11 (["dates"], _("Date Formats"),
11 (["dates"], _("Date Formats"),
12 _(r'''
12 _(r'''
13 Some commands allow the user to specify a date:
13 Some commands allow the user to specify a date:
14 backout, commit, import, tag: Specify the commit date.
14 backout, commit, import, tag: Specify the commit date.
15 log, revert, update: Select revision(s) by date.
15 log, revert, update: Select revision(s) by date.
16
16
17 Many date formats are valid. Here are some examples:
17 Many date formats are valid. Here are some examples:
18
18
19 "Wed Dec 6 13:18:29 2006" (local timezone assumed)
19 "Wed Dec 6 13:18:29 2006" (local timezone assumed)
20 "Dec 6 13:18 -0600" (year assumed, time offset provided)
20 "Dec 6 13:18 -0600" (year assumed, time offset provided)
21 "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
21 "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
22 "Dec 6" (midnight)
22 "Dec 6" (midnight)
23 "13:18" (today assumed)
23 "13:18" (today assumed)
24 "3:39" (3:39AM assumed)
24 "3:39" (3:39AM assumed)
25 "3:39pm" (15:39)
25 "3:39pm" (15:39)
26 "2006-12-06 13:18:29" (ISO 8601 format)
26 "2006-12-06 13:18:29" (ISO 8601 format)
27 "2006-12-6 13:18"
27 "2006-12-6 13:18"
28 "2006-12-6"
28 "2006-12-6"
29 "12-6"
29 "12-6"
30 "12/6"
30 "12/6"
31 "12/6/6" (Dec 6 2006)
31 "12/6/6" (Dec 6 2006)
32
32
33 Lastly, there is Mercurial's internal format:
33 Lastly, there is Mercurial's internal format:
34
34
35 "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC)
35 "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC)
36
36
37 This is the internal representation format for dates. unixtime is
37 This is the internal representation format for dates. unixtime is
38 the number of seconds since the epoch (1970-01-01 00:00 UTC). offset
38 the number of seconds since the epoch (1970-01-01 00:00 UTC). offset
39 is the offset of the local timezone, in seconds west of UTC (negative
39 is the offset of the local timezone, in seconds west of UTC (negative
40 if the timezone is east of UTC).
40 if the timezone is east of UTC).
41
41
42 The log command also accepts date ranges:
42 The log command also accepts date ranges:
43
43
44 "<{date}" - on or before a given date
44 "<{date}" - on or before a given date
45 ">{date}" - on or after a given date
45 ">{date}" - on or after a given date
46 "{date} to {date}" - a date range, inclusive
46 "{date} to {date}" - a date range, inclusive
47 "-{days}" - within a given number of days of today
47 "-{days}" - within a given number of days of today
48 ''')),
48 ''')),
49
49
50 (["patterns"], _("File Name Patterns"),
50 (["patterns"], _("File Name Patterns"),
51 _(r'''
51 _(r'''
52 Mercurial accepts several notations for identifying one or more
52 Mercurial accepts several notations for identifying one or more
53 files at a time.
53 files at a time.
54
54
55 By default, Mercurial treats filenames as shell-style extended
55 By default, Mercurial treats filenames as shell-style extended
56 glob patterns.
56 glob patterns.
57
57
58 Alternate pattern notations must be specified explicitly.
58 Alternate pattern notations must be specified explicitly.
59
59
60 To use a plain path name without any pattern matching, start a
60 To use a plain path name without any pattern matching, start a
61 name with "path:". These path names must match completely, from
61 name with "path:". These path names must match completely, from
62 the root of the current repository.
62 the root of the current repository.
63
63
64 To use an extended glob, start a name with "glob:". Globs are
64 To use an extended glob, start a name with "glob:". Globs are
65 rooted at the current directory; a glob such as "*.c" will match
65 rooted at the current directory; a glob such as "*.c" will match
66 files ending in ".c" in the current directory only.
66 files ending in ".c" in the current directory only.
67
67
68 The supported glob syntax extensions are "**" to match any string
68 The supported glob syntax extensions are "**" to match any string
69 across path separators, and "{a,b}" to mean "a or b".
69 across path separators, and "{a,b}" to mean "a or b".
70
70
71 To use a Perl/Python regular expression, start a name with "re:".
71 To use a Perl/Python regular expression, start a name with "re:".
72 Regexp pattern matching is anchored at the root of the repository.
72 Regexp pattern matching is anchored at the root of the repository.
73
73
74 Plain examples:
74 Plain examples:
75
75
76 path:foo/bar a name bar in a directory named foo in the root of
76 path:foo/bar a name bar in a directory named foo in the root of
77 the repository
77 the repository
78 path:path:name a file or directory named "path:name"
78 path:path:name a file or directory named "path:name"
79
79
80 Glob examples:
80 Glob examples:
81
81
82 glob:*.c any name ending in ".c" in the current directory
82 glob:*.c any name ending in ".c" in the current directory
83 *.c any name ending in ".c" in the current directory
83 *.c any name ending in ".c" in the current directory
84 **.c any name ending in ".c" in the current directory, or
84 **.c any name ending in ".c" in the current directory, or
85 any subdirectory
85 any subdirectory
86 foo/*.c any name ending in ".c" in the directory foo
86 foo/*.c any name ending in ".c" in the directory foo
87 foo/**.c any name ending in ".c" in the directory foo, or any
87 foo/**.c any name ending in ".c" in the directory foo, or any
88 subdirectory
88 subdirectory
89
89
90 Regexp examples:
90 Regexp examples:
91
91
92 re:.*\.c$ any name ending in ".c", anywhere in the repository
92 re:.*\.c$ any name ending in ".c", anywhere in the repository
93
93
94 ''')),
94 ''')),
95
95
96 (['environment', 'env'], _('Environment Variables'),
96 (['environment', 'env'], _('Environment Variables'),
97 _(r'''
97 _(r'''
98 HG::
98 HG::
99 Path to the 'hg' executable, automatically passed when running hooks,
99 Path to the 'hg' executable, automatically passed when running hooks,
100 extensions or external tools. If unset or empty, an executable named
100 extensions or external tools. If unset or empty, an executable named
101 'hg' (with com/exe/bat/cmd extension on Windows) is searched.
101 'hg' (with com/exe/bat/cmd extension on Windows) is searched.
102
102
103 HGEDITOR::
103 HGEDITOR::
104 This is the name of the editor to use when committing. See EDITOR.
104 This is the name of the editor to use when committing. See EDITOR.
105
105
106 (deprecated, use .hgrc)
106 (deprecated, use .hgrc)
107
107
108 HGENCODING::
108 HGENCODING::
109 This overrides the default locale setting detected by Mercurial.
109 This overrides the default locale setting detected by Mercurial.
110 This setting is used to convert data including usernames,
110 This setting is used to convert data including usernames,
111 changeset descriptions, tag names, and branches. This setting can
111 changeset descriptions, tag names, and branches. This setting can
112 be overridden with the --encoding command-line option.
112 be overridden with the --encoding command-line option.
113
113
114 HGENCODINGMODE::
114 HGENCODINGMODE::
115 This sets Mercurial's behavior for handling unknown characters
115 This sets Mercurial's behavior for handling unknown characters
116 while transcoding user inputs. The default is "strict", which
116 while transcoding user inputs. The default is "strict", which
117 causes Mercurial to abort if it can't translate a character. Other
117 causes Mercurial to abort if it can't translate a character. Other
118 settings include "replace", which replaces unknown characters, and
118 settings include "replace", which replaces unknown characters, and
119 "ignore", which drops them. This setting can be overridden with
119 "ignore", which drops them. This setting can be overridden with
120 the --encodingmode command-line option.
120 the --encodingmode command-line option.
121
121
122 HGMERGE::
122 HGMERGE::
123 An executable to use for resolving merge conflicts. The program
123 An executable to use for resolving merge conflicts. The program
124 will be executed with three arguments: local file, remote file,
124 will be executed with three arguments: local file, remote file,
125 ancestor file.
125 ancestor file.
126
126
127 (deprecated, use .hgrc)
127 (deprecated, use .hgrc)
128
128
129 HGRCPATH::
129 HGRCPATH::
130 A list of files or directories to search for hgrc files. Item
130 A list of files or directories to search for hgrc files. Item
131 separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set,
131 separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set,
132 platform default search path is used. If empty, only .hg/hgrc of
132 platform default search path is used. If empty, only .hg/hgrc of
133 current repository is read.
133 current repository is read.
134
134
135 For each element in path, if a directory, all entries in directory
135 For each element in path, if a directory, all entries in directory
136 ending with ".rc" are added to path. Else, element itself is
136 ending with ".rc" are added to path. Else, element itself is
137 added to path.
137 added to path.
138
138
139 HGUSER::
139 HGUSER::
140 This is the string used for the author of a commit.
140 This is the string used for the author of a commit.
141
141
142 (deprecated, use .hgrc)
142 (deprecated, use .hgrc)
143
143
144 EMAIL::
144 EMAIL::
145 If HGUSER is not set, this will be used as the author for a commit.
145 If HGUSER is not set, this will be used as the author for a commit.
146
146
147 LOGNAME::
147 LOGNAME::
148 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
148 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
149 '@hostname' appended) as the author value for a commit.
149 '@hostname' appended) as the author value for a commit.
150
150
151 VISUAL::
151 VISUAL::
152 This is the name of the editor to use when committing. See EDITOR.
152 This is the name of the editor to use when committing. See EDITOR.
153
153
154 EDITOR::
154 EDITOR::
155 Sometimes Mercurial needs to open a text file in an editor
155 Sometimes Mercurial needs to open a text file in an editor
156 for a user to modify, for example when writing commit messages.
156 for a user to modify, for example when writing commit messages.
157 The editor it uses is determined by looking at the environment
157 The editor it uses is determined by looking at the environment
158 variables HGEDITOR, VISUAL and EDITOR, in that order. The first
158 variables HGEDITOR, VISUAL and EDITOR, in that order. The first
159 non-empty one is chosen. If all of them are empty, the editor
159 non-empty one is chosen. If all of them are empty, the editor
160 defaults to 'vi'.
160 defaults to 'vi'.
161
161
162 PYTHONPATH::
162 PYTHONPATH::
163 This is used by Python to find imported modules and may need to be set
163 This is used by Python to find imported modules and may need to be set
164 appropriately if Mercurial is not installed system-wide.
164 appropriately if Mercurial is not installed system-wide.
165 ''')),
165 ''')),
166
166
167 (['revs', 'revisions'], _('Specifying Single Revisions'),
167 (['revs', 'revisions'], _('Specifying Single Revisions'),
168 _(r'''
168 _(r'''
169 Mercurial accepts several notations for identifying individual
169 Mercurial accepts several notations for identifying individual
170 revisions.
170 revisions.
171
171
172 A plain integer is treated as a revision number. Negative
172 A plain integer is treated as a revision number. Negative
173 integers are treated as offsets from the tip, with -1 denoting the
173 integers are treated as offsets from the tip, with -1 denoting the
174 tip.
174 tip.
175
175
176 A 40-digit hexadecimal string is treated as a unique revision
176 A 40-digit hexadecimal string is treated as a unique revision
177 identifier.
177 identifier.
178
178
179 A hexadecimal string less than 40 characters long is treated as a
179 A hexadecimal string less than 40 characters long is treated as a
180 unique revision identifier, and referred to as a short-form
180 unique revision identifier, and referred to as a short-form
181 identifier. A short-form identifier is only valid if it is the
181 identifier. A short-form identifier is only valid if it is the
182 prefix of one full-length identifier.
182 prefix of one full-length identifier.
183
183
184 Any other string is treated as a tag name, which is a symbolic
184 Any other string is treated as a tag name, which is a symbolic
185 name associated with a revision identifier. Tag names may not
185 name associated with a revision identifier. Tag names may not
186 contain the ":" character.
186 contain the ":" character.
187
187
188 The reserved name "tip" is a special tag that always identifies
188 The reserved name "tip" is a special tag that always identifies
189 the most recent revision.
189 the most recent revision.
190
190
191 The reserved name "null" indicates the null revision. This is the
191 The reserved name "null" indicates the null revision. This is the
192 revision of an empty repository, and the parent of revision 0.
192 revision of an empty repository, and the parent of revision 0.
193
193
194 The reserved name "." indicates the working directory parent. If
194 The reserved name "." indicates the working directory parent. If
195 no working directory is checked out, it is equivalent to null.
195 no working directory is checked out, it is equivalent to null.
196 If an uncommitted merge is in progress, "." is the revision of
196 If an uncommitted merge is in progress, "." is the revision of
197 the first parent.
197 the first parent.
198 ''')),
198 ''')),
199
199
200 (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'),
200 (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'),
201 _(r'''
201 _(r'''
202 When Mercurial accepts more than one revision, they may be
202 When Mercurial accepts more than one revision, they may be
203 specified individually, or provided as a continuous range,
203 specified individually, or provided as a continuous range,
204 separated by the ":" character.
204 separated by the ":" character.
205
205
206 The syntax of range notation is [BEGIN]:[END], where BEGIN and END
206 The syntax of range notation is [BEGIN]:[END], where BEGIN and END
207 are revision identifiers. Both BEGIN and END are optional. If
207 are revision identifiers. Both BEGIN and END are optional. If
208 BEGIN is not specified, it defaults to revision number 0. If END
208 BEGIN is not specified, it defaults to revision number 0. If END
209 is not specified, it defaults to the tip. The range ":" thus
209 is not specified, it defaults to the tip. The range ":" thus
210 means "all revisions".
210 means "all revisions".
211
211
212 If BEGIN is greater than END, revisions are treated in reverse
212 If BEGIN is greater than END, revisions are treated in reverse
213 order.
213 order.
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 - 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