##// END OF EJS Templates
Update of doc/hg.1.txt...
Thomas Arendsen Hein -
r478:f1804f2e default
parent child Browse files
Show More
@@ -1,347 +1,356 b''
1 HG(1)
1 HG(1)
2 =====
2 =====
3 Matt Mackall <mpm@selenic.com>
3 Matt Mackall <mpm@selenic.com>
4 v0.6, 27 May 2005
4 v0.6, 24 Jun 2005
5
5
6 NAME
6 NAME
7 ----
7 ----
8 hg - Mercurial source code management system
8 hg - Mercurial source code management system
9
9
10 SYNOPSIS
10 SYNOPSIS
11 --------
11 --------
12 'hg' [-v -d -q -y] <command> [command options] [files]
12 'hg' [-v -d -q -y] <command> [command options] [files]
13
13
14 DESCRIPTION
14 DESCRIPTION
15 -----------
15 -----------
16 The hg(1) command provides a command line interface to the Mercurial system.
16 The hg(1) command provides a command line interface to the Mercurial system.
17
17
18 OPTIONS
18 OPTIONS
19 -------
19 -------
20
20
21 --debug, -d::
21 --debug, -d::
22 enable debugging output
22 enable debugging output
23
23
24 --quiet, -q::
24 --quiet, -q::
25 suppress output
25 suppress output
26
26
27 --verbose, -v::
27 --verbose, -v::
28 enable additional output
28 enable additional output
29
29
30 --noninteractive, -y::
30 --noninteractive, -y::
31 do not prompt, assume 'yes' for any required answers
31 do not prompt, assume 'yes' for any required answers
32
32
33 COMMAND ELEMENTS
33 COMMAND ELEMENTS
34 ----------------
34 ----------------
35
35
36 files ...::
36 files ...::
37 indicates one or more filename or relative path filenames
37 indicates one or more filename or relative path filenames
38
38
39 path::
39 path::
40 indicates a path on the local machine
40 indicates a path on the local machine
41
41
42 revision::
42 revision::
43 indicates a changeset which can be specified as a changeset revision
43 indicates a changeset which can be specified as a changeset revision
44 number, a tag, or a unique substring of the changeset hash value
44 number, a tag, or a unique substring of the changeset hash value
45
45
46 repository path::
46 repository path::
47 is either the pathname of a local repository of the URI of a remote
47 is either the pathname of a local repository of the URI of a remote
48 repository. There are two available URI protocols, http:// which is
48 repository. There are two available URI protocols, http:// which is
49 fast and the old-http:// protocol which is much slower but does not
49 fast and the old-http:// protocol which is much slower but does not
50 require a special server on the web host.
50 require a special server on the web host.
51
51
52 COMMANDS
52 COMMANDS
53 --------
53 --------
54
54
55 add [files ...]::
55 add [files ...]::
56 Add the given files to the repository. Note that this just schedules the
56 Add the given files to the repository. Note that this just schedules the
57 files for addition at the next hg commit time.
57 files for addition at the next hg commit time.
58
58
59 addremove::
59 addremove::
60 Add all new files and remove all missing files from the repository. New
60 Add all new files and remove all missing files from the repository. New
61 files are ignored if they match any of the patterns in .hgignore
61 files are ignored if they match any of the patterns in .hgignore
62
62
63 annotate [-r <rev> -u -n -c] [files ...]::
63 annotate [-r <rev> -u -n -c] [files ...]::
64 List the files with each line showing the revision id responsible
64 List the files with each line showing the revision id responsible
65 for that line.
65 for that line.
66
66
67 options:
67 options:
68 -r, --revision <rev> annotate the specified revision
68 -r, --revision <rev> annotate the specified revision
69 -u, --user list the author
69 -u, --user list the author
70 -c, --changeset list the changeset
70 -c, --changeset list the changeset
71 -n, --number list the revision number (default)
71 -n, --number list the revision number (default)
72
72
73 cat <file> [revision]::
73 cat <file> [revision]::
74 Output the given revision or tip of the specified file to stdout.
74 Output the given revision or tip of the specified file to stdout.
75
75
76 commit [-A -t -l <file> -t <text> -u <user> -d <datecode>] [files...]::
76 commit [-A -t -l <file> -t <text> -u <user> -d <datecode>] [files...]::
77 commit all changed files in the working dir to the repository. This uses
77 Commit all changed files in the working dir to the repository. This uses
78 the EDITOR environment variable to bring up an editor to add a commit
78 the EDITOR environment variable to bring up an editor to add a commit
79 comment.
79 comment.
80
80
81 Options:
81 Options:
82
82
83 -A, --addremove run addremove during commit
83 -A, --addremove run addremove during commit
84 -t, --text <text> use <text> as commit message
84 -t, --text <text> use <text> as commit message
85 -l, --logfile <file> read the commit message from the specified
85 -l, --logfile <file> read the commit message from the specified
86 file
86 file
87 -d, --date <datecode> use the specified date code
87 -d, --date <datecode> use the specified date code
88 -u, --user <user> record commit as the specified user
88 -u, --user <user> record commit as the specified user
89
89
90 aliases: ci
90 aliases: ci
91
91
92 copy <source> <dest>::
92 copy <source> <dest>::
93 Mark a file as copied or renamed for the next commit.
93 Mark a file as copied or renamed for the next commit.
94
94
95 diff [-r revision] [-r revision] [files ...]::
95 diff [-r revision] [-r revision] [files ...]::
96 Generate a unified diff of the indicated files. If there are no
96 Generate a unified diff of the indicated files. If there are no
97 revisions specified, the working directory file is compared to
97 revisions specified, the working directory file is compared to
98 the tip, one revision specified indicates a comparison between the
98 the tip, one revision specified indicates a comparison between the
99 working directory file and the specified revision, and two revisions
99 working directory file and the specified revision, and two revisions
100 compares the two versions specified.
100 compares the two versions specified.
101
101
102 export [revision]::
102 export [revision]::
103 Print the changeset header (author, changeset hash, parent, and commit
103 Print the changeset header (author, changeset hash, parent, and commit
104 comment) and the diffs for a particular revision.
104 comment) and the diffs for a particular revision.
105
105
106 forget [files]::
106 forget [files]::
107 Undo an 'hg add' scheduled for the next commit.
107 Undo an 'hg add' scheduled for the next commit.
108
108
109 heads::
109 heads::
110 Show all changesets with no children. These are the "heads" of
110 Show all changesets with no children. These are the "heads" of
111 development branches and are the usual targets for updates and merges.
111 development branches and are the usual targets for updates and merges.
112
112
113 history::
113 history::
114 Print the revision history of the repository. Use the -v switch
114 Print the revision history of the repository. Use the -v switch
115 for more detail.
115 for more detail.
116
116
117 identify::
117 identify::
118 Print a short identifier of the current state of the repo. This
118 Print a short identifier of the current state of the repo. This
119 includes one or two parent hash identifiers, followed by
119 includes one or two parent hash identifiers, followed by
120 a "+" if there are uncommitted changes in the working directory,
120 a "+" if there are uncommitted changes in the working directory,
121 followed by a list of tags for this revision
121 followed by a list of tags for this revision.
122
122
123 aliases: id
123 aliases: id
124
124
125 import [-p <n> -b <base> -q] <patches>::
125 import [-p <n> -b <base> -q] <patches>::
126 Import the listed patches and commit them individually.
126 Import the listed patches and commit them individually.
127
127
128 options:
128 options:
129 -p, --strip <n> directory strip option for patch
129 -p, --strip <n> directory strip option for patch
130 -b <path> base directory to read patches from
130 -b <path> base directory to read patches from
131
131
132 aliases: patch
132 aliases: patch
133
133
134 init [-u] [source]::
134 init [-u] [source]::
135 Initialize a repository in the current directory.
135 Initialize a repository in the current directory.
136
136
137 If a source is specified, pull that source into the repository.
137 If a source is specified, pull that source into the repository.
138 This source is added to .hg/hgrc as the default for future pulls
138 This source is added to .hg/hgrc as the default for future pulls
139 in this repository.
139 in this repository.
140
140
141 If the specified source is on the same filesystem, the repository
141 If the specified source is on the same filesystem, the repository
142 will be copied via hardlinks. This is the fastest and most
142 will be copied via hardlinks. This is the fastest and most
143 space-efficient mode of operation.
143 space-efficient mode of operation.
144
144
145 options:
145 options:
146 -u, --update update the working directory to match the tip
146 -u, --update update the working directory to match the tip
147
147
148 log <file>::
148 log <file>::
149 Print the revision history of the specified file.
149 Print the revision history of the specified file.
150
150
151 manifest [revision]::
151 manifest [revision]::
152 Print the indicated revision of the manifest (list of version controlled
152 Print the indicated revision of the manifest (list of version controlled
153 files)
153 files).
154
154
155 parents::
155 parents::
156 Print the working directory's parent revisions.
156 Print the working directory's parent revisions.
157
157
158 pull <repository path>::
158 pull <repository path>::
159 pull any changes from the specified repository to the repository in the
159 Pull any changes from the specified repository to the repository in the
160 current directory.
160 current directory.
161
161
162 options:
162 options:
163 -u, --update update the working directory to tip after pull
163 -u, --update update the working directory to tip after pull
164
164
165 push <destination>::
165 push <destination>::
166 Push changes from the local repository to the specified
166 Push changes from the local repository to the specified
167 destination. If the destination is local, this is identical to a
167 destination. If the destination is local, this is identical to a
168 a pull in that directory from the current directory.
168 a pull in that directory from the current directory.
169
169
170 The other currently available push method is SSH. This requires an
170 The other currently available push method is SSH. This requires an
171 accessible shell account on the destination machine and a copy of
171 accessible shell account on the destination machine and a copy of
172 hg in the remote path. Destinations are specified in the following
172 hg in the remote path. Destinations are specified in the following
173 form:
173 form:
174
174
175 ssh://[user@]host[:port]/path
175 ssh://[user@]host[:port]/path
176
176
177 rawcommit [-p -d -u -F -t -l]::
177 rawcommit [-p -d -u -F -t -l]::
178 Primarily useful for importing from other SCMs.
178 Primarily useful for importing from other SCMs.
179
179
180 recover::
180 recover::
181 Recover from an interrupted commit or pull. This should only be
181 Recover from an interrupted commit or pull. This should only be
182 necessary when Mercurial suggests it.
182 necessary when Mercurial suggests it.
183
183
184 remove [files ...]::
184 remove [files ...]::
185 schedule the indicated files for removal from the repository at the next
185 Schedule the indicated files for removal from the repository at the next
186 commit
186 commit.
187
187
188 aliases: rm
188 aliases: rm
189
189
190 root::
191 Print the root directory of the current repository.
192
190 serve [-a addr -n name -p port -t templatedir]::
193 serve [-a addr -n name -p port -t templatedir]::
191 Start a local HTTP repository browser and pull server.
194 Start a local HTTP repository browser and pull server.
192
195
193 options:
196 options:
194 -a, --address <addr> address to use
197 -a, --address <addr> address to use
195 -p, --port <n> port to use (default: 8000)
198 -p, --port <n> port to use (default: 8000)
196 -n, --name <name> name to show in web pages (default: working dir)
199 -n, --name <name> name to show in web pages (default: working dir)
197 -t, --templatedir <path> web templates to use
200 -t, --templatedir <path> web templates to use
198
201
199 status::
202 status::
200 Show changed files in the working directory.
203 Show changed files in the working directory.
201
204
202 C = changed
205 C = changed
203 A = added
206 A = added
204 R = removed
207 R = removed
205 ? = not tracked
208 ? = not tracked
206
209
207 tag [-t <text> -d <datecode> -u <user>] <name> [revision]::
210 tag [-t <text> -d <datecode> -u <user>] <name> [revision]::
208 Add a tag <name> to the specified revision or the tip.
211 Add a tag <name> to the specified revision or the tip.
209
212
210 options:
213 options:
211 -t, --text <text> message for tag commit log entry
214 -t, --text <text> message for tag commit log entry
212 -d, --date <datecode> datecode for commit
215 -d, --date <datecode> datecode for commit
213 -u, --user <user> user for commit
216 -u, --user <user> user for commit
214
217
215 tags::
218 tags::
216 List the current tags.
219 List the repository tags.
217
220
218 tip::
221 tip::
219 Show the tip revision
222 Show the tip revision.
220
223
221 undo::
224 undo::
222 Undo the last commit or pull transaction.
225 Undo the last commit or pull transaction.
223
226
224 update [-m -C] [revision]::
227 update [-m -C] [revision]::
225 Update or merge the working directory to a specified revision.
228 Update or merge the working directory to a specified revision.
226
229
227 If there are no outstanding changes in the working directory and
230 If there are no outstanding changes in the working directory and
228 there is a linear relationship between the current version and the
231 there is a linear relationship between the current version and the
229 requested version, the result is the requested version.
232 requested version, the result is the requested version.
230
233
231 Otherwise the result is a merge between the contents of the
234 Otherwise the result is a merge between the contents of the
232 current working directory and the requested version. Files that
235 current working directory and the requested version. Files that
233 changed between either parent are marked as changed for the next
236 changed between either parent are marked as changed for the next
234 commit and a commit must be performed before any further updates
237 commit and a commit must be performed before any further updates
235 are allowed. Merging will not be performed without the -m flag.
238 are allowed. Merging will not be performed without the -m flag.
236
239
237 The -C switch will tell Mercurial to forcibly update to the
240 The -C switch will tell Mercurial to forcibly update to the
238 specified version, adding, removing, and overwriting locally
241 specified version, adding, removing, and overwriting locally
239 changed fils as necessary.
242 changed fils as necessary.
240
243
241 options:
244 options:
242 -m, --merge allow merging of branches
245 -m, --merge allow merging of branches
243 -C, --clean overwrite locally modified files
246 -C, --clean overwrite locally modified files
244
247
245 aliases: up checkout co
248 aliases: up checkout co
246
249
247 verify::
250 verify::
248 Verify the integrity of the current repository.
251 Verify the integrity of the current repository.
249
252
250 This will perform an extensive check of the repository's
253 This will perform an extensive check of the repository's
251 integrity, validating the hashes and checksums of each entry in
254 integrity, validating the hashes and checksums of each entry in
252 the changelog, manifest, and tracked files, as well as the
255 the changelog, manifest, and tracked files, as well as the
253 integrity of their crosslinks and indices.
256 integrity of their crosslinks and indices.
254
257
255
258
256 ENVIRONMENT VARIABLES
259 ENVIRONMENT VARIABLES
257 ---------------------
260 ---------------------
258
261
262 HGEDITOR::
263 This is the name of the editor to use when committing. Defaults to the
264 value of EDITOR.
265
259 HGMERGE::
266 HGMERGE::
260 An executable to use for resolving merge conflicts. The program ,
267 An executable to use for resolving merge conflicts. The program ,
261 will be executed with three arguments: local file, remote file,
268 will be executed with three arguments: local file, remote file,
262 ancestor file.
269 ancestor file.
263
270
264 The default program is "hgmerge", which is a shell script provided
271 The default program is "hgmerge", which is a shell script provided
265 by Mercurial with some sensible defaults.
272 by Mercurial with some sensible defaults.
266
273
267 HGUSER::
274 HGUSER::
268 This is the string used for the author of a commit.
275 This is the string used for the author of a commit.
269
276
270 EMAIL::
277 EMAIL::
271 If HGUSER is not set, this will be used as the author for a commit.
278 If HGUSER is not set, this will be used as the author for a commit.
272
279
273 LOGNAME::
280 LOGNAME::
274 if neither HGUSER nor EMAIL is set, LOGNAME will be used (with
281 If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
275 '@hostname' appended) as the author value for a commit.
282 '@hostname' appended) as the author value for a commit.
276
283
277 EDITOR::
284 EDITOR::
278 This is the name of the editor to use when committing. Defaults to 'vi'.
285 This is the name of the editor used in the hgmerge script. It will be
286 used for commit messages, too, if HGEDITOR isn't set. Defaults to 'vi'.
279
287
280 PYTHONPATH::
288 PYTHONPATH::
281 This is used by Python to find imported modules and may need to be set
289 This is used by Python to find imported modules and may need to be set
282 appropriately if Mercurial is not installed system-wide.
290 appropriately if Mercurial is not installed system-wide.
283
291
284 FILES
292 FILES
285 -----
293 -----
286 .hgignore::
294 .hgignore::
287 This file contains regular expressions (one per line) that describe file
295 This file contains regular expressions (one per line) that describe file
288 names that should be ignored by hg
296 names that should be ignored by hg.
289
297
290 .hgtags::
298 .hgtags::
291 This file contains changeset hash values and text tag names (one of each
299 This file contains changeset hash values and text tag names (one of each
292 seperated by spaces) that correspond to tagged versions of the repository
300 seperated by spaces) that correspond to tagged versions of the repository
293 contents.
301 contents.
294
302
295 $HOME/.hgrc, .hg/hgrc::
303 $HOME/.hgrc, .hg/hgrc::
296 This file contains defaults and configuration. Values in .hg/hgrc
304 This file contains defaults and configuration. Values in .hg/hgrc
297 override those in .hgrc.
305 override those in .hgrc.
298
306
299 NAMED REPOSITORIES
307 NAMED REPOSITORIES
300 ------------------
308 ------------------
301
309
302 To give symbolic names to a repository, create a section in .hgrc
310 To give symbolic names to a repository, create a section in .hgrc
303 or .hg/hgrc containing assignments of names to paths.
311 or .hg/hgrc containing assignments of names to paths.
304
312
305 Example:
313 Example:
306
314
307 [paths]
315 [paths]
308 hg = http://selenic.com/hg
316 hg = http://selenic.com/hg
317 tah = http://hg.intevation.org/mercurial-tah/
309
318
310 NON_TRANSPARENT PROXY SUPPORT
319 NON_TRANSPARENT PROXY SUPPORT
311 -----------------------------
320 -----------------------------
312
321
313 To access a Mercurial repository through a proxy,
322 To access a Mercurial repository through a proxy,
314 create a file $HOME/.hgrc in the following format:
323 create a file $HOME/.hgrc in the following format:
315
324
316 [http_proxy]
325 [http_proxy]
317 host=myproxy:8080
326 host=myproxy:8080
318 user=<username>
327 user=<username>
319 passwd=<password>
328 passwd=<password>
320 no=<localhost1>,<localhost2>,<localhost3>,...
329 no=<localhost1>,<localhost2>,<localhost3>,...
321
330
322 "user","passwd" fields are used for authenticating proxies,
331 "user","passwd" fields are used for authenticating proxies,
323 "no" is a comma-separated list of local host names
332 "no" is a comma-separated list of local host names
324 for which proxy must be bypassed.
333 for which proxy must be bypassed.
325
334
326 BUGS
335 BUGS
327 ----
336 ----
328 Probably lots, please post them to the mailing list (See Resources below)
337 Probably lots, please post them to the mailing list (See Resources below)
329 when you find them.
338 when you find them.
330
339
331 AUTHOR
340 AUTHOR
332 ------
341 ------
333 Written by Matt Mackall <mpm@selenic.com>
342 Written by Matt Mackall <mpm@selenic.com>
334
343
335 RESOURCES
344 RESOURCES
336 ---------
345 ---------
337 http://selenic.com/mercurial[Main Web Site]
346 http://selenic.com/mercurial[Main Web Site]
338
347
339 http://selenic.com/hg[Source code repository]
348 http://selenic.com/hg[Source code repository]
340
349
341 http://selenic.com/mailman/listinfo/mercurial[Mailing list]
350 http://selenic.com/mailman/listinfo/mercurial[Mailing list]
342
351
343 COPYING
352 COPYING
344 -------
353 -------
345 Copyright (C) 2005 Matt Mackall.
354 Copyright (C) 2005 Matt Mackall.
346 Free use of this software is granted under the terms of the GNU General
355 Free use of this software is granted under the terms of the GNU General
347 Public License (GPL).
356 Public License (GPL).
General Comments 0
You need to be logged in to leave comments. Login now