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