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