Show More
@@ -0,0 +1,69 | |||
|
1 | # This software may be used and distributed according to the terms of the | |
|
2 | # GNU General Public License version 2 or any later version. | |
|
3 | ||
|
4 | """server side extension to advertise pre-generated bundles to seed clones. | |
|
5 | ||
|
6 | The extension essentially serves the content of a .hg/clonebundles.manifest | |
|
7 | file to clients that request it. | |
|
8 | ||
|
9 | The clonebundles.manifest file contains a list of URLs and attributes. URLs | |
|
10 | hold pre-generated bundles that a client fetches and applies. After applying | |
|
11 | the pre-generated bundle, the client will connect back to the original server | |
|
12 | and pull data not in the pre-generated bundle. | |
|
13 | ||
|
14 | Manifest File Format: | |
|
15 | ||
|
16 | The manifest file contains a newline (\n) delimited list of entries. | |
|
17 | ||
|
18 | Each line in this file defines an available bundle. Lines have the format: | |
|
19 | ||
|
20 | <URL> [<key>=<value] | |
|
21 | ||
|
22 | That is, a URL followed by extra metadata describing it. Metadata keys and | |
|
23 | values should be URL encoded. | |
|
24 | ||
|
25 | This metadata is optional. It is up to server operators to populate this | |
|
26 | metadata. | |
|
27 | ||
|
28 | Keys in UPPERCASE are reserved for use by Mercurial. All non-uppercase keys | |
|
29 | can be used by site installations. | |
|
30 | ||
|
31 | The server operator is responsible for generating the bundle manifest file. | |
|
32 | ||
|
33 | Metadata Attributes: | |
|
34 | ||
|
35 | TBD | |
|
36 | """ | |
|
37 | ||
|
38 | from mercurial import ( | |
|
39 | extensions, | |
|
40 | wireproto, | |
|
41 | ) | |
|
42 | ||
|
43 | testedwith = 'internal' | |
|
44 | ||
|
45 | def capabilities(orig, repo, proto): | |
|
46 | caps = orig(repo, proto) | |
|
47 | ||
|
48 | # Only advertise if a manifest exists. This does add some I/O to requests. | |
|
49 | # But this should be cheaper than a wasted network round trip due to | |
|
50 | # missing file. | |
|
51 | if repo.opener.exists('clonebundles.manifest'): | |
|
52 | caps.append('clonebundles') | |
|
53 | ||
|
54 | return caps | |
|
55 | ||
|
56 | @wireproto.wireprotocommand('clonebundles', '') | |
|
57 | def bundles(repo, proto): | |
|
58 | """Server command for returning info for available bundles to seed clones. | |
|
59 | ||
|
60 | Clients will parse this response and determine what bundle to fetch. | |
|
61 | ||
|
62 | Other extensions may wrap this command to filter or dynamically emit | |
|
63 | data depending on the request. e.g. you could advertise URLs for | |
|
64 | the closest data center given the client's IP address. | |
|
65 | """ | |
|
66 | return repo.opener.tryread('clonebundles.manifest') | |
|
67 | ||
|
68 | def extsetup(ui): | |
|
69 | extensions.wrapfunction(wireproto, '_capabilities', capabilities) |
@@ -0,0 +1,143 | |||
|
1 | Set up a server | |
|
2 | ||
|
3 | $ hg init server | |
|
4 | $ cd server | |
|
5 | $ cat >> .hg/hgrc << EOF | |
|
6 | > [extensions] | |
|
7 | > clonebundles = | |
|
8 | > EOF | |
|
9 | ||
|
10 | $ touch foo | |
|
11 | $ hg -q commit -A -m 'add foo' | |
|
12 | $ touch bar | |
|
13 | $ hg -q commit -A -m 'add bar' | |
|
14 | ||
|
15 | $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log | |
|
16 | $ cat hg.pid >> $DAEMON_PIDS | |
|
17 | $ cd .. | |
|
18 | ||
|
19 | Feature disabled by default | |
|
20 | (client should not request manifest) | |
|
21 | ||
|
22 | $ hg clone -U http://localhost:$HGPORT feature-disabled | |
|
23 | requesting all changes | |
|
24 | adding changesets | |
|
25 | adding manifests | |
|
26 | adding file changes | |
|
27 | added 2 changesets with 2 changes to 2 files | |
|
28 | ||
|
29 | $ cat server/access.log | |
|
30 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
|
31 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
32 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob) | |
|
33 | * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob) | |
|
34 | ||
|
35 | $ cat >> $HGRCPATH << EOF | |
|
36 | > [experimental] | |
|
37 | > clonebundles = true | |
|
38 | > EOF | |
|
39 | ||
|
40 | Missing manifest should not result in server lookup | |
|
41 | ||
|
42 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest | |
|
43 | requesting all changes | |
|
44 | adding changesets | |
|
45 | adding manifests | |
|
46 | adding file changes | |
|
47 | added 2 changesets with 2 changes to 2 files | |
|
48 | ||
|
49 | $ tail -4 server/access.log | |
|
50 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
|
51 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
52 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob) | |
|
53 | * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob) | |
|
54 | ||
|
55 | Empty manifest file results in retrieval | |
|
56 | (the extension only checks if the manifest file exists) | |
|
57 | ||
|
58 | $ touch server/.hg/clonebundles.manifest | |
|
59 | $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest | |
|
60 | no clone bundles available on remote; falling back to regular clone | |
|
61 | requesting all changes | |
|
62 | adding changesets | |
|
63 | adding manifests | |
|
64 | adding file changes | |
|
65 | added 2 changesets with 2 changes to 2 files | |
|
66 | ||
|
67 | Manifest file with invalid URL aborts | |
|
68 | ||
|
69 | $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest | |
|
70 | $ hg clone http://localhost:$HGPORT 404-url | |
|
71 | applying clone bundle from http://does.not.exist/bundle.hg | |
|
72 | error fetching bundle: [Errno -2] Name or service not known | |
|
73 | abort: error applying bundle | |
|
74 | (consider contacting the server operator if this error persists) | |
|
75 | [255] | |
|
76 | ||
|
77 | Server is not running aborts | |
|
78 | ||
|
79 | $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest | |
|
80 | $ hg clone http://localhost:$HGPORT server-not-runner | |
|
81 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg | |
|
82 | error fetching bundle: [Errno 111] Connection refused | |
|
83 | abort: error applying bundle | |
|
84 | (consider contacting the server operator if this error persists) | |
|
85 | [255] | |
|
86 | ||
|
87 | Server returns 404 | |
|
88 | ||
|
89 | $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid | |
|
90 | $ cat http.pid >> $DAEMON_PIDS | |
|
91 | $ hg clone http://localhost:$HGPORT running-404 | |
|
92 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg | |
|
93 | HTTP error fetching bundle: HTTP Error 404: File not found | |
|
94 | abort: error applying bundle | |
|
95 | (consider contacting the server operator if this error persists) | |
|
96 | [255] | |
|
97 | ||
|
98 | We can override failure to fall back to regular clone | |
|
99 | ||
|
100 | $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback | |
|
101 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg | |
|
102 | HTTP error fetching bundle: HTTP Error 404: File not found | |
|
103 | falling back to normal clone | |
|
104 | requesting all changes | |
|
105 | adding changesets | |
|
106 | adding manifests | |
|
107 | adding file changes | |
|
108 | added 2 changesets with 2 changes to 2 files | |
|
109 | ||
|
110 | Bundle with partial content works | |
|
111 | ||
|
112 | $ hg -R server bundle --type gzip --base null -r 53245c60e682 partial.hg | |
|
113 | 1 changesets found | |
|
114 | ||
|
115 | $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest | |
|
116 | $ hg clone -U http://localhost:$HGPORT partial-bundle | |
|
117 | applying clone bundle from http://localhost:$HGPORT1/partial.hg | |
|
118 | adding changesets | |
|
119 | adding manifests | |
|
120 | adding file changes | |
|
121 | added 1 changesets with 1 changes to 1 files | |
|
122 | finished applying clone bundle | |
|
123 | searching for changes | |
|
124 | adding changesets | |
|
125 | adding manifests | |
|
126 | adding file changes | |
|
127 | added 1 changesets with 1 changes to 1 files | |
|
128 | ||
|
129 | Bundle with full content works | |
|
130 | ||
|
131 | $ hg -R server bundle --type gzip --base null -r tip full.hg | |
|
132 | 2 changesets found | |
|
133 | ||
|
134 | $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest | |
|
135 | $ hg clone -U http://localhost:$HGPORT full-bundle | |
|
136 | applying clone bundle from http://localhost:$HGPORT1/full.hg | |
|
137 | adding changesets | |
|
138 | adding manifests | |
|
139 | adding file changes | |
|
140 | added 2 changesets with 2 changes to 2 files | |
|
141 | finished applying clone bundle | |
|
142 | searching for changes | |
|
143 | no changes found |
@@ -1,1501 +1,1590 | |||
|
1 | 1 | # exchange.py - utility to exchange data between repos. |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from i18n import _ |
|
9 | 9 | from node import hex, nullid |
|
10 | import errno, urllib | |
|
10 | import errno, urllib, urllib2 | |
|
11 | 11 | import util, scmutil, changegroup, base85, error |
|
12 | 12 | import discovery, phases, obsolete, bookmarks as bookmod, bundle2, pushkey |
|
13 | 13 | import lock as lockmod |
|
14 | 14 | import streamclone |
|
15 | 15 | import tags |
|
16 | import url as urlmod | |
|
16 | 17 | |
|
17 | 18 | def readbundle(ui, fh, fname, vfs=None): |
|
18 | 19 | header = changegroup.readexactly(fh, 4) |
|
19 | 20 | |
|
20 | 21 | alg = None |
|
21 | 22 | if not fname: |
|
22 | 23 | fname = "stream" |
|
23 | 24 | if not header.startswith('HG') and header.startswith('\0'): |
|
24 | 25 | fh = changegroup.headerlessfixup(fh, header) |
|
25 | 26 | header = "HG10" |
|
26 | 27 | alg = 'UN' |
|
27 | 28 | elif vfs: |
|
28 | 29 | fname = vfs.join(fname) |
|
29 | 30 | |
|
30 | 31 | magic, version = header[0:2], header[2:4] |
|
31 | 32 | |
|
32 | 33 | if magic != 'HG': |
|
33 | 34 | raise error.Abort(_('%s: not a Mercurial bundle') % fname) |
|
34 | 35 | if version == '10': |
|
35 | 36 | if alg is None: |
|
36 | 37 | alg = changegroup.readexactly(fh, 2) |
|
37 | 38 | return changegroup.cg1unpacker(fh, alg) |
|
38 | 39 | elif version.startswith('2'): |
|
39 | 40 | return bundle2.getunbundler(ui, fh, magicstring=magic + version) |
|
40 | 41 | else: |
|
41 | 42 | raise error.Abort(_('%s: unknown bundle version %s') % (fname, version)) |
|
42 | 43 | |
|
43 | 44 | def buildobsmarkerspart(bundler, markers): |
|
44 | 45 | """add an obsmarker part to the bundler with <markers> |
|
45 | 46 | |
|
46 | 47 | No part is created if markers is empty. |
|
47 | 48 | Raises ValueError if the bundler doesn't support any known obsmarker format. |
|
48 | 49 | """ |
|
49 | 50 | if markers: |
|
50 | 51 | remoteversions = bundle2.obsmarkersversion(bundler.capabilities) |
|
51 | 52 | version = obsolete.commonversion(remoteversions) |
|
52 | 53 | if version is None: |
|
53 | 54 | raise ValueError('bundler do not support common obsmarker format') |
|
54 | 55 | stream = obsolete.encodemarkers(markers, True, version=version) |
|
55 | 56 | return bundler.newpart('obsmarkers', data=stream) |
|
56 | 57 | return None |
|
57 | 58 | |
|
58 | 59 | def _canusebundle2(op): |
|
59 | 60 | """return true if a pull/push can use bundle2 |
|
60 | 61 | |
|
61 | 62 | Feel free to nuke this function when we drop the experimental option""" |
|
62 | 63 | return (op.repo.ui.configbool('experimental', 'bundle2-exp', True) |
|
63 | 64 | and op.remote.capable('bundle2')) |
|
64 | 65 | |
|
65 | 66 | |
|
66 | 67 | class pushoperation(object): |
|
67 | 68 | """A object that represent a single push operation |
|
68 | 69 | |
|
69 | 70 | It purpose is to carry push related state and very common operation. |
|
70 | 71 | |
|
71 | 72 | A new should be created at the beginning of each push and discarded |
|
72 | 73 | afterward. |
|
73 | 74 | """ |
|
74 | 75 | |
|
75 | 76 | def __init__(self, repo, remote, force=False, revs=None, newbranch=False, |
|
76 | 77 | bookmarks=()): |
|
77 | 78 | # repo we push from |
|
78 | 79 | self.repo = repo |
|
79 | 80 | self.ui = repo.ui |
|
80 | 81 | # repo we push to |
|
81 | 82 | self.remote = remote |
|
82 | 83 | # force option provided |
|
83 | 84 | self.force = force |
|
84 | 85 | # revs to be pushed (None is "all") |
|
85 | 86 | self.revs = revs |
|
86 | 87 | # bookmark explicitly pushed |
|
87 | 88 | self.bookmarks = bookmarks |
|
88 | 89 | # allow push of new branch |
|
89 | 90 | self.newbranch = newbranch |
|
90 | 91 | # did a local lock get acquired? |
|
91 | 92 | self.locallocked = None |
|
92 | 93 | # step already performed |
|
93 | 94 | # (used to check what steps have been already performed through bundle2) |
|
94 | 95 | self.stepsdone = set() |
|
95 | 96 | # Integer version of the changegroup push result |
|
96 | 97 | # - None means nothing to push |
|
97 | 98 | # - 0 means HTTP error |
|
98 | 99 | # - 1 means we pushed and remote head count is unchanged *or* |
|
99 | 100 | # we have outgoing changesets but refused to push |
|
100 | 101 | # - other values as described by addchangegroup() |
|
101 | 102 | self.cgresult = None |
|
102 | 103 | # Boolean value for the bookmark push |
|
103 | 104 | self.bkresult = None |
|
104 | 105 | # discover.outgoing object (contains common and outgoing data) |
|
105 | 106 | self.outgoing = None |
|
106 | 107 | # all remote heads before the push |
|
107 | 108 | self.remoteheads = None |
|
108 | 109 | # testable as a boolean indicating if any nodes are missing locally. |
|
109 | 110 | self.incoming = None |
|
110 | 111 | # phases changes that must be pushed along side the changesets |
|
111 | 112 | self.outdatedphases = None |
|
112 | 113 | # phases changes that must be pushed if changeset push fails |
|
113 | 114 | self.fallbackoutdatedphases = None |
|
114 | 115 | # outgoing obsmarkers |
|
115 | 116 | self.outobsmarkers = set() |
|
116 | 117 | # outgoing bookmarks |
|
117 | 118 | self.outbookmarks = [] |
|
118 | 119 | # transaction manager |
|
119 | 120 | self.trmanager = None |
|
120 | 121 | # map { pushkey partid -> callback handling failure} |
|
121 | 122 | # used to handle exception from mandatory pushkey part failure |
|
122 | 123 | self.pkfailcb = {} |
|
123 | 124 | |
|
124 | 125 | @util.propertycache |
|
125 | 126 | def futureheads(self): |
|
126 | 127 | """future remote heads if the changeset push succeeds""" |
|
127 | 128 | return self.outgoing.missingheads |
|
128 | 129 | |
|
129 | 130 | @util.propertycache |
|
130 | 131 | def fallbackheads(self): |
|
131 | 132 | """future remote heads if the changeset push fails""" |
|
132 | 133 | if self.revs is None: |
|
133 | 134 | # not target to push, all common are relevant |
|
134 | 135 | return self.outgoing.commonheads |
|
135 | 136 | unfi = self.repo.unfiltered() |
|
136 | 137 | # I want cheads = heads(::missingheads and ::commonheads) |
|
137 | 138 | # (missingheads is revs with secret changeset filtered out) |
|
138 | 139 | # |
|
139 | 140 | # This can be expressed as: |
|
140 | 141 | # cheads = ( (missingheads and ::commonheads) |
|
141 | 142 | # + (commonheads and ::missingheads))" |
|
142 | 143 | # ) |
|
143 | 144 | # |
|
144 | 145 | # while trying to push we already computed the following: |
|
145 | 146 | # common = (::commonheads) |
|
146 | 147 | # missing = ((commonheads::missingheads) - commonheads) |
|
147 | 148 | # |
|
148 | 149 | # We can pick: |
|
149 | 150 | # * missingheads part of common (::commonheads) |
|
150 | 151 | common = self.outgoing.common |
|
151 | 152 | nm = self.repo.changelog.nodemap |
|
152 | 153 | cheads = [node for node in self.revs if nm[node] in common] |
|
153 | 154 | # and |
|
154 | 155 | # * commonheads parents on missing |
|
155 | 156 | revset = unfi.set('%ln and parents(roots(%ln))', |
|
156 | 157 | self.outgoing.commonheads, |
|
157 | 158 | self.outgoing.missing) |
|
158 | 159 | cheads.extend(c.node() for c in revset) |
|
159 | 160 | return cheads |
|
160 | 161 | |
|
161 | 162 | @property |
|
162 | 163 | def commonheads(self): |
|
163 | 164 | """set of all common heads after changeset bundle push""" |
|
164 | 165 | if self.cgresult: |
|
165 | 166 | return self.futureheads |
|
166 | 167 | else: |
|
167 | 168 | return self.fallbackheads |
|
168 | 169 | |
|
169 | 170 | # mapping of message used when pushing bookmark |
|
170 | 171 | bookmsgmap = {'update': (_("updating bookmark %s\n"), |
|
171 | 172 | _('updating bookmark %s failed!\n')), |
|
172 | 173 | 'export': (_("exporting bookmark %s\n"), |
|
173 | 174 | _('exporting bookmark %s failed!\n')), |
|
174 | 175 | 'delete': (_("deleting remote bookmark %s\n"), |
|
175 | 176 | _('deleting remote bookmark %s failed!\n')), |
|
176 | 177 | } |
|
177 | 178 | |
|
178 | 179 | |
|
179 | 180 | def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=()): |
|
180 | 181 | '''Push outgoing changesets (limited by revs) from a local |
|
181 | 182 | repository to remote. Return an integer: |
|
182 | 183 | - None means nothing to push |
|
183 | 184 | - 0 means HTTP error |
|
184 | 185 | - 1 means we pushed and remote head count is unchanged *or* |
|
185 | 186 | we have outgoing changesets but refused to push |
|
186 | 187 | - other values as described by addchangegroup() |
|
187 | 188 | ''' |
|
188 | 189 | pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks) |
|
189 | 190 | if pushop.remote.local(): |
|
190 | 191 | missing = (set(pushop.repo.requirements) |
|
191 | 192 | - pushop.remote.local().supported) |
|
192 | 193 | if missing: |
|
193 | 194 | msg = _("required features are not" |
|
194 | 195 | " supported in the destination:" |
|
195 | 196 | " %s") % (', '.join(sorted(missing))) |
|
196 | 197 | raise error.Abort(msg) |
|
197 | 198 | |
|
198 | 199 | # there are two ways to push to remote repo: |
|
199 | 200 | # |
|
200 | 201 | # addchangegroup assumes local user can lock remote |
|
201 | 202 | # repo (local filesystem, old ssh servers). |
|
202 | 203 | # |
|
203 | 204 | # unbundle assumes local user cannot lock remote repo (new ssh |
|
204 | 205 | # servers, http servers). |
|
205 | 206 | |
|
206 | 207 | if not pushop.remote.canpush(): |
|
207 | 208 | raise error.Abort(_("destination does not support push")) |
|
208 | 209 | # get local lock as we might write phase data |
|
209 | 210 | localwlock = locallock = None |
|
210 | 211 | try: |
|
211 | 212 | # bundle2 push may receive a reply bundle touching bookmarks or other |
|
212 | 213 | # things requiring the wlock. Take it now to ensure proper ordering. |
|
213 | 214 | maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback') |
|
214 | 215 | if _canusebundle2(pushop) and maypushback: |
|
215 | 216 | localwlock = pushop.repo.wlock() |
|
216 | 217 | locallock = pushop.repo.lock() |
|
217 | 218 | pushop.locallocked = True |
|
218 | 219 | except IOError as err: |
|
219 | 220 | pushop.locallocked = False |
|
220 | 221 | if err.errno != errno.EACCES: |
|
221 | 222 | raise |
|
222 | 223 | # source repo cannot be locked. |
|
223 | 224 | # We do not abort the push, but just disable the local phase |
|
224 | 225 | # synchronisation. |
|
225 | 226 | msg = 'cannot lock source repository: %s\n' % err |
|
226 | 227 | pushop.ui.debug(msg) |
|
227 | 228 | try: |
|
228 | 229 | if pushop.locallocked: |
|
229 | 230 | pushop.trmanager = transactionmanager(repo, |
|
230 | 231 | 'push-response', |
|
231 | 232 | pushop.remote.url()) |
|
232 | 233 | pushop.repo.checkpush(pushop) |
|
233 | 234 | lock = None |
|
234 | 235 | unbundle = pushop.remote.capable('unbundle') |
|
235 | 236 | if not unbundle: |
|
236 | 237 | lock = pushop.remote.lock() |
|
237 | 238 | try: |
|
238 | 239 | _pushdiscovery(pushop) |
|
239 | 240 | if _canusebundle2(pushop): |
|
240 | 241 | _pushbundle2(pushop) |
|
241 | 242 | _pushchangeset(pushop) |
|
242 | 243 | _pushsyncphase(pushop) |
|
243 | 244 | _pushobsolete(pushop) |
|
244 | 245 | _pushbookmark(pushop) |
|
245 | 246 | finally: |
|
246 | 247 | if lock is not None: |
|
247 | 248 | lock.release() |
|
248 | 249 | if pushop.trmanager: |
|
249 | 250 | pushop.trmanager.close() |
|
250 | 251 | finally: |
|
251 | 252 | if pushop.trmanager: |
|
252 | 253 | pushop.trmanager.release() |
|
253 | 254 | if locallock is not None: |
|
254 | 255 | locallock.release() |
|
255 | 256 | if localwlock is not None: |
|
256 | 257 | localwlock.release() |
|
257 | 258 | |
|
258 | 259 | return pushop |
|
259 | 260 | |
|
260 | 261 | # list of steps to perform discovery before push |
|
261 | 262 | pushdiscoveryorder = [] |
|
262 | 263 | |
|
263 | 264 | # Mapping between step name and function |
|
264 | 265 | # |
|
265 | 266 | # This exists to help extensions wrap steps if necessary |
|
266 | 267 | pushdiscoverymapping = {} |
|
267 | 268 | |
|
268 | 269 | def pushdiscovery(stepname): |
|
269 | 270 | """decorator for function performing discovery before push |
|
270 | 271 | |
|
271 | 272 | The function is added to the step -> function mapping and appended to the |
|
272 | 273 | list of steps. Beware that decorated function will be added in order (this |
|
273 | 274 | may matter). |
|
274 | 275 | |
|
275 | 276 | You can only use this decorator for a new step, if you want to wrap a step |
|
276 | 277 | from an extension, change the pushdiscovery dictionary directly.""" |
|
277 | 278 | def dec(func): |
|
278 | 279 | assert stepname not in pushdiscoverymapping |
|
279 | 280 | pushdiscoverymapping[stepname] = func |
|
280 | 281 | pushdiscoveryorder.append(stepname) |
|
281 | 282 | return func |
|
282 | 283 | return dec |
|
283 | 284 | |
|
284 | 285 | def _pushdiscovery(pushop): |
|
285 | 286 | """Run all discovery steps""" |
|
286 | 287 | for stepname in pushdiscoveryorder: |
|
287 | 288 | step = pushdiscoverymapping[stepname] |
|
288 | 289 | step(pushop) |
|
289 | 290 | |
|
290 | 291 | @pushdiscovery('changeset') |
|
291 | 292 | def _pushdiscoverychangeset(pushop): |
|
292 | 293 | """discover the changeset that need to be pushed""" |
|
293 | 294 | fci = discovery.findcommonincoming |
|
294 | 295 | commoninc = fci(pushop.repo, pushop.remote, force=pushop.force) |
|
295 | 296 | common, inc, remoteheads = commoninc |
|
296 | 297 | fco = discovery.findcommonoutgoing |
|
297 | 298 | outgoing = fco(pushop.repo, pushop.remote, onlyheads=pushop.revs, |
|
298 | 299 | commoninc=commoninc, force=pushop.force) |
|
299 | 300 | pushop.outgoing = outgoing |
|
300 | 301 | pushop.remoteheads = remoteheads |
|
301 | 302 | pushop.incoming = inc |
|
302 | 303 | |
|
303 | 304 | @pushdiscovery('phase') |
|
304 | 305 | def _pushdiscoveryphase(pushop): |
|
305 | 306 | """discover the phase that needs to be pushed |
|
306 | 307 | |
|
307 | 308 | (computed for both success and failure case for changesets push)""" |
|
308 | 309 | outgoing = pushop.outgoing |
|
309 | 310 | unfi = pushop.repo.unfiltered() |
|
310 | 311 | remotephases = pushop.remote.listkeys('phases') |
|
311 | 312 | publishing = remotephases.get('publishing', False) |
|
312 | 313 | if (pushop.ui.configbool('ui', '_usedassubrepo', False) |
|
313 | 314 | and remotephases # server supports phases |
|
314 | 315 | and not pushop.outgoing.missing # no changesets to be pushed |
|
315 | 316 | and publishing): |
|
316 | 317 | # When: |
|
317 | 318 | # - this is a subrepo push |
|
318 | 319 | # - and remote support phase |
|
319 | 320 | # - and no changeset are to be pushed |
|
320 | 321 | # - and remote is publishing |
|
321 | 322 | # We may be in issue 3871 case! |
|
322 | 323 | # We drop the possible phase synchronisation done by |
|
323 | 324 | # courtesy to publish changesets possibly locally draft |
|
324 | 325 | # on the remote. |
|
325 | 326 | remotephases = {'publishing': 'True'} |
|
326 | 327 | ana = phases.analyzeremotephases(pushop.repo, |
|
327 | 328 | pushop.fallbackheads, |
|
328 | 329 | remotephases) |
|
329 | 330 | pheads, droots = ana |
|
330 | 331 | extracond = '' |
|
331 | 332 | if not publishing: |
|
332 | 333 | extracond = ' and public()' |
|
333 | 334 | revset = 'heads((%%ln::%%ln) %s)' % extracond |
|
334 | 335 | # Get the list of all revs draft on remote by public here. |
|
335 | 336 | # XXX Beware that revset break if droots is not strictly |
|
336 | 337 | # XXX root we may want to ensure it is but it is costly |
|
337 | 338 | fallback = list(unfi.set(revset, droots, pushop.fallbackheads)) |
|
338 | 339 | if not outgoing.missing: |
|
339 | 340 | future = fallback |
|
340 | 341 | else: |
|
341 | 342 | # adds changeset we are going to push as draft |
|
342 | 343 | # |
|
343 | 344 | # should not be necessary for publishing server, but because of an |
|
344 | 345 | # issue fixed in xxxxx we have to do it anyway. |
|
345 | 346 | fdroots = list(unfi.set('roots(%ln + %ln::)', |
|
346 | 347 | outgoing.missing, droots)) |
|
347 | 348 | fdroots = [f.node() for f in fdroots] |
|
348 | 349 | future = list(unfi.set(revset, fdroots, pushop.futureheads)) |
|
349 | 350 | pushop.outdatedphases = future |
|
350 | 351 | pushop.fallbackoutdatedphases = fallback |
|
351 | 352 | |
|
352 | 353 | @pushdiscovery('obsmarker') |
|
353 | 354 | def _pushdiscoveryobsmarkers(pushop): |
|
354 | 355 | if (obsolete.isenabled(pushop.repo, obsolete.exchangeopt) |
|
355 | 356 | and pushop.repo.obsstore |
|
356 | 357 | and 'obsolete' in pushop.remote.listkeys('namespaces')): |
|
357 | 358 | repo = pushop.repo |
|
358 | 359 | # very naive computation, that can be quite expensive on big repo. |
|
359 | 360 | # However: evolution is currently slow on them anyway. |
|
360 | 361 | nodes = (c.node() for c in repo.set('::%ln', pushop.futureheads)) |
|
361 | 362 | pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(nodes) |
|
362 | 363 | |
|
363 | 364 | @pushdiscovery('bookmarks') |
|
364 | 365 | def _pushdiscoverybookmarks(pushop): |
|
365 | 366 | ui = pushop.ui |
|
366 | 367 | repo = pushop.repo.unfiltered() |
|
367 | 368 | remote = pushop.remote |
|
368 | 369 | ui.debug("checking for updated bookmarks\n") |
|
369 | 370 | ancestors = () |
|
370 | 371 | if pushop.revs: |
|
371 | 372 | revnums = map(repo.changelog.rev, pushop.revs) |
|
372 | 373 | ancestors = repo.changelog.ancestors(revnums, inclusive=True) |
|
373 | 374 | remotebookmark = remote.listkeys('bookmarks') |
|
374 | 375 | |
|
375 | 376 | explicit = set(pushop.bookmarks) |
|
376 | 377 | |
|
377 | 378 | comp = bookmod.compare(repo, repo._bookmarks, remotebookmark, srchex=hex) |
|
378 | 379 | addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = comp |
|
379 | 380 | for b, scid, dcid in advsrc: |
|
380 | 381 | if b in explicit: |
|
381 | 382 | explicit.remove(b) |
|
382 | 383 | if not ancestors or repo[scid].rev() in ancestors: |
|
383 | 384 | pushop.outbookmarks.append((b, dcid, scid)) |
|
384 | 385 | # search added bookmark |
|
385 | 386 | for b, scid, dcid in addsrc: |
|
386 | 387 | if b in explicit: |
|
387 | 388 | explicit.remove(b) |
|
388 | 389 | pushop.outbookmarks.append((b, '', scid)) |
|
389 | 390 | # search for overwritten bookmark |
|
390 | 391 | for b, scid, dcid in advdst + diverge + differ: |
|
391 | 392 | if b in explicit: |
|
392 | 393 | explicit.remove(b) |
|
393 | 394 | pushop.outbookmarks.append((b, dcid, scid)) |
|
394 | 395 | # search for bookmark to delete |
|
395 | 396 | for b, scid, dcid in adddst: |
|
396 | 397 | if b in explicit: |
|
397 | 398 | explicit.remove(b) |
|
398 | 399 | # treat as "deleted locally" |
|
399 | 400 | pushop.outbookmarks.append((b, dcid, '')) |
|
400 | 401 | # identical bookmarks shouldn't get reported |
|
401 | 402 | for b, scid, dcid in same: |
|
402 | 403 | if b in explicit: |
|
403 | 404 | explicit.remove(b) |
|
404 | 405 | |
|
405 | 406 | if explicit: |
|
406 | 407 | explicit = sorted(explicit) |
|
407 | 408 | # we should probably list all of them |
|
408 | 409 | ui.warn(_('bookmark %s does not exist on the local ' |
|
409 | 410 | 'or remote repository!\n') % explicit[0]) |
|
410 | 411 | pushop.bkresult = 2 |
|
411 | 412 | |
|
412 | 413 | pushop.outbookmarks.sort() |
|
413 | 414 | |
|
414 | 415 | def _pushcheckoutgoing(pushop): |
|
415 | 416 | outgoing = pushop.outgoing |
|
416 | 417 | unfi = pushop.repo.unfiltered() |
|
417 | 418 | if not outgoing.missing: |
|
418 | 419 | # nothing to push |
|
419 | 420 | scmutil.nochangesfound(unfi.ui, unfi, outgoing.excluded) |
|
420 | 421 | return False |
|
421 | 422 | # something to push |
|
422 | 423 | if not pushop.force: |
|
423 | 424 | # if repo.obsstore == False --> no obsolete |
|
424 | 425 | # then, save the iteration |
|
425 | 426 | if unfi.obsstore: |
|
426 | 427 | # this message are here for 80 char limit reason |
|
427 | 428 | mso = _("push includes obsolete changeset: %s!") |
|
428 | 429 | mst = {"unstable": _("push includes unstable changeset: %s!"), |
|
429 | 430 | "bumped": _("push includes bumped changeset: %s!"), |
|
430 | 431 | "divergent": _("push includes divergent changeset: %s!")} |
|
431 | 432 | # If we are to push if there is at least one |
|
432 | 433 | # obsolete or unstable changeset in missing, at |
|
433 | 434 | # least one of the missinghead will be obsolete or |
|
434 | 435 | # unstable. So checking heads only is ok |
|
435 | 436 | for node in outgoing.missingheads: |
|
436 | 437 | ctx = unfi[node] |
|
437 | 438 | if ctx.obsolete(): |
|
438 | 439 | raise error.Abort(mso % ctx) |
|
439 | 440 | elif ctx.troubled(): |
|
440 | 441 | raise error.Abort(mst[ctx.troubles()[0]] % ctx) |
|
441 | 442 | |
|
442 | 443 | # internal config: bookmarks.pushing |
|
443 | 444 | newbm = pushop.ui.configlist('bookmarks', 'pushing') |
|
444 | 445 | discovery.checkheads(unfi, pushop.remote, outgoing, |
|
445 | 446 | pushop.remoteheads, |
|
446 | 447 | pushop.newbranch, |
|
447 | 448 | bool(pushop.incoming), |
|
448 | 449 | newbm) |
|
449 | 450 | return True |
|
450 | 451 | |
|
451 | 452 | # List of names of steps to perform for an outgoing bundle2, order matters. |
|
452 | 453 | b2partsgenorder = [] |
|
453 | 454 | |
|
454 | 455 | # Mapping between step name and function |
|
455 | 456 | # |
|
456 | 457 | # This exists to help extensions wrap steps if necessary |
|
457 | 458 | b2partsgenmapping = {} |
|
458 | 459 | |
|
459 | 460 | def b2partsgenerator(stepname, idx=None): |
|
460 | 461 | """decorator for function generating bundle2 part |
|
461 | 462 | |
|
462 | 463 | The function is added to the step -> function mapping and appended to the |
|
463 | 464 | list of steps. Beware that decorated functions will be added in order |
|
464 | 465 | (this may matter). |
|
465 | 466 | |
|
466 | 467 | You can only use this decorator for new steps, if you want to wrap a step |
|
467 | 468 | from an extension, attack the b2partsgenmapping dictionary directly.""" |
|
468 | 469 | def dec(func): |
|
469 | 470 | assert stepname not in b2partsgenmapping |
|
470 | 471 | b2partsgenmapping[stepname] = func |
|
471 | 472 | if idx is None: |
|
472 | 473 | b2partsgenorder.append(stepname) |
|
473 | 474 | else: |
|
474 | 475 | b2partsgenorder.insert(idx, stepname) |
|
475 | 476 | return func |
|
476 | 477 | return dec |
|
477 | 478 | |
|
478 | 479 | def _pushb2ctxcheckheads(pushop, bundler): |
|
479 | 480 | """Generate race condition checking parts |
|
480 | 481 | |
|
481 | 482 | Exists as an indepedent function to aid extensions |
|
482 | 483 | """ |
|
483 | 484 | if not pushop.force: |
|
484 | 485 | bundler.newpart('check:heads', data=iter(pushop.remoteheads)) |
|
485 | 486 | |
|
486 | 487 | @b2partsgenerator('changeset') |
|
487 | 488 | def _pushb2ctx(pushop, bundler): |
|
488 | 489 | """handle changegroup push through bundle2 |
|
489 | 490 | |
|
490 | 491 | addchangegroup result is stored in the ``pushop.cgresult`` attribute. |
|
491 | 492 | """ |
|
492 | 493 | if 'changesets' in pushop.stepsdone: |
|
493 | 494 | return |
|
494 | 495 | pushop.stepsdone.add('changesets') |
|
495 | 496 | # Send known heads to the server for race detection. |
|
496 | 497 | if not _pushcheckoutgoing(pushop): |
|
497 | 498 | return |
|
498 | 499 | pushop.repo.prepushoutgoinghooks(pushop.repo, |
|
499 | 500 | pushop.remote, |
|
500 | 501 | pushop.outgoing) |
|
501 | 502 | |
|
502 | 503 | _pushb2ctxcheckheads(pushop, bundler) |
|
503 | 504 | |
|
504 | 505 | b2caps = bundle2.bundle2caps(pushop.remote) |
|
505 | 506 | version = None |
|
506 | 507 | cgversions = b2caps.get('changegroup') |
|
507 | 508 | if not cgversions: # 3.1 and 3.2 ship with an empty value |
|
508 | 509 | cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push', |
|
509 | 510 | pushop.outgoing) |
|
510 | 511 | else: |
|
511 | 512 | cgversions = [v for v in cgversions if v in changegroup.packermap] |
|
512 | 513 | if not cgversions: |
|
513 | 514 | raise ValueError(_('no common changegroup version')) |
|
514 | 515 | version = max(cgversions) |
|
515 | 516 | cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push', |
|
516 | 517 | pushop.outgoing, |
|
517 | 518 | version=version) |
|
518 | 519 | cgpart = bundler.newpart('changegroup', data=cg) |
|
519 | 520 | if version is not None: |
|
520 | 521 | cgpart.addparam('version', version) |
|
521 | 522 | def handlereply(op): |
|
522 | 523 | """extract addchangegroup returns from server reply""" |
|
523 | 524 | cgreplies = op.records.getreplies(cgpart.id) |
|
524 | 525 | assert len(cgreplies['changegroup']) == 1 |
|
525 | 526 | pushop.cgresult = cgreplies['changegroup'][0]['return'] |
|
526 | 527 | return handlereply |
|
527 | 528 | |
|
528 | 529 | @b2partsgenerator('phase') |
|
529 | 530 | def _pushb2phases(pushop, bundler): |
|
530 | 531 | """handle phase push through bundle2""" |
|
531 | 532 | if 'phases' in pushop.stepsdone: |
|
532 | 533 | return |
|
533 | 534 | b2caps = bundle2.bundle2caps(pushop.remote) |
|
534 | 535 | if not 'pushkey' in b2caps: |
|
535 | 536 | return |
|
536 | 537 | pushop.stepsdone.add('phases') |
|
537 | 538 | part2node = [] |
|
538 | 539 | |
|
539 | 540 | def handlefailure(pushop, exc): |
|
540 | 541 | targetid = int(exc.partid) |
|
541 | 542 | for partid, node in part2node: |
|
542 | 543 | if partid == targetid: |
|
543 | 544 | raise error.Abort(_('updating %s to public failed') % node) |
|
544 | 545 | |
|
545 | 546 | enc = pushkey.encode |
|
546 | 547 | for newremotehead in pushop.outdatedphases: |
|
547 | 548 | part = bundler.newpart('pushkey') |
|
548 | 549 | part.addparam('namespace', enc('phases')) |
|
549 | 550 | part.addparam('key', enc(newremotehead.hex())) |
|
550 | 551 | part.addparam('old', enc(str(phases.draft))) |
|
551 | 552 | part.addparam('new', enc(str(phases.public))) |
|
552 | 553 | part2node.append((part.id, newremotehead)) |
|
553 | 554 | pushop.pkfailcb[part.id] = handlefailure |
|
554 | 555 | |
|
555 | 556 | def handlereply(op): |
|
556 | 557 | for partid, node in part2node: |
|
557 | 558 | partrep = op.records.getreplies(partid) |
|
558 | 559 | results = partrep['pushkey'] |
|
559 | 560 | assert len(results) <= 1 |
|
560 | 561 | msg = None |
|
561 | 562 | if not results: |
|
562 | 563 | msg = _('server ignored update of %s to public!\n') % node |
|
563 | 564 | elif not int(results[0]['return']): |
|
564 | 565 | msg = _('updating %s to public failed!\n') % node |
|
565 | 566 | if msg is not None: |
|
566 | 567 | pushop.ui.warn(msg) |
|
567 | 568 | return handlereply |
|
568 | 569 | |
|
569 | 570 | @b2partsgenerator('obsmarkers') |
|
570 | 571 | def _pushb2obsmarkers(pushop, bundler): |
|
571 | 572 | if 'obsmarkers' in pushop.stepsdone: |
|
572 | 573 | return |
|
573 | 574 | remoteversions = bundle2.obsmarkersversion(bundler.capabilities) |
|
574 | 575 | if obsolete.commonversion(remoteversions) is None: |
|
575 | 576 | return |
|
576 | 577 | pushop.stepsdone.add('obsmarkers') |
|
577 | 578 | if pushop.outobsmarkers: |
|
578 | 579 | markers = sorted(pushop.outobsmarkers) |
|
579 | 580 | buildobsmarkerspart(bundler, markers) |
|
580 | 581 | |
|
581 | 582 | @b2partsgenerator('bookmarks') |
|
582 | 583 | def _pushb2bookmarks(pushop, bundler): |
|
583 | 584 | """handle bookmark push through bundle2""" |
|
584 | 585 | if 'bookmarks' in pushop.stepsdone: |
|
585 | 586 | return |
|
586 | 587 | b2caps = bundle2.bundle2caps(pushop.remote) |
|
587 | 588 | if 'pushkey' not in b2caps: |
|
588 | 589 | return |
|
589 | 590 | pushop.stepsdone.add('bookmarks') |
|
590 | 591 | part2book = [] |
|
591 | 592 | enc = pushkey.encode |
|
592 | 593 | |
|
593 | 594 | def handlefailure(pushop, exc): |
|
594 | 595 | targetid = int(exc.partid) |
|
595 | 596 | for partid, book, action in part2book: |
|
596 | 597 | if partid == targetid: |
|
597 | 598 | raise error.Abort(bookmsgmap[action][1].rstrip() % book) |
|
598 | 599 | # we should not be called for part we did not generated |
|
599 | 600 | assert False |
|
600 | 601 | |
|
601 | 602 | for book, old, new in pushop.outbookmarks: |
|
602 | 603 | part = bundler.newpart('pushkey') |
|
603 | 604 | part.addparam('namespace', enc('bookmarks')) |
|
604 | 605 | part.addparam('key', enc(book)) |
|
605 | 606 | part.addparam('old', enc(old)) |
|
606 | 607 | part.addparam('new', enc(new)) |
|
607 | 608 | action = 'update' |
|
608 | 609 | if not old: |
|
609 | 610 | action = 'export' |
|
610 | 611 | elif not new: |
|
611 | 612 | action = 'delete' |
|
612 | 613 | part2book.append((part.id, book, action)) |
|
613 | 614 | pushop.pkfailcb[part.id] = handlefailure |
|
614 | 615 | |
|
615 | 616 | def handlereply(op): |
|
616 | 617 | ui = pushop.ui |
|
617 | 618 | for partid, book, action in part2book: |
|
618 | 619 | partrep = op.records.getreplies(partid) |
|
619 | 620 | results = partrep['pushkey'] |
|
620 | 621 | assert len(results) <= 1 |
|
621 | 622 | if not results: |
|
622 | 623 | pushop.ui.warn(_('server ignored bookmark %s update\n') % book) |
|
623 | 624 | else: |
|
624 | 625 | ret = int(results[0]['return']) |
|
625 | 626 | if ret: |
|
626 | 627 | ui.status(bookmsgmap[action][0] % book) |
|
627 | 628 | else: |
|
628 | 629 | ui.warn(bookmsgmap[action][1] % book) |
|
629 | 630 | if pushop.bkresult is not None: |
|
630 | 631 | pushop.bkresult = 1 |
|
631 | 632 | return handlereply |
|
632 | 633 | |
|
633 | 634 | |
|
634 | 635 | def _pushbundle2(pushop): |
|
635 | 636 | """push data to the remote using bundle2 |
|
636 | 637 | |
|
637 | 638 | The only currently supported type of data is changegroup but this will |
|
638 | 639 | evolve in the future.""" |
|
639 | 640 | bundler = bundle2.bundle20(pushop.ui, bundle2.bundle2caps(pushop.remote)) |
|
640 | 641 | pushback = (pushop.trmanager |
|
641 | 642 | and pushop.ui.configbool('experimental', 'bundle2.pushback')) |
|
642 | 643 | |
|
643 | 644 | # create reply capability |
|
644 | 645 | capsblob = bundle2.encodecaps(bundle2.getrepocaps(pushop.repo, |
|
645 | 646 | allowpushback=pushback)) |
|
646 | 647 | bundler.newpart('replycaps', data=capsblob) |
|
647 | 648 | replyhandlers = [] |
|
648 | 649 | for partgenname in b2partsgenorder: |
|
649 | 650 | partgen = b2partsgenmapping[partgenname] |
|
650 | 651 | ret = partgen(pushop, bundler) |
|
651 | 652 | if callable(ret): |
|
652 | 653 | replyhandlers.append(ret) |
|
653 | 654 | # do not push if nothing to push |
|
654 | 655 | if bundler.nbparts <= 1: |
|
655 | 656 | return |
|
656 | 657 | stream = util.chunkbuffer(bundler.getchunks()) |
|
657 | 658 | try: |
|
658 | 659 | try: |
|
659 | 660 | reply = pushop.remote.unbundle(stream, ['force'], 'push') |
|
660 | 661 | except error.BundleValueError as exc: |
|
661 | 662 | raise error.Abort('missing support for %s' % exc) |
|
662 | 663 | try: |
|
663 | 664 | trgetter = None |
|
664 | 665 | if pushback: |
|
665 | 666 | trgetter = pushop.trmanager.transaction |
|
666 | 667 | op = bundle2.processbundle(pushop.repo, reply, trgetter) |
|
667 | 668 | except error.BundleValueError as exc: |
|
668 | 669 | raise error.Abort('missing support for %s' % exc) |
|
669 | 670 | except error.PushkeyFailed as exc: |
|
670 | 671 | partid = int(exc.partid) |
|
671 | 672 | if partid not in pushop.pkfailcb: |
|
672 | 673 | raise |
|
673 | 674 | pushop.pkfailcb[partid](pushop, exc) |
|
674 | 675 | for rephand in replyhandlers: |
|
675 | 676 | rephand(op) |
|
676 | 677 | |
|
677 | 678 | def _pushchangeset(pushop): |
|
678 | 679 | """Make the actual push of changeset bundle to remote repo""" |
|
679 | 680 | if 'changesets' in pushop.stepsdone: |
|
680 | 681 | return |
|
681 | 682 | pushop.stepsdone.add('changesets') |
|
682 | 683 | if not _pushcheckoutgoing(pushop): |
|
683 | 684 | return |
|
684 | 685 | pushop.repo.prepushoutgoinghooks(pushop.repo, |
|
685 | 686 | pushop.remote, |
|
686 | 687 | pushop.outgoing) |
|
687 | 688 | outgoing = pushop.outgoing |
|
688 | 689 | unbundle = pushop.remote.capable('unbundle') |
|
689 | 690 | # TODO: get bundlecaps from remote |
|
690 | 691 | bundlecaps = None |
|
691 | 692 | # create a changegroup from local |
|
692 | 693 | if pushop.revs is None and not (outgoing.excluded |
|
693 | 694 | or pushop.repo.changelog.filteredrevs): |
|
694 | 695 | # push everything, |
|
695 | 696 | # use the fast path, no race possible on push |
|
696 | 697 | bundler = changegroup.cg1packer(pushop.repo, bundlecaps) |
|
697 | 698 | cg = changegroup.getsubset(pushop.repo, |
|
698 | 699 | outgoing, |
|
699 | 700 | bundler, |
|
700 | 701 | 'push', |
|
701 | 702 | fastpath=True) |
|
702 | 703 | else: |
|
703 | 704 | cg = changegroup.getlocalchangegroup(pushop.repo, 'push', outgoing, |
|
704 | 705 | bundlecaps) |
|
705 | 706 | |
|
706 | 707 | # apply changegroup to remote |
|
707 | 708 | if unbundle: |
|
708 | 709 | # local repo finds heads on server, finds out what |
|
709 | 710 | # revs it must push. once revs transferred, if server |
|
710 | 711 | # finds it has different heads (someone else won |
|
711 | 712 | # commit/push race), server aborts. |
|
712 | 713 | if pushop.force: |
|
713 | 714 | remoteheads = ['force'] |
|
714 | 715 | else: |
|
715 | 716 | remoteheads = pushop.remoteheads |
|
716 | 717 | # ssh: return remote's addchangegroup() |
|
717 | 718 | # http: return remote's addchangegroup() or 0 for error |
|
718 | 719 | pushop.cgresult = pushop.remote.unbundle(cg, remoteheads, |
|
719 | 720 | pushop.repo.url()) |
|
720 | 721 | else: |
|
721 | 722 | # we return an integer indicating remote head count |
|
722 | 723 | # change |
|
723 | 724 | pushop.cgresult = pushop.remote.addchangegroup(cg, 'push', |
|
724 | 725 | pushop.repo.url()) |
|
725 | 726 | |
|
726 | 727 | def _pushsyncphase(pushop): |
|
727 | 728 | """synchronise phase information locally and remotely""" |
|
728 | 729 | cheads = pushop.commonheads |
|
729 | 730 | # even when we don't push, exchanging phase data is useful |
|
730 | 731 | remotephases = pushop.remote.listkeys('phases') |
|
731 | 732 | if (pushop.ui.configbool('ui', '_usedassubrepo', False) |
|
732 | 733 | and remotephases # server supports phases |
|
733 | 734 | and pushop.cgresult is None # nothing was pushed |
|
734 | 735 | and remotephases.get('publishing', False)): |
|
735 | 736 | # When: |
|
736 | 737 | # - this is a subrepo push |
|
737 | 738 | # - and remote support phase |
|
738 | 739 | # - and no changeset was pushed |
|
739 | 740 | # - and remote is publishing |
|
740 | 741 | # We may be in issue 3871 case! |
|
741 | 742 | # We drop the possible phase synchronisation done by |
|
742 | 743 | # courtesy to publish changesets possibly locally draft |
|
743 | 744 | # on the remote. |
|
744 | 745 | remotephases = {'publishing': 'True'} |
|
745 | 746 | if not remotephases: # old server or public only reply from non-publishing |
|
746 | 747 | _localphasemove(pushop, cheads) |
|
747 | 748 | # don't push any phase data as there is nothing to push |
|
748 | 749 | else: |
|
749 | 750 | ana = phases.analyzeremotephases(pushop.repo, cheads, |
|
750 | 751 | remotephases) |
|
751 | 752 | pheads, droots = ana |
|
752 | 753 | ### Apply remote phase on local |
|
753 | 754 | if remotephases.get('publishing', False): |
|
754 | 755 | _localphasemove(pushop, cheads) |
|
755 | 756 | else: # publish = False |
|
756 | 757 | _localphasemove(pushop, pheads) |
|
757 | 758 | _localphasemove(pushop, cheads, phases.draft) |
|
758 | 759 | ### Apply local phase on remote |
|
759 | 760 | |
|
760 | 761 | if pushop.cgresult: |
|
761 | 762 | if 'phases' in pushop.stepsdone: |
|
762 | 763 | # phases already pushed though bundle2 |
|
763 | 764 | return |
|
764 | 765 | outdated = pushop.outdatedphases |
|
765 | 766 | else: |
|
766 | 767 | outdated = pushop.fallbackoutdatedphases |
|
767 | 768 | |
|
768 | 769 | pushop.stepsdone.add('phases') |
|
769 | 770 | |
|
770 | 771 | # filter heads already turned public by the push |
|
771 | 772 | outdated = [c for c in outdated if c.node() not in pheads] |
|
772 | 773 | # fallback to independent pushkey command |
|
773 | 774 | for newremotehead in outdated: |
|
774 | 775 | r = pushop.remote.pushkey('phases', |
|
775 | 776 | newremotehead.hex(), |
|
776 | 777 | str(phases.draft), |
|
777 | 778 | str(phases.public)) |
|
778 | 779 | if not r: |
|
779 | 780 | pushop.ui.warn(_('updating %s to public failed!\n') |
|
780 | 781 | % newremotehead) |
|
781 | 782 | |
|
782 | 783 | def _localphasemove(pushop, nodes, phase=phases.public): |
|
783 | 784 | """move <nodes> to <phase> in the local source repo""" |
|
784 | 785 | if pushop.trmanager: |
|
785 | 786 | phases.advanceboundary(pushop.repo, |
|
786 | 787 | pushop.trmanager.transaction(), |
|
787 | 788 | phase, |
|
788 | 789 | nodes) |
|
789 | 790 | else: |
|
790 | 791 | # repo is not locked, do not change any phases! |
|
791 | 792 | # Informs the user that phases should have been moved when |
|
792 | 793 | # applicable. |
|
793 | 794 | actualmoves = [n for n in nodes if phase < pushop.repo[n].phase()] |
|
794 | 795 | phasestr = phases.phasenames[phase] |
|
795 | 796 | if actualmoves: |
|
796 | 797 | pushop.ui.status(_('cannot lock source repo, skipping ' |
|
797 | 798 | 'local %s phase update\n') % phasestr) |
|
798 | 799 | |
|
799 | 800 | def _pushobsolete(pushop): |
|
800 | 801 | """utility function to push obsolete markers to a remote""" |
|
801 | 802 | if 'obsmarkers' in pushop.stepsdone: |
|
802 | 803 | return |
|
803 | 804 | repo = pushop.repo |
|
804 | 805 | remote = pushop.remote |
|
805 | 806 | pushop.stepsdone.add('obsmarkers') |
|
806 | 807 | if pushop.outobsmarkers: |
|
807 | 808 | pushop.ui.debug('try to push obsolete markers to remote\n') |
|
808 | 809 | rslts = [] |
|
809 | 810 | remotedata = obsolete._pushkeyescape(sorted(pushop.outobsmarkers)) |
|
810 | 811 | for key in sorted(remotedata, reverse=True): |
|
811 | 812 | # reverse sort to ensure we end with dump0 |
|
812 | 813 | data = remotedata[key] |
|
813 | 814 | rslts.append(remote.pushkey('obsolete', key, '', data)) |
|
814 | 815 | if [r for r in rslts if not r]: |
|
815 | 816 | msg = _('failed to push some obsolete markers!\n') |
|
816 | 817 | repo.ui.warn(msg) |
|
817 | 818 | |
|
818 | 819 | def _pushbookmark(pushop): |
|
819 | 820 | """Update bookmark position on remote""" |
|
820 | 821 | if pushop.cgresult == 0 or 'bookmarks' in pushop.stepsdone: |
|
821 | 822 | return |
|
822 | 823 | pushop.stepsdone.add('bookmarks') |
|
823 | 824 | ui = pushop.ui |
|
824 | 825 | remote = pushop.remote |
|
825 | 826 | |
|
826 | 827 | for b, old, new in pushop.outbookmarks: |
|
827 | 828 | action = 'update' |
|
828 | 829 | if not old: |
|
829 | 830 | action = 'export' |
|
830 | 831 | elif not new: |
|
831 | 832 | action = 'delete' |
|
832 | 833 | if remote.pushkey('bookmarks', b, old, new): |
|
833 | 834 | ui.status(bookmsgmap[action][0] % b) |
|
834 | 835 | else: |
|
835 | 836 | ui.warn(bookmsgmap[action][1] % b) |
|
836 | 837 | # discovery can have set the value form invalid entry |
|
837 | 838 | if pushop.bkresult is not None: |
|
838 | 839 | pushop.bkresult = 1 |
|
839 | 840 | |
|
840 | 841 | class pulloperation(object): |
|
841 | 842 | """A object that represent a single pull operation |
|
842 | 843 | |
|
843 | 844 | It purpose is to carry pull related state and very common operation. |
|
844 | 845 | |
|
845 | 846 | A new should be created at the beginning of each pull and discarded |
|
846 | 847 | afterward. |
|
847 | 848 | """ |
|
848 | 849 | |
|
849 | 850 | def __init__(self, repo, remote, heads=None, force=False, bookmarks=(), |
|
850 | 851 | remotebookmarks=None, streamclonerequested=None): |
|
851 | 852 | # repo we pull into |
|
852 | 853 | self.repo = repo |
|
853 | 854 | # repo we pull from |
|
854 | 855 | self.remote = remote |
|
855 | 856 | # revision we try to pull (None is "all") |
|
856 | 857 | self.heads = heads |
|
857 | 858 | # bookmark pulled explicitly |
|
858 | 859 | self.explicitbookmarks = bookmarks |
|
859 | 860 | # do we force pull? |
|
860 | 861 | self.force = force |
|
861 | 862 | # whether a streaming clone was requested |
|
862 | 863 | self.streamclonerequested = streamclonerequested |
|
863 | 864 | # transaction manager |
|
864 | 865 | self.trmanager = None |
|
865 | 866 | # set of common changeset between local and remote before pull |
|
866 | 867 | self.common = None |
|
867 | 868 | # set of pulled head |
|
868 | 869 | self.rheads = None |
|
869 | 870 | # list of missing changeset to fetch remotely |
|
870 | 871 | self.fetch = None |
|
871 | 872 | # remote bookmarks data |
|
872 | 873 | self.remotebookmarks = remotebookmarks |
|
873 | 874 | # result of changegroup pulling (used as return code by pull) |
|
874 | 875 | self.cgresult = None |
|
875 | 876 | # list of step already done |
|
876 | 877 | self.stepsdone = set() |
|
877 | 878 | |
|
878 | 879 | @util.propertycache |
|
879 | 880 | def pulledsubset(self): |
|
880 | 881 | """heads of the set of changeset target by the pull""" |
|
881 | 882 | # compute target subset |
|
882 | 883 | if self.heads is None: |
|
883 | 884 | # We pulled every thing possible |
|
884 | 885 | # sync on everything common |
|
885 | 886 | c = set(self.common) |
|
886 | 887 | ret = list(self.common) |
|
887 | 888 | for n in self.rheads: |
|
888 | 889 | if n not in c: |
|
889 | 890 | ret.append(n) |
|
890 | 891 | return ret |
|
891 | 892 | else: |
|
892 | 893 | # We pulled a specific subset |
|
893 | 894 | # sync on this subset |
|
894 | 895 | return self.heads |
|
895 | 896 | |
|
896 | 897 | @util.propertycache |
|
897 | 898 | def canusebundle2(self): |
|
898 | 899 | return _canusebundle2(self) |
|
899 | 900 | |
|
900 | 901 | @util.propertycache |
|
901 | 902 | def remotebundle2caps(self): |
|
902 | 903 | return bundle2.bundle2caps(self.remote) |
|
903 | 904 | |
|
904 | 905 | def gettransaction(self): |
|
905 | 906 | # deprecated; talk to trmanager directly |
|
906 | 907 | return self.trmanager.transaction() |
|
907 | 908 | |
|
908 | 909 | class transactionmanager(object): |
|
909 | 910 | """An object to manage the life cycle of a transaction |
|
910 | 911 | |
|
911 | 912 | It creates the transaction on demand and calls the appropriate hooks when |
|
912 | 913 | closing the transaction.""" |
|
913 | 914 | def __init__(self, repo, source, url): |
|
914 | 915 | self.repo = repo |
|
915 | 916 | self.source = source |
|
916 | 917 | self.url = url |
|
917 | 918 | self._tr = None |
|
918 | 919 | |
|
919 | 920 | def transaction(self): |
|
920 | 921 | """Return an open transaction object, constructing if necessary""" |
|
921 | 922 | if not self._tr: |
|
922 | 923 | trname = '%s\n%s' % (self.source, util.hidepassword(self.url)) |
|
923 | 924 | self._tr = self.repo.transaction(trname) |
|
924 | 925 | self._tr.hookargs['source'] = self.source |
|
925 | 926 | self._tr.hookargs['url'] = self.url |
|
926 | 927 | return self._tr |
|
927 | 928 | |
|
928 | 929 | def close(self): |
|
929 | 930 | """close transaction if created""" |
|
930 | 931 | if self._tr is not None: |
|
931 | 932 | self._tr.close() |
|
932 | 933 | |
|
933 | 934 | def release(self): |
|
934 | 935 | """release transaction if created""" |
|
935 | 936 | if self._tr is not None: |
|
936 | 937 | self._tr.release() |
|
937 | 938 | |
|
938 | 939 | def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None, |
|
939 | 940 | streamclonerequested=None): |
|
940 | 941 | """Fetch repository data from a remote. |
|
941 | 942 | |
|
942 | 943 | This is the main function used to retrieve data from a remote repository. |
|
943 | 944 | |
|
944 | 945 | ``repo`` is the local repository to clone into. |
|
945 | 946 | ``remote`` is a peer instance. |
|
946 | 947 | ``heads`` is an iterable of revisions we want to pull. ``None`` (the |
|
947 | 948 | default) means to pull everything from the remote. |
|
948 | 949 | ``bookmarks`` is an iterable of bookmarks requesting to be pulled. By |
|
949 | 950 | default, all remote bookmarks are pulled. |
|
950 | 951 | ``opargs`` are additional keyword arguments to pass to ``pulloperation`` |
|
951 | 952 | initialization. |
|
952 | 953 | ``streamclonerequested`` is a boolean indicating whether a "streaming |
|
953 | 954 | clone" is requested. A "streaming clone" is essentially a raw file copy |
|
954 | 955 | of revlogs from the server. This only works when the local repository is |
|
955 | 956 | empty. The default value of ``None`` means to respect the server |
|
956 | 957 | configuration for preferring stream clones. |
|
957 | 958 | |
|
958 | 959 | Returns the ``pulloperation`` created for this pull. |
|
959 | 960 | """ |
|
960 | 961 | if opargs is None: |
|
961 | 962 | opargs = {} |
|
962 | 963 | pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks, |
|
963 | 964 | streamclonerequested=streamclonerequested, **opargs) |
|
964 | 965 | if pullop.remote.local(): |
|
965 | 966 | missing = set(pullop.remote.requirements) - pullop.repo.supported |
|
966 | 967 | if missing: |
|
967 | 968 | msg = _("required features are not" |
|
968 | 969 | " supported in the destination:" |
|
969 | 970 | " %s") % (', '.join(sorted(missing))) |
|
970 | 971 | raise error.Abort(msg) |
|
971 | 972 | |
|
972 | 973 | lock = pullop.repo.lock() |
|
973 | 974 | try: |
|
974 | 975 | pullop.trmanager = transactionmanager(repo, 'pull', remote.url()) |
|
975 | 976 | streamclone.maybeperformlegacystreamclone(pullop) |
|
977 | # This should ideally be in _pullbundle2(). However, it needs to run | |
|
978 | # before discovery to avoid extra work. | |
|
979 | _maybeapplyclonebundle(pullop) | |
|
976 | 980 | _pulldiscovery(pullop) |
|
977 | 981 | if pullop.canusebundle2: |
|
978 | 982 | _pullbundle2(pullop) |
|
979 | 983 | _pullchangeset(pullop) |
|
980 | 984 | _pullphase(pullop) |
|
981 | 985 | _pullbookmarks(pullop) |
|
982 | 986 | _pullobsolete(pullop) |
|
983 | 987 | pullop.trmanager.close() |
|
984 | 988 | finally: |
|
985 | 989 | pullop.trmanager.release() |
|
986 | 990 | lock.release() |
|
987 | 991 | |
|
988 | 992 | return pullop |
|
989 | 993 | |
|
990 | 994 | # list of steps to perform discovery before pull |
|
991 | 995 | pulldiscoveryorder = [] |
|
992 | 996 | |
|
993 | 997 | # Mapping between step name and function |
|
994 | 998 | # |
|
995 | 999 | # This exists to help extensions wrap steps if necessary |
|
996 | 1000 | pulldiscoverymapping = {} |
|
997 | 1001 | |
|
998 | 1002 | def pulldiscovery(stepname): |
|
999 | 1003 | """decorator for function performing discovery before pull |
|
1000 | 1004 | |
|
1001 | 1005 | The function is added to the step -> function mapping and appended to the |
|
1002 | 1006 | list of steps. Beware that decorated function will be added in order (this |
|
1003 | 1007 | may matter). |
|
1004 | 1008 | |
|
1005 | 1009 | You can only use this decorator for a new step, if you want to wrap a step |
|
1006 | 1010 | from an extension, change the pulldiscovery dictionary directly.""" |
|
1007 | 1011 | def dec(func): |
|
1008 | 1012 | assert stepname not in pulldiscoverymapping |
|
1009 | 1013 | pulldiscoverymapping[stepname] = func |
|
1010 | 1014 | pulldiscoveryorder.append(stepname) |
|
1011 | 1015 | return func |
|
1012 | 1016 | return dec |
|
1013 | 1017 | |
|
1014 | 1018 | def _pulldiscovery(pullop): |
|
1015 | 1019 | """Run all discovery steps""" |
|
1016 | 1020 | for stepname in pulldiscoveryorder: |
|
1017 | 1021 | step = pulldiscoverymapping[stepname] |
|
1018 | 1022 | step(pullop) |
|
1019 | 1023 | |
|
1020 | 1024 | @pulldiscovery('b1:bookmarks') |
|
1021 | 1025 | def _pullbookmarkbundle1(pullop): |
|
1022 | 1026 | """fetch bookmark data in bundle1 case |
|
1023 | 1027 | |
|
1024 | 1028 | If not using bundle2, we have to fetch bookmarks before changeset |
|
1025 | 1029 | discovery to reduce the chance and impact of race conditions.""" |
|
1026 | 1030 | if pullop.remotebookmarks is not None: |
|
1027 | 1031 | return |
|
1028 | 1032 | if pullop.canusebundle2 and 'listkeys' in pullop.remotebundle2caps: |
|
1029 | 1033 | # all known bundle2 servers now support listkeys, but lets be nice with |
|
1030 | 1034 | # new implementation. |
|
1031 | 1035 | return |
|
1032 | 1036 | pullop.remotebookmarks = pullop.remote.listkeys('bookmarks') |
|
1033 | 1037 | |
|
1034 | 1038 | |
|
1035 | 1039 | @pulldiscovery('changegroup') |
|
1036 | 1040 | def _pulldiscoverychangegroup(pullop): |
|
1037 | 1041 | """discovery phase for the pull |
|
1038 | 1042 | |
|
1039 | 1043 | Current handle changeset discovery only, will change handle all discovery |
|
1040 | 1044 | at some point.""" |
|
1041 | 1045 | tmp = discovery.findcommonincoming(pullop.repo, |
|
1042 | 1046 | pullop.remote, |
|
1043 | 1047 | heads=pullop.heads, |
|
1044 | 1048 | force=pullop.force) |
|
1045 | 1049 | common, fetch, rheads = tmp |
|
1046 | 1050 | nm = pullop.repo.unfiltered().changelog.nodemap |
|
1047 | 1051 | if fetch and rheads: |
|
1048 | 1052 | # If a remote heads in filtered locally, lets drop it from the unknown |
|
1049 | 1053 | # remote heads and put in back in common. |
|
1050 | 1054 | # |
|
1051 | 1055 | # This is a hackish solution to catch most of "common but locally |
|
1052 | 1056 | # hidden situation". We do not performs discovery on unfiltered |
|
1053 | 1057 | # repository because it end up doing a pathological amount of round |
|
1054 | 1058 | # trip for w huge amount of changeset we do not care about. |
|
1055 | 1059 | # |
|
1056 | 1060 | # If a set of such "common but filtered" changeset exist on the server |
|
1057 | 1061 | # but are not including a remote heads, we'll not be able to detect it, |
|
1058 | 1062 | scommon = set(common) |
|
1059 | 1063 | filteredrheads = [] |
|
1060 | 1064 | for n in rheads: |
|
1061 | 1065 | if n in nm: |
|
1062 | 1066 | if n not in scommon: |
|
1063 | 1067 | common.append(n) |
|
1064 | 1068 | else: |
|
1065 | 1069 | filteredrheads.append(n) |
|
1066 | 1070 | if not filteredrheads: |
|
1067 | 1071 | fetch = [] |
|
1068 | 1072 | rheads = filteredrheads |
|
1069 | 1073 | pullop.common = common |
|
1070 | 1074 | pullop.fetch = fetch |
|
1071 | 1075 | pullop.rheads = rheads |
|
1072 | 1076 | |
|
1073 | 1077 | def _pullbundle2(pullop): |
|
1074 | 1078 | """pull data using bundle2 |
|
1075 | 1079 | |
|
1076 | 1080 | For now, the only supported data are changegroup.""" |
|
1077 | 1081 | kwargs = {'bundlecaps': caps20to10(pullop.repo)} |
|
1078 | 1082 | |
|
1079 | 1083 | streaming, streamreqs = streamclone.canperformstreamclone(pullop) |
|
1080 | 1084 | |
|
1081 | 1085 | # pulling changegroup |
|
1082 | 1086 | pullop.stepsdone.add('changegroup') |
|
1083 | 1087 | |
|
1084 | 1088 | kwargs['common'] = pullop.common |
|
1085 | 1089 | kwargs['heads'] = pullop.heads or pullop.rheads |
|
1086 | 1090 | kwargs['cg'] = pullop.fetch |
|
1087 | 1091 | if 'listkeys' in pullop.remotebundle2caps: |
|
1088 | 1092 | kwargs['listkeys'] = ['phase'] |
|
1089 | 1093 | if pullop.remotebookmarks is None: |
|
1090 | 1094 | # make sure to always includes bookmark data when migrating |
|
1091 | 1095 | # `hg incoming --bundle` to using this function. |
|
1092 | 1096 | kwargs['listkeys'].append('bookmarks') |
|
1093 | 1097 | if streaming: |
|
1094 | 1098 | pullop.repo.ui.status(_('streaming all changes\n')) |
|
1095 | 1099 | elif not pullop.fetch: |
|
1096 | 1100 | pullop.repo.ui.status(_("no changes found\n")) |
|
1097 | 1101 | pullop.cgresult = 0 |
|
1098 | 1102 | else: |
|
1099 | 1103 | if pullop.heads is None and list(pullop.common) == [nullid]: |
|
1100 | 1104 | pullop.repo.ui.status(_("requesting all changes\n")) |
|
1101 | 1105 | if obsolete.isenabled(pullop.repo, obsolete.exchangeopt): |
|
1102 | 1106 | remoteversions = bundle2.obsmarkersversion(pullop.remotebundle2caps) |
|
1103 | 1107 | if obsolete.commonversion(remoteversions) is not None: |
|
1104 | 1108 | kwargs['obsmarkers'] = True |
|
1105 | 1109 | pullop.stepsdone.add('obsmarkers') |
|
1106 | 1110 | _pullbundle2extraprepare(pullop, kwargs) |
|
1107 | 1111 | bundle = pullop.remote.getbundle('pull', **kwargs) |
|
1108 | 1112 | try: |
|
1109 | 1113 | op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction) |
|
1110 | 1114 | except error.BundleValueError as exc: |
|
1111 | 1115 | raise error.Abort('missing support for %s' % exc) |
|
1112 | 1116 | |
|
1113 | 1117 | if pullop.fetch: |
|
1114 | 1118 | results = [cg['return'] for cg in op.records['changegroup']] |
|
1115 | 1119 | pullop.cgresult = changegroup.combineresults(results) |
|
1116 | 1120 | |
|
1117 | 1121 | # processing phases change |
|
1118 | 1122 | for namespace, value in op.records['listkeys']: |
|
1119 | 1123 | if namespace == 'phases': |
|
1120 | 1124 | _pullapplyphases(pullop, value) |
|
1121 | 1125 | |
|
1122 | 1126 | # processing bookmark update |
|
1123 | 1127 | for namespace, value in op.records['listkeys']: |
|
1124 | 1128 | if namespace == 'bookmarks': |
|
1125 | 1129 | pullop.remotebookmarks = value |
|
1126 | 1130 | |
|
1127 | 1131 | # bookmark data were either already there or pulled in the bundle |
|
1128 | 1132 | if pullop.remotebookmarks is not None: |
|
1129 | 1133 | _pullbookmarks(pullop) |
|
1130 | 1134 | |
|
1131 | 1135 | def _pullbundle2extraprepare(pullop, kwargs): |
|
1132 | 1136 | """hook function so that extensions can extend the getbundle call""" |
|
1133 | 1137 | pass |
|
1134 | 1138 | |
|
1135 | 1139 | def _pullchangeset(pullop): |
|
1136 | 1140 | """pull changeset from unbundle into the local repo""" |
|
1137 | 1141 | # We delay the open of the transaction as late as possible so we |
|
1138 | 1142 | # don't open transaction for nothing or you break future useful |
|
1139 | 1143 | # rollback call |
|
1140 | 1144 | if 'changegroup' in pullop.stepsdone: |
|
1141 | 1145 | return |
|
1142 | 1146 | pullop.stepsdone.add('changegroup') |
|
1143 | 1147 | if not pullop.fetch: |
|
1144 | 1148 | pullop.repo.ui.status(_("no changes found\n")) |
|
1145 | 1149 | pullop.cgresult = 0 |
|
1146 | 1150 | return |
|
1147 | 1151 | pullop.gettransaction() |
|
1148 | 1152 | if pullop.heads is None and list(pullop.common) == [nullid]: |
|
1149 | 1153 | pullop.repo.ui.status(_("requesting all changes\n")) |
|
1150 | 1154 | elif pullop.heads is None and pullop.remote.capable('changegroupsubset'): |
|
1151 | 1155 | # issue1320, avoid a race if remote changed after discovery |
|
1152 | 1156 | pullop.heads = pullop.rheads |
|
1153 | 1157 | |
|
1154 | 1158 | if pullop.remote.capable('getbundle'): |
|
1155 | 1159 | # TODO: get bundlecaps from remote |
|
1156 | 1160 | cg = pullop.remote.getbundle('pull', common=pullop.common, |
|
1157 | 1161 | heads=pullop.heads or pullop.rheads) |
|
1158 | 1162 | elif pullop.heads is None: |
|
1159 | 1163 | cg = pullop.remote.changegroup(pullop.fetch, 'pull') |
|
1160 | 1164 | elif not pullop.remote.capable('changegroupsubset'): |
|
1161 | 1165 | raise error.Abort(_("partial pull cannot be done because " |
|
1162 | 1166 | "other repository doesn't support " |
|
1163 | 1167 | "changegroupsubset.")) |
|
1164 | 1168 | else: |
|
1165 | 1169 | cg = pullop.remote.changegroupsubset(pullop.fetch, pullop.heads, 'pull') |
|
1166 | 1170 | pullop.cgresult = changegroup.addchangegroup(pullop.repo, cg, 'pull', |
|
1167 | 1171 | pullop.remote.url()) |
|
1168 | 1172 | |
|
1169 | 1173 | def _pullphase(pullop): |
|
1170 | 1174 | # Get remote phases data from remote |
|
1171 | 1175 | if 'phases' in pullop.stepsdone: |
|
1172 | 1176 | return |
|
1173 | 1177 | remotephases = pullop.remote.listkeys('phases') |
|
1174 | 1178 | _pullapplyphases(pullop, remotephases) |
|
1175 | 1179 | |
|
1176 | 1180 | def _pullapplyphases(pullop, remotephases): |
|
1177 | 1181 | """apply phase movement from observed remote state""" |
|
1178 | 1182 | if 'phases' in pullop.stepsdone: |
|
1179 | 1183 | return |
|
1180 | 1184 | pullop.stepsdone.add('phases') |
|
1181 | 1185 | publishing = bool(remotephases.get('publishing', False)) |
|
1182 | 1186 | if remotephases and not publishing: |
|
1183 | 1187 | # remote is new and unpublishing |
|
1184 | 1188 | pheads, _dr = phases.analyzeremotephases(pullop.repo, |
|
1185 | 1189 | pullop.pulledsubset, |
|
1186 | 1190 | remotephases) |
|
1187 | 1191 | dheads = pullop.pulledsubset |
|
1188 | 1192 | else: |
|
1189 | 1193 | # Remote is old or publishing all common changesets |
|
1190 | 1194 | # should be seen as public |
|
1191 | 1195 | pheads = pullop.pulledsubset |
|
1192 | 1196 | dheads = [] |
|
1193 | 1197 | unfi = pullop.repo.unfiltered() |
|
1194 | 1198 | phase = unfi._phasecache.phase |
|
1195 | 1199 | rev = unfi.changelog.nodemap.get |
|
1196 | 1200 | public = phases.public |
|
1197 | 1201 | draft = phases.draft |
|
1198 | 1202 | |
|
1199 | 1203 | # exclude changesets already public locally and update the others |
|
1200 | 1204 | pheads = [pn for pn in pheads if phase(unfi, rev(pn)) > public] |
|
1201 | 1205 | if pheads: |
|
1202 | 1206 | tr = pullop.gettransaction() |
|
1203 | 1207 | phases.advanceboundary(pullop.repo, tr, public, pheads) |
|
1204 | 1208 | |
|
1205 | 1209 | # exclude changesets already draft locally and update the others |
|
1206 | 1210 | dheads = [pn for pn in dheads if phase(unfi, rev(pn)) > draft] |
|
1207 | 1211 | if dheads: |
|
1208 | 1212 | tr = pullop.gettransaction() |
|
1209 | 1213 | phases.advanceboundary(pullop.repo, tr, draft, dheads) |
|
1210 | 1214 | |
|
1211 | 1215 | def _pullbookmarks(pullop): |
|
1212 | 1216 | """process the remote bookmark information to update the local one""" |
|
1213 | 1217 | if 'bookmarks' in pullop.stepsdone: |
|
1214 | 1218 | return |
|
1215 | 1219 | pullop.stepsdone.add('bookmarks') |
|
1216 | 1220 | repo = pullop.repo |
|
1217 | 1221 | remotebookmarks = pullop.remotebookmarks |
|
1218 | 1222 | bookmod.updatefromremote(repo.ui, repo, remotebookmarks, |
|
1219 | 1223 | pullop.remote.url(), |
|
1220 | 1224 | pullop.gettransaction, |
|
1221 | 1225 | explicit=pullop.explicitbookmarks) |
|
1222 | 1226 | |
|
1223 | 1227 | def _pullobsolete(pullop): |
|
1224 | 1228 | """utility function to pull obsolete markers from a remote |
|
1225 | 1229 | |
|
1226 | 1230 | The `gettransaction` is function that return the pull transaction, creating |
|
1227 | 1231 | one if necessary. We return the transaction to inform the calling code that |
|
1228 | 1232 | a new transaction have been created (when applicable). |
|
1229 | 1233 | |
|
1230 | 1234 | Exists mostly to allow overriding for experimentation purpose""" |
|
1231 | 1235 | if 'obsmarkers' in pullop.stepsdone: |
|
1232 | 1236 | return |
|
1233 | 1237 | pullop.stepsdone.add('obsmarkers') |
|
1234 | 1238 | tr = None |
|
1235 | 1239 | if obsolete.isenabled(pullop.repo, obsolete.exchangeopt): |
|
1236 | 1240 | pullop.repo.ui.debug('fetching remote obsolete markers\n') |
|
1237 | 1241 | remoteobs = pullop.remote.listkeys('obsolete') |
|
1238 | 1242 | if 'dump0' in remoteobs: |
|
1239 | 1243 | tr = pullop.gettransaction() |
|
1240 | 1244 | for key in sorted(remoteobs, reverse=True): |
|
1241 | 1245 | if key.startswith('dump'): |
|
1242 | 1246 | data = base85.b85decode(remoteobs[key]) |
|
1243 | 1247 | pullop.repo.obsstore.mergemarkers(tr, data) |
|
1244 | 1248 | pullop.repo.invalidatevolatilesets() |
|
1245 | 1249 | return tr |
|
1246 | 1250 | |
|
1247 | 1251 | def caps20to10(repo): |
|
1248 | 1252 | """return a set with appropriate options to use bundle20 during getbundle""" |
|
1249 | 1253 | caps = set(['HG20']) |
|
1250 | 1254 | capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo)) |
|
1251 | 1255 | caps.add('bundle2=' + urllib.quote(capsblob)) |
|
1252 | 1256 | return caps |
|
1253 | 1257 | |
|
1254 | 1258 | # List of names of steps to perform for a bundle2 for getbundle, order matters. |
|
1255 | 1259 | getbundle2partsorder = [] |
|
1256 | 1260 | |
|
1257 | 1261 | # Mapping between step name and function |
|
1258 | 1262 | # |
|
1259 | 1263 | # This exists to help extensions wrap steps if necessary |
|
1260 | 1264 | getbundle2partsmapping = {} |
|
1261 | 1265 | |
|
1262 | 1266 | def getbundle2partsgenerator(stepname, idx=None): |
|
1263 | 1267 | """decorator for function generating bundle2 part for getbundle |
|
1264 | 1268 | |
|
1265 | 1269 | The function is added to the step -> function mapping and appended to the |
|
1266 | 1270 | list of steps. Beware that decorated functions will be added in order |
|
1267 | 1271 | (this may matter). |
|
1268 | 1272 | |
|
1269 | 1273 | You can only use this decorator for new steps, if you want to wrap a step |
|
1270 | 1274 | from an extension, attack the getbundle2partsmapping dictionary directly.""" |
|
1271 | 1275 | def dec(func): |
|
1272 | 1276 | assert stepname not in getbundle2partsmapping |
|
1273 | 1277 | getbundle2partsmapping[stepname] = func |
|
1274 | 1278 | if idx is None: |
|
1275 | 1279 | getbundle2partsorder.append(stepname) |
|
1276 | 1280 | else: |
|
1277 | 1281 | getbundle2partsorder.insert(idx, stepname) |
|
1278 | 1282 | return func |
|
1279 | 1283 | return dec |
|
1280 | 1284 | |
|
1281 | 1285 | def getbundle(repo, source, heads=None, common=None, bundlecaps=None, |
|
1282 | 1286 | **kwargs): |
|
1283 | 1287 | """return a full bundle (with potentially multiple kind of parts) |
|
1284 | 1288 | |
|
1285 | 1289 | Could be a bundle HG10 or a bundle HG20 depending on bundlecaps |
|
1286 | 1290 | passed. For now, the bundle can contain only changegroup, but this will |
|
1287 | 1291 | changes when more part type will be available for bundle2. |
|
1288 | 1292 | |
|
1289 | 1293 | This is different from changegroup.getchangegroup that only returns an HG10 |
|
1290 | 1294 | changegroup bundle. They may eventually get reunited in the future when we |
|
1291 | 1295 | have a clearer idea of the API we what to query different data. |
|
1292 | 1296 | |
|
1293 | 1297 | The implementation is at a very early stage and will get massive rework |
|
1294 | 1298 | when the API of bundle is refined. |
|
1295 | 1299 | """ |
|
1296 | 1300 | # bundle10 case |
|
1297 | 1301 | usebundle2 = False |
|
1298 | 1302 | if bundlecaps is not None: |
|
1299 | 1303 | usebundle2 = any((cap.startswith('HG2') for cap in bundlecaps)) |
|
1300 | 1304 | if not usebundle2: |
|
1301 | 1305 | if bundlecaps and not kwargs.get('cg', True): |
|
1302 | 1306 | raise ValueError(_('request for bundle10 must include changegroup')) |
|
1303 | 1307 | |
|
1304 | 1308 | if kwargs: |
|
1305 | 1309 | raise ValueError(_('unsupported getbundle arguments: %s') |
|
1306 | 1310 | % ', '.join(sorted(kwargs.keys()))) |
|
1307 | 1311 | return changegroup.getchangegroup(repo, source, heads=heads, |
|
1308 | 1312 | common=common, bundlecaps=bundlecaps) |
|
1309 | 1313 | |
|
1310 | 1314 | # bundle20 case |
|
1311 | 1315 | b2caps = {} |
|
1312 | 1316 | for bcaps in bundlecaps: |
|
1313 | 1317 | if bcaps.startswith('bundle2='): |
|
1314 | 1318 | blob = urllib.unquote(bcaps[len('bundle2='):]) |
|
1315 | 1319 | b2caps.update(bundle2.decodecaps(blob)) |
|
1316 | 1320 | bundler = bundle2.bundle20(repo.ui, b2caps) |
|
1317 | 1321 | |
|
1318 | 1322 | kwargs['heads'] = heads |
|
1319 | 1323 | kwargs['common'] = common |
|
1320 | 1324 | |
|
1321 | 1325 | for name in getbundle2partsorder: |
|
1322 | 1326 | func = getbundle2partsmapping[name] |
|
1323 | 1327 | func(bundler, repo, source, bundlecaps=bundlecaps, b2caps=b2caps, |
|
1324 | 1328 | **kwargs) |
|
1325 | 1329 | |
|
1326 | 1330 | return util.chunkbuffer(bundler.getchunks()) |
|
1327 | 1331 | |
|
1328 | 1332 | @getbundle2partsgenerator('changegroup') |
|
1329 | 1333 | def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, |
|
1330 | 1334 | b2caps=None, heads=None, common=None, **kwargs): |
|
1331 | 1335 | """add a changegroup part to the requested bundle""" |
|
1332 | 1336 | cg = None |
|
1333 | 1337 | if kwargs.get('cg', True): |
|
1334 | 1338 | # build changegroup bundle here. |
|
1335 | 1339 | version = None |
|
1336 | 1340 | cgversions = b2caps.get('changegroup') |
|
1337 | 1341 | getcgkwargs = {} |
|
1338 | 1342 | if cgversions: # 3.1 and 3.2 ship with an empty value |
|
1339 | 1343 | cgversions = [v for v in cgversions if v in changegroup.packermap] |
|
1340 | 1344 | if not cgversions: |
|
1341 | 1345 | raise ValueError(_('no common changegroup version')) |
|
1342 | 1346 | version = getcgkwargs['version'] = max(cgversions) |
|
1343 | 1347 | outgoing = changegroup.computeoutgoing(repo, heads, common) |
|
1344 | 1348 | cg = changegroup.getlocalchangegroupraw(repo, source, outgoing, |
|
1345 | 1349 | bundlecaps=bundlecaps, |
|
1346 | 1350 | **getcgkwargs) |
|
1347 | 1351 | |
|
1348 | 1352 | if cg: |
|
1349 | 1353 | part = bundler.newpart('changegroup', data=cg) |
|
1350 | 1354 | if version is not None: |
|
1351 | 1355 | part.addparam('version', version) |
|
1352 | 1356 | part.addparam('nbchanges', str(len(outgoing.missing)), mandatory=False) |
|
1353 | 1357 | |
|
1354 | 1358 | @getbundle2partsgenerator('listkeys') |
|
1355 | 1359 | def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None, |
|
1356 | 1360 | b2caps=None, **kwargs): |
|
1357 | 1361 | """add parts containing listkeys namespaces to the requested bundle""" |
|
1358 | 1362 | listkeys = kwargs.get('listkeys', ()) |
|
1359 | 1363 | for namespace in listkeys: |
|
1360 | 1364 | part = bundler.newpart('listkeys') |
|
1361 | 1365 | part.addparam('namespace', namespace) |
|
1362 | 1366 | keys = repo.listkeys(namespace).items() |
|
1363 | 1367 | part.data = pushkey.encodekeys(keys) |
|
1364 | 1368 | |
|
1365 | 1369 | @getbundle2partsgenerator('obsmarkers') |
|
1366 | 1370 | def _getbundleobsmarkerpart(bundler, repo, source, bundlecaps=None, |
|
1367 | 1371 | b2caps=None, heads=None, **kwargs): |
|
1368 | 1372 | """add an obsolescence markers part to the requested bundle""" |
|
1369 | 1373 | if kwargs.get('obsmarkers', False): |
|
1370 | 1374 | if heads is None: |
|
1371 | 1375 | heads = repo.heads() |
|
1372 | 1376 | subset = [c.node() for c in repo.set('::%ln', heads)] |
|
1373 | 1377 | markers = repo.obsstore.relevantmarkers(subset) |
|
1374 | 1378 | markers = sorted(markers) |
|
1375 | 1379 | buildobsmarkerspart(bundler, markers) |
|
1376 | 1380 | |
|
1377 | 1381 | @getbundle2partsgenerator('hgtagsfnodes') |
|
1378 | 1382 | def _getbundletagsfnodes(bundler, repo, source, bundlecaps=None, |
|
1379 | 1383 | b2caps=None, heads=None, common=None, |
|
1380 | 1384 | **kwargs): |
|
1381 | 1385 | """Transfer the .hgtags filenodes mapping. |
|
1382 | 1386 | |
|
1383 | 1387 | Only values for heads in this bundle will be transferred. |
|
1384 | 1388 | |
|
1385 | 1389 | The part data consists of pairs of 20 byte changeset node and .hgtags |
|
1386 | 1390 | filenodes raw values. |
|
1387 | 1391 | """ |
|
1388 | 1392 | # Don't send unless: |
|
1389 | 1393 | # - changeset are being exchanged, |
|
1390 | 1394 | # - the client supports it. |
|
1391 | 1395 | if not (kwargs.get('cg', True) and 'hgtagsfnodes' in b2caps): |
|
1392 | 1396 | return |
|
1393 | 1397 | |
|
1394 | 1398 | outgoing = changegroup.computeoutgoing(repo, heads, common) |
|
1395 | 1399 | |
|
1396 | 1400 | if not outgoing.missingheads: |
|
1397 | 1401 | return |
|
1398 | 1402 | |
|
1399 | 1403 | cache = tags.hgtagsfnodescache(repo.unfiltered()) |
|
1400 | 1404 | chunks = [] |
|
1401 | 1405 | |
|
1402 | 1406 | # .hgtags fnodes are only relevant for head changesets. While we could |
|
1403 | 1407 | # transfer values for all known nodes, there will likely be little to |
|
1404 | 1408 | # no benefit. |
|
1405 | 1409 | # |
|
1406 | 1410 | # We don't bother using a generator to produce output data because |
|
1407 | 1411 | # a) we only have 40 bytes per head and even esoteric numbers of heads |
|
1408 | 1412 | # consume little memory (1M heads is 40MB) b) we don't want to send the |
|
1409 | 1413 | # part if we don't have entries and knowing if we have entries requires |
|
1410 | 1414 | # cache lookups. |
|
1411 | 1415 | for node in outgoing.missingheads: |
|
1412 | 1416 | # Don't compute missing, as this may slow down serving. |
|
1413 | 1417 | fnode = cache.getfnode(node, computemissing=False) |
|
1414 | 1418 | if fnode is not None: |
|
1415 | 1419 | chunks.extend([node, fnode]) |
|
1416 | 1420 | |
|
1417 | 1421 | if chunks: |
|
1418 | 1422 | bundler.newpart('hgtagsfnodes', data=''.join(chunks)) |
|
1419 | 1423 | |
|
1420 | 1424 | def check_heads(repo, their_heads, context): |
|
1421 | 1425 | """check if the heads of a repo have been modified |
|
1422 | 1426 | |
|
1423 | 1427 | Used by peer for unbundling. |
|
1424 | 1428 | """ |
|
1425 | 1429 | heads = repo.heads() |
|
1426 | 1430 | heads_hash = util.sha1(''.join(sorted(heads))).digest() |
|
1427 | 1431 | if not (their_heads == ['force'] or their_heads == heads or |
|
1428 | 1432 | their_heads == ['hashed', heads_hash]): |
|
1429 | 1433 | # someone else committed/pushed/unbundled while we |
|
1430 | 1434 | # were transferring data |
|
1431 | 1435 | raise error.PushRaced('repository changed while %s - ' |
|
1432 | 1436 | 'please try again' % context) |
|
1433 | 1437 | |
|
1434 | 1438 | def unbundle(repo, cg, heads, source, url): |
|
1435 | 1439 | """Apply a bundle to a repo. |
|
1436 | 1440 | |
|
1437 | 1441 | this function makes sure the repo is locked during the application and have |
|
1438 | 1442 | mechanism to check that no push race occurred between the creation of the |
|
1439 | 1443 | bundle and its application. |
|
1440 | 1444 | |
|
1441 | 1445 | If the push was raced as PushRaced exception is raised.""" |
|
1442 | 1446 | r = 0 |
|
1443 | 1447 | # need a transaction when processing a bundle2 stream |
|
1444 | 1448 | # [wlock, lock, tr] - needs to be an array so nested functions can modify it |
|
1445 | 1449 | lockandtr = [None, None, None] |
|
1446 | 1450 | recordout = None |
|
1447 | 1451 | # quick fix for output mismatch with bundle2 in 3.4 |
|
1448 | 1452 | captureoutput = repo.ui.configbool('experimental', 'bundle2-output-capture', |
|
1449 | 1453 | False) |
|
1450 | 1454 | if url.startswith('remote:http:') or url.startswith('remote:https:'): |
|
1451 | 1455 | captureoutput = True |
|
1452 | 1456 | try: |
|
1453 | 1457 | check_heads(repo, heads, 'uploading changes') |
|
1454 | 1458 | # push can proceed |
|
1455 | 1459 | if util.safehasattr(cg, 'params'): |
|
1456 | 1460 | r = None |
|
1457 | 1461 | try: |
|
1458 | 1462 | def gettransaction(): |
|
1459 | 1463 | if not lockandtr[2]: |
|
1460 | 1464 | lockandtr[0] = repo.wlock() |
|
1461 | 1465 | lockandtr[1] = repo.lock() |
|
1462 | 1466 | lockandtr[2] = repo.transaction(source) |
|
1463 | 1467 | lockandtr[2].hookargs['source'] = source |
|
1464 | 1468 | lockandtr[2].hookargs['url'] = url |
|
1465 | 1469 | lockandtr[2].hookargs['bundle2'] = '1' |
|
1466 | 1470 | return lockandtr[2] |
|
1467 | 1471 | |
|
1468 | 1472 | # Do greedy locking by default until we're satisfied with lazy |
|
1469 | 1473 | # locking. |
|
1470 | 1474 | if not repo.ui.configbool('experimental', 'bundle2lazylocking'): |
|
1471 | 1475 | gettransaction() |
|
1472 | 1476 | |
|
1473 | 1477 | op = bundle2.bundleoperation(repo, gettransaction, |
|
1474 | 1478 | captureoutput=captureoutput) |
|
1475 | 1479 | try: |
|
1476 | 1480 | op = bundle2.processbundle(repo, cg, op=op) |
|
1477 | 1481 | finally: |
|
1478 | 1482 | r = op.reply |
|
1479 | 1483 | if captureoutput and r is not None: |
|
1480 | 1484 | repo.ui.pushbuffer(error=True, subproc=True) |
|
1481 | 1485 | def recordout(output): |
|
1482 | 1486 | r.newpart('output', data=output, mandatory=False) |
|
1483 | 1487 | if lockandtr[2] is not None: |
|
1484 | 1488 | lockandtr[2].close() |
|
1485 | 1489 | except BaseException as exc: |
|
1486 | 1490 | exc.duringunbundle2 = True |
|
1487 | 1491 | if captureoutput and r is not None: |
|
1488 | 1492 | parts = exc._bundle2salvagedoutput = r.salvageoutput() |
|
1489 | 1493 | def recordout(output): |
|
1490 | 1494 | part = bundle2.bundlepart('output', data=output, |
|
1491 | 1495 | mandatory=False) |
|
1492 | 1496 | parts.append(part) |
|
1493 | 1497 | raise |
|
1494 | 1498 | else: |
|
1495 | 1499 | lockandtr[1] = repo.lock() |
|
1496 | 1500 | r = changegroup.addchangegroup(repo, cg, source, url) |
|
1497 | 1501 | finally: |
|
1498 | 1502 | lockmod.release(lockandtr[2], lockandtr[1], lockandtr[0]) |
|
1499 | 1503 | if recordout is not None: |
|
1500 | 1504 | recordout(repo.ui.popbuffer()) |
|
1501 | 1505 | return r |
|
1506 | ||
|
1507 | def _maybeapplyclonebundle(pullop): | |
|
1508 | """Apply a clone bundle from a remote, if possible.""" | |
|
1509 | ||
|
1510 | repo = pullop.repo | |
|
1511 | remote = pullop.remote | |
|
1512 | ||
|
1513 | if not repo.ui.configbool('experimental', 'clonebundles', False): | |
|
1514 | return | |
|
1515 | ||
|
1516 | if pullop.heads: | |
|
1517 | return | |
|
1518 | ||
|
1519 | if not remote.capable('clonebundles'): | |
|
1520 | return | |
|
1521 | ||
|
1522 | res = remote._call('clonebundles') | |
|
1523 | entries = parseclonebundlesmanifest(res) | |
|
1524 | ||
|
1525 | # TODO filter entries by supported features. | |
|
1526 | # TODO sort entries by user preferences. | |
|
1527 | ||
|
1528 | if not entries: | |
|
1529 | repo.ui.note(_('no clone bundles available on remote; ' | |
|
1530 | 'falling back to regular clone\n')) | |
|
1531 | return | |
|
1532 | ||
|
1533 | url = entries[0]['URL'] | |
|
1534 | repo.ui.status(_('applying clone bundle from %s\n') % url) | |
|
1535 | if trypullbundlefromurl(repo.ui, repo, url): | |
|
1536 | repo.ui.status(_('finished applying clone bundle\n')) | |
|
1537 | # Bundle failed. | |
|
1538 | # | |
|
1539 | # We abort by default to avoid the thundering herd of | |
|
1540 | # clients flooding a server that was expecting expensive | |
|
1541 | # clone load to be offloaded. | |
|
1542 | elif repo.ui.configbool('ui', 'clonebundlefallback', False): | |
|
1543 | repo.ui.warn(_('falling back to normal clone\n')) | |
|
1544 | else: | |
|
1545 | raise error.Abort(_('error applying bundle'), | |
|
1546 | hint=_('consider contacting the server ' | |
|
1547 | 'operator if this error persists')) | |
|
1548 | ||
|
1549 | def parseclonebundlesmanifest(s): | |
|
1550 | """Parses the raw text of a clone bundles manifest. | |
|
1551 | ||
|
1552 | Returns a list of dicts. The dicts have a ``URL`` key corresponding | |
|
1553 | to the URL and other keys are the attributes for the entry. | |
|
1554 | """ | |
|
1555 | m = [] | |
|
1556 | for line in s.splitlines(): | |
|
1557 | fields = line.split() | |
|
1558 | if not fields: | |
|
1559 | continue | |
|
1560 | attrs = {'URL': fields[0]} | |
|
1561 | for rawattr in fields[1:]: | |
|
1562 | key, value = rawattr.split('=', 1) | |
|
1563 | attrs[urllib.unquote(key)] = urllib.unquote(value) | |
|
1564 | ||
|
1565 | m.append(attrs) | |
|
1566 | ||
|
1567 | return m | |
|
1568 | ||
|
1569 | def trypullbundlefromurl(ui, repo, url): | |
|
1570 | """Attempt to apply a bundle from a URL.""" | |
|
1571 | lock = repo.lock() | |
|
1572 | try: | |
|
1573 | tr = repo.transaction('bundleurl') | |
|
1574 | try: | |
|
1575 | try: | |
|
1576 | fh = urlmod.open(ui, url) | |
|
1577 | cg = readbundle(ui, fh, 'stream') | |
|
1578 | changegroup.addchangegroup(repo, cg, 'clonebundles', url) | |
|
1579 | tr.close() | |
|
1580 | return True | |
|
1581 | except urllib2.HTTPError as e: | |
|
1582 | ui.warn(_('HTTP error fetching bundle: %s\n') % str(e)) | |
|
1583 | except urllib2.URLError as e: | |
|
1584 | ui.warn(_('error fetching bundle: %s\n') % e.reason) | |
|
1585 | ||
|
1586 | return False | |
|
1587 | finally: | |
|
1588 | tr.release() | |
|
1589 | finally: | |
|
1590 | lock.release() |
@@ -1,1850 +1,1865 | |||
|
1 | 1 | The Mercurial system uses a set of configuration files to control |
|
2 | 2 | aspects of its behavior. |
|
3 | 3 | |
|
4 | 4 | Troubleshooting |
|
5 | 5 | =============== |
|
6 | 6 | |
|
7 | 7 | If you're having problems with your configuration, |
|
8 | 8 | :hg:`config --debug` can help you understand what is introducing |
|
9 | 9 | a setting into your environment. |
|
10 | 10 | |
|
11 | 11 | See :hg:`help config.syntax` and :hg:`help config.files` |
|
12 | 12 | for information about how and where to override things. |
|
13 | 13 | |
|
14 | 14 | Format |
|
15 | 15 | ====== |
|
16 | 16 | |
|
17 | 17 | The configuration files use a simple ini-file format. A configuration |
|
18 | 18 | file consists of sections, led by a ``[section]`` header and followed |
|
19 | 19 | by ``name = value`` entries:: |
|
20 | 20 | |
|
21 | 21 | [ui] |
|
22 | 22 | username = Firstname Lastname <firstname.lastname@example.net> |
|
23 | 23 | verbose = True |
|
24 | 24 | |
|
25 | 25 | The above entries will be referred to as ``ui.username`` and |
|
26 | 26 | ``ui.verbose``, respectively. See :hg:`help config.syntax`. |
|
27 | 27 | |
|
28 | 28 | Files |
|
29 | 29 | ===== |
|
30 | 30 | |
|
31 | 31 | Mercurial reads configuration data from several files, if they exist. |
|
32 | 32 | These files do not exist by default and you will have to create the |
|
33 | 33 | appropriate configuration files yourself: global configuration like |
|
34 | 34 | the username setting is typically put into |
|
35 | 35 | ``%USERPROFILE%\mercurial.ini`` or ``$HOME/.hgrc`` and local |
|
36 | 36 | configuration is put into the per-repository ``<repo>/.hg/hgrc`` file. |
|
37 | 37 | |
|
38 | 38 | The names of these files depend on the system on which Mercurial is |
|
39 | 39 | installed. ``*.rc`` files from a single directory are read in |
|
40 | 40 | alphabetical order, later ones overriding earlier ones. Where multiple |
|
41 | 41 | paths are given below, settings from earlier paths override later |
|
42 | 42 | ones. |
|
43 | 43 | |
|
44 | 44 | .. container:: verbose.unix |
|
45 | 45 | |
|
46 | 46 | On Unix, the following files are consulted: |
|
47 | 47 | |
|
48 | 48 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
49 | 49 | - ``$HOME/.hgrc`` (per-user) |
|
50 | 50 | - ``<install-root>/etc/mercurial/hgrc`` (per-installation) |
|
51 | 51 | - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation) |
|
52 | 52 | - ``/etc/mercurial/hgrc`` (per-system) |
|
53 | 53 | - ``/etc/mercurial/hgrc.d/*.rc`` (per-system) |
|
54 | 54 | - ``<internal>/default.d/*.rc`` (defaults) |
|
55 | 55 | |
|
56 | 56 | .. container:: verbose.windows |
|
57 | 57 | |
|
58 | 58 | On Windows, the following files are consulted: |
|
59 | 59 | |
|
60 | 60 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
61 | 61 | - ``%USERPROFILE%\.hgrc`` (per-user) |
|
62 | 62 | - ``%USERPROFILE%\Mercurial.ini`` (per-user) |
|
63 | 63 | - ``%HOME%\.hgrc`` (per-user) |
|
64 | 64 | - ``%HOME%\Mercurial.ini`` (per-user) |
|
65 | 65 | - ``<install-dir>\Mercurial.ini`` (per-installation) |
|
66 | 66 | - ``<install-dir>\hgrc.d\*.rc`` (per-installation) |
|
67 | 67 | - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation) |
|
68 | 68 | - ``<internal>/default.d/*.rc`` (defaults) |
|
69 | 69 | |
|
70 | 70 | .. note:: |
|
71 | 71 | |
|
72 | 72 | The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` |
|
73 | 73 | is used when running 32-bit Python on 64-bit Windows. |
|
74 | 74 | |
|
75 | 75 | .. container:: verbose.plan9 |
|
76 | 76 | |
|
77 | 77 | On Plan9, the following files are consulted: |
|
78 | 78 | |
|
79 | 79 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
80 | 80 | - ``$home/lib/hgrc`` (per-user) |
|
81 | 81 | - ``<install-root>/lib/mercurial/hgrc`` (per-installation) |
|
82 | 82 | - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation) |
|
83 | 83 | - ``/lib/mercurial/hgrc`` (per-system) |
|
84 | 84 | - ``/lib/mercurial/hgrc.d/*.rc`` (per-system) |
|
85 | 85 | - ``<internal>/default.d/*.rc`` (defaults) |
|
86 | 86 | |
|
87 | 87 | Per-repository configuration options only apply in a |
|
88 | 88 | particular repository. This file is not version-controlled, and |
|
89 | 89 | will not get transferred during a "clone" operation. Options in |
|
90 | 90 | this file override options in all other configuration files. On |
|
91 | 91 | Plan 9 and Unix, most of this file will be ignored if it doesn't |
|
92 | 92 | belong to a trusted user or to a trusted group. See |
|
93 | 93 | :hg:`help config.trusted` for more details. |
|
94 | 94 | |
|
95 | 95 | Per-user configuration file(s) are for the user running Mercurial. On |
|
96 | 96 | Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these |
|
97 | 97 | files apply to all Mercurial commands executed by this user in any |
|
98 | 98 | directory. Options in these files override per-system and per-installation |
|
99 | 99 | options. |
|
100 | 100 | |
|
101 | 101 | Per-installation configuration files are searched for in the |
|
102 | 102 | directory where Mercurial is installed. ``<install-root>`` is the |
|
103 | 103 | parent directory of the **hg** executable (or symlink) being run. For |
|
104 | 104 | example, if installed in ``/shared/tools/bin/hg``, Mercurial will look |
|
105 | 105 | in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply |
|
106 | 106 | to all Mercurial commands executed by any user in any directory. |
|
107 | 107 | |
|
108 | 108 | Per-installation configuration files are for the system on |
|
109 | 109 | which Mercurial is running. Options in these files apply to all |
|
110 | 110 | Mercurial commands executed by any user in any directory. Registry |
|
111 | 111 | keys contain PATH-like strings, every part of which must reference |
|
112 | 112 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
|
113 | 113 | be read. Mercurial checks each of these locations in the specified |
|
114 | 114 | order until one or more configuration files are detected. |
|
115 | 115 | |
|
116 | 116 | Per-system configuration files are for the system on which Mercurial |
|
117 | 117 | is running. Options in these files apply to all Mercurial commands |
|
118 | 118 | executed by any user in any directory. Options in these files |
|
119 | 119 | override per-installation options. |
|
120 | 120 | |
|
121 | 121 | Mercurial comes with some default configuration. The default configuration |
|
122 | 122 | files are installed with Mercurial and will be overwritten on upgrades. Default |
|
123 | 123 | configuration files should never be edited by users or administrators but can |
|
124 | 124 | be overridden in other configuration files. So far the directory only contains |
|
125 | 125 | merge tool configuration but packagers can also put other default configuration |
|
126 | 126 | there. |
|
127 | 127 | |
|
128 | 128 | Syntax |
|
129 | 129 | ====== |
|
130 | 130 | |
|
131 | 131 | A configuration file consists of sections, led by a ``[section]`` header |
|
132 | 132 | and followed by ``name = value`` entries (sometimes called |
|
133 | 133 | ``configuration keys``):: |
|
134 | 134 | |
|
135 | 135 | [spam] |
|
136 | 136 | eggs=ham |
|
137 | 137 | green= |
|
138 | 138 | eggs |
|
139 | 139 | |
|
140 | 140 | Each line contains one entry. If the lines that follow are indented, |
|
141 | 141 | they are treated as continuations of that entry. Leading whitespace is |
|
142 | 142 | removed from values. Empty lines are skipped. Lines beginning with |
|
143 | 143 | ``#`` or ``;`` are ignored and may be used to provide comments. |
|
144 | 144 | |
|
145 | 145 | Configuration keys can be set multiple times, in which case Mercurial |
|
146 | 146 | will use the value that was configured last. As an example:: |
|
147 | 147 | |
|
148 | 148 | [spam] |
|
149 | 149 | eggs=large |
|
150 | 150 | ham=serrano |
|
151 | 151 | eggs=small |
|
152 | 152 | |
|
153 | 153 | This would set the configuration key named ``eggs`` to ``small``. |
|
154 | 154 | |
|
155 | 155 | It is also possible to define a section multiple times. A section can |
|
156 | 156 | be redefined on the same and/or on different configuration files. For |
|
157 | 157 | example:: |
|
158 | 158 | |
|
159 | 159 | [foo] |
|
160 | 160 | eggs=large |
|
161 | 161 | ham=serrano |
|
162 | 162 | eggs=small |
|
163 | 163 | |
|
164 | 164 | [bar] |
|
165 | 165 | eggs=ham |
|
166 | 166 | green= |
|
167 | 167 | eggs |
|
168 | 168 | |
|
169 | 169 | [foo] |
|
170 | 170 | ham=prosciutto |
|
171 | 171 | eggs=medium |
|
172 | 172 | bread=toasted |
|
173 | 173 | |
|
174 | 174 | This would set the ``eggs``, ``ham``, and ``bread`` configuration keys |
|
175 | 175 | of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``, |
|
176 | 176 | respectively. As you can see there only thing that matters is the last |
|
177 | 177 | value that was set for each of the configuration keys. |
|
178 | 178 | |
|
179 | 179 | If a configuration key is set multiple times in different |
|
180 | 180 | configuration files the final value will depend on the order in which |
|
181 | 181 | the different configuration files are read, with settings from earlier |
|
182 | 182 | paths overriding later ones as described on the ``Files`` section |
|
183 | 183 | above. |
|
184 | 184 | |
|
185 | 185 | A line of the form ``%include file`` will include ``file`` into the |
|
186 | 186 | current configuration file. The inclusion is recursive, which means |
|
187 | 187 | that included files can include other files. Filenames are relative to |
|
188 | 188 | the configuration file in which the ``%include`` directive is found. |
|
189 | 189 | Environment variables and ``~user`` constructs are expanded in |
|
190 | 190 | ``file``. This lets you do something like:: |
|
191 | 191 | |
|
192 | 192 | %include ~/.hgrc.d/$HOST.rc |
|
193 | 193 | |
|
194 | 194 | to include a different configuration file on each computer you use. |
|
195 | 195 | |
|
196 | 196 | A line with ``%unset name`` will remove ``name`` from the current |
|
197 | 197 | section, if it has been set previously. |
|
198 | 198 | |
|
199 | 199 | The values are either free-form text strings, lists of text strings, |
|
200 | 200 | or Boolean values. Boolean values can be set to true using any of "1", |
|
201 | 201 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" |
|
202 | 202 | (all case insensitive). |
|
203 | 203 | |
|
204 | 204 | List values are separated by whitespace or comma, except when values are |
|
205 | 205 | placed in double quotation marks:: |
|
206 | 206 | |
|
207 | 207 | allow_read = "John Doe, PhD", brian, betty |
|
208 | 208 | |
|
209 | 209 | Quotation marks can be escaped by prefixing them with a backslash. Only |
|
210 | 210 | quotation marks at the beginning of a word is counted as a quotation |
|
211 | 211 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). |
|
212 | 212 | |
|
213 | 213 | Sections |
|
214 | 214 | ======== |
|
215 | 215 | |
|
216 | 216 | This section describes the different sections that may appear in a |
|
217 | 217 | Mercurial configuration file, the purpose of each section, its possible |
|
218 | 218 | keys, and their possible values. |
|
219 | 219 | |
|
220 | 220 | ``alias`` |
|
221 | 221 | --------- |
|
222 | 222 | |
|
223 | 223 | Defines command aliases. |
|
224 | 224 | |
|
225 | 225 | Aliases allow you to define your own commands in terms of other |
|
226 | 226 | commands (or aliases), optionally including arguments. Positional |
|
227 | 227 | arguments in the form of ``$1``, ``$2``, etc. in the alias definition |
|
228 | 228 | are expanded by Mercurial before execution. Positional arguments not |
|
229 | 229 | already used by ``$N`` in the definition are put at the end of the |
|
230 | 230 | command to be executed. |
|
231 | 231 | |
|
232 | 232 | Alias definitions consist of lines of the form:: |
|
233 | 233 | |
|
234 | 234 | <alias> = <command> [<argument>]... |
|
235 | 235 | |
|
236 | 236 | For example, this definition:: |
|
237 | 237 | |
|
238 | 238 | latest = log --limit 5 |
|
239 | 239 | |
|
240 | 240 | creates a new command ``latest`` that shows only the five most recent |
|
241 | 241 | changesets. You can define subsequent aliases using earlier ones:: |
|
242 | 242 | |
|
243 | 243 | stable5 = latest -b stable |
|
244 | 244 | |
|
245 | 245 | .. note:: |
|
246 | 246 | |
|
247 | 247 | It is possible to create aliases with the same names as |
|
248 | 248 | existing commands, which will then override the original |
|
249 | 249 | definitions. This is almost always a bad idea! |
|
250 | 250 | |
|
251 | 251 | An alias can start with an exclamation point (``!``) to make it a |
|
252 | 252 | shell alias. A shell alias is executed with the shell and will let you |
|
253 | 253 | run arbitrary commands. As an example, :: |
|
254 | 254 | |
|
255 | 255 | echo = !echo $@ |
|
256 | 256 | |
|
257 | 257 | will let you do ``hg echo foo`` to have ``foo`` printed in your |
|
258 | 258 | terminal. A better example might be:: |
|
259 | 259 | |
|
260 | 260 | purge = !$HG status --no-status --unknown -0 | xargs -0 rm |
|
261 | 261 | |
|
262 | 262 | which will make ``hg purge`` delete all unknown files in the |
|
263 | 263 | repository in the same manner as the purge extension. |
|
264 | 264 | |
|
265 | 265 | Positional arguments like ``$1``, ``$2``, etc. in the alias definition |
|
266 | 266 | expand to the command arguments. Unmatched arguments are |
|
267 | 267 | removed. ``$0`` expands to the alias name and ``$@`` expands to all |
|
268 | 268 | arguments separated by a space. ``"$@"`` (with quotes) expands to all |
|
269 | 269 | arguments quoted individually and separated by a space. These expansions |
|
270 | 270 | happen before the command is passed to the shell. |
|
271 | 271 | |
|
272 | 272 | Shell aliases are executed in an environment where ``$HG`` expands to |
|
273 | 273 | the path of the Mercurial that was used to execute the alias. This is |
|
274 | 274 | useful when you want to call further Mercurial commands in a shell |
|
275 | 275 | alias, as was done above for the purge alias. In addition, |
|
276 | 276 | ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg |
|
277 | 277 | echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. |
|
278 | 278 | |
|
279 | 279 | .. note:: |
|
280 | 280 | |
|
281 | 281 | Some global configuration options such as ``-R`` are |
|
282 | 282 | processed before shell aliases and will thus not be passed to |
|
283 | 283 | aliases. |
|
284 | 284 | |
|
285 | 285 | |
|
286 | 286 | ``annotate`` |
|
287 | 287 | ------------ |
|
288 | 288 | |
|
289 | 289 | Settings used when displaying file annotations. All values are |
|
290 | 290 | Booleans and default to False. See :hg:`help config.diff` for |
|
291 | 291 | related options for the diff command. |
|
292 | 292 | |
|
293 | 293 | ``ignorews`` |
|
294 | 294 | Ignore white space when comparing lines. |
|
295 | 295 | |
|
296 | 296 | ``ignorewsamount`` |
|
297 | 297 | Ignore changes in the amount of white space. |
|
298 | 298 | |
|
299 | 299 | ``ignoreblanklines`` |
|
300 | 300 | Ignore changes whose lines are all blank. |
|
301 | 301 | |
|
302 | 302 | |
|
303 | 303 | ``auth`` |
|
304 | 304 | -------- |
|
305 | 305 | |
|
306 | 306 | Authentication credentials for HTTP authentication. This section |
|
307 | 307 | allows you to store usernames and passwords for use when logging |
|
308 | 308 | *into* HTTP servers. See :hg:`help config.web` if |
|
309 | 309 | you want to configure *who* can login to your HTTP server. |
|
310 | 310 | |
|
311 | 311 | Each line has the following format:: |
|
312 | 312 | |
|
313 | 313 | <name>.<argument> = <value> |
|
314 | 314 | |
|
315 | 315 | where ``<name>`` is used to group arguments into authentication |
|
316 | 316 | entries. Example:: |
|
317 | 317 | |
|
318 | 318 | foo.prefix = hg.intevation.org/mercurial |
|
319 | 319 | foo.username = foo |
|
320 | 320 | foo.password = bar |
|
321 | 321 | foo.schemes = http https |
|
322 | 322 | |
|
323 | 323 | bar.prefix = secure.example.org |
|
324 | 324 | bar.key = path/to/file.key |
|
325 | 325 | bar.cert = path/to/file.cert |
|
326 | 326 | bar.schemes = https |
|
327 | 327 | |
|
328 | 328 | Supported arguments: |
|
329 | 329 | |
|
330 | 330 | ``prefix`` |
|
331 | 331 | Either ``*`` or a URI prefix with or without the scheme part. |
|
332 | 332 | The authentication entry with the longest matching prefix is used |
|
333 | 333 | (where ``*`` matches everything and counts as a match of length |
|
334 | 334 | 1). If the prefix doesn't include a scheme, the match is performed |
|
335 | 335 | against the URI with its scheme stripped as well, and the schemes |
|
336 | 336 | argument, q.v., is then subsequently consulted. |
|
337 | 337 | |
|
338 | 338 | ``username`` |
|
339 | 339 | Optional. Username to authenticate with. If not given, and the |
|
340 | 340 | remote site requires basic or digest authentication, the user will |
|
341 | 341 | be prompted for it. Environment variables are expanded in the |
|
342 | 342 | username letting you do ``foo.username = $USER``. If the URI |
|
343 | 343 | includes a username, only ``[auth]`` entries with a matching |
|
344 | 344 | username or without a username will be considered. |
|
345 | 345 | |
|
346 | 346 | ``password`` |
|
347 | 347 | Optional. Password to authenticate with. If not given, and the |
|
348 | 348 | remote site requires basic or digest authentication, the user |
|
349 | 349 | will be prompted for it. |
|
350 | 350 | |
|
351 | 351 | ``key`` |
|
352 | 352 | Optional. PEM encoded client certificate key file. Environment |
|
353 | 353 | variables are expanded in the filename. |
|
354 | 354 | |
|
355 | 355 | ``cert`` |
|
356 | 356 | Optional. PEM encoded client certificate chain file. Environment |
|
357 | 357 | variables are expanded in the filename. |
|
358 | 358 | |
|
359 | 359 | ``schemes`` |
|
360 | 360 | Optional. Space separated list of URI schemes to use this |
|
361 | 361 | authentication entry with. Only used if the prefix doesn't include |
|
362 | 362 | a scheme. Supported schemes are http and https. They will match |
|
363 | 363 | static-http and static-https respectively, as well. |
|
364 | 364 | (default: https) |
|
365 | 365 | |
|
366 | 366 | If no suitable authentication entry is found, the user is prompted |
|
367 | 367 | for credentials as usual if required by the remote. |
|
368 | 368 | |
|
369 | 369 | |
|
370 | 370 | ``committemplate`` |
|
371 | 371 | ------------------ |
|
372 | 372 | |
|
373 | 373 | ``changeset`` |
|
374 | 374 | String: configuration in this section is used as the template to |
|
375 | 375 | customize the text shown in the editor when committing. |
|
376 | 376 | |
|
377 | 377 | In addition to pre-defined template keywords, commit log specific one |
|
378 | 378 | below can be used for customization: |
|
379 | 379 | |
|
380 | 380 | ``extramsg`` |
|
381 | 381 | String: Extra message (typically 'Leave message empty to abort |
|
382 | 382 | commit.'). This may be changed by some commands or extensions. |
|
383 | 383 | |
|
384 | 384 | For example, the template configuration below shows as same text as |
|
385 | 385 | one shown by default:: |
|
386 | 386 | |
|
387 | 387 | [committemplate] |
|
388 | 388 | changeset = {desc}\n\n |
|
389 | 389 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
390 | 390 | HG: {extramsg} |
|
391 | 391 | HG: -- |
|
392 | 392 | HG: user: {author}\n{ifeq(p2rev, "-1", "", |
|
393 | 393 | "HG: branch merge\n") |
|
394 | 394 | }HG: branch '{branch}'\n{if(activebookmark, |
|
395 | 395 | "HG: bookmark '{activebookmark}'\n") }{subrepos % |
|
396 | 396 | "HG: subrepo {subrepo}\n" }{file_adds % |
|
397 | 397 | "HG: added {file}\n" }{file_mods % |
|
398 | 398 | "HG: changed {file}\n" }{file_dels % |
|
399 | 399 | "HG: removed {file}\n" }{if(files, "", |
|
400 | 400 | "HG: no files changed\n")} |
|
401 | 401 | |
|
402 | 402 | .. note:: |
|
403 | 403 | |
|
404 | 404 | For some problematic encodings (see :hg:`help win32mbcs` for |
|
405 | 405 | detail), this customization should be configured carefully, to |
|
406 | 406 | avoid showing broken characters. |
|
407 | 407 | |
|
408 | 408 | For example, if a multibyte character ending with backslash (0x5c) is |
|
409 | 409 | followed by the ASCII character 'n' in the customized template, |
|
410 | 410 | the sequence of backslash and 'n' is treated as line-feed unexpectedly |
|
411 | 411 | (and the multibyte character is broken, too). |
|
412 | 412 | |
|
413 | 413 | Customized template is used for commands below (``--edit`` may be |
|
414 | 414 | required): |
|
415 | 415 | |
|
416 | 416 | - :hg:`backout` |
|
417 | 417 | - :hg:`commit` |
|
418 | 418 | - :hg:`fetch` (for merge commit only) |
|
419 | 419 | - :hg:`graft` |
|
420 | 420 | - :hg:`histedit` |
|
421 | 421 | - :hg:`import` |
|
422 | 422 | - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh` |
|
423 | 423 | - :hg:`rebase` |
|
424 | 424 | - :hg:`shelve` |
|
425 | 425 | - :hg:`sign` |
|
426 | 426 | - :hg:`tag` |
|
427 | 427 | - :hg:`transplant` |
|
428 | 428 | |
|
429 | 429 | Configuring items below instead of ``changeset`` allows showing |
|
430 | 430 | customized message only for specific actions, or showing different |
|
431 | 431 | messages for each action. |
|
432 | 432 | |
|
433 | 433 | - ``changeset.backout`` for :hg:`backout` |
|
434 | 434 | - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges |
|
435 | 435 | - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other |
|
436 | 436 | - ``changeset.commit.normal.merge`` for :hg:`commit` on merges |
|
437 | 437 | - ``changeset.commit.normal.normal`` for :hg:`commit` on other |
|
438 | 438 | - ``changeset.fetch`` for :hg:`fetch` (impling merge commit) |
|
439 | 439 | - ``changeset.gpg.sign`` for :hg:`sign` |
|
440 | 440 | - ``changeset.graft`` for :hg:`graft` |
|
441 | 441 | - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit` |
|
442 | 442 | - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit` |
|
443 | 443 | - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit` |
|
444 | 444 | - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit` |
|
445 | 445 | - ``changeset.import.bypass`` for :hg:`import --bypass` |
|
446 | 446 | - ``changeset.import.normal.merge`` for :hg:`import` on merges |
|
447 | 447 | - ``changeset.import.normal.normal`` for :hg:`import` on other |
|
448 | 448 | - ``changeset.mq.qnew`` for :hg:`qnew` |
|
449 | 449 | - ``changeset.mq.qfold`` for :hg:`qfold` |
|
450 | 450 | - ``changeset.mq.qrefresh`` for :hg:`qrefresh` |
|
451 | 451 | - ``changeset.rebase.collapse`` for :hg:`rebase --collapse` |
|
452 | 452 | - ``changeset.rebase.merge`` for :hg:`rebase` on merges |
|
453 | 453 | - ``changeset.rebase.normal`` for :hg:`rebase` on other |
|
454 | 454 | - ``changeset.shelve.shelve`` for :hg:`shelve` |
|
455 | 455 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` |
|
456 | 456 | - ``changeset.tag.remove`` for :hg:`tag --remove` |
|
457 | 457 | - ``changeset.transplant.merge`` for :hg:`transplant` on merges |
|
458 | 458 | - ``changeset.transplant.normal`` for :hg:`transplant` on other |
|
459 | 459 | |
|
460 | 460 | These dot-separated lists of names are treated as hierarchical ones. |
|
461 | 461 | For example, ``changeset.tag.remove`` customizes the commit message |
|
462 | 462 | only for :hg:`tag --remove`, but ``changeset.tag`` customizes the |
|
463 | 463 | commit message for :hg:`tag` regardless of ``--remove`` option. |
|
464 | 464 | |
|
465 | 465 | When the external editor is invoked for a commit, the corresponding |
|
466 | 466 | dot-separated list of names without the ``changeset.`` prefix |
|
467 | 467 | (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment |
|
468 | 468 | variable. |
|
469 | 469 | |
|
470 | 470 | In this section, items other than ``changeset`` can be referred from |
|
471 | 471 | others. For example, the configuration to list committed files up |
|
472 | 472 | below can be referred as ``{listupfiles}``:: |
|
473 | 473 | |
|
474 | 474 | [committemplate] |
|
475 | 475 | listupfiles = {file_adds % |
|
476 | 476 | "HG: added {file}\n" }{file_mods % |
|
477 | 477 | "HG: changed {file}\n" }{file_dels % |
|
478 | 478 | "HG: removed {file}\n" }{if(files, "", |
|
479 | 479 | "HG: no files changed\n")} |
|
480 | 480 | |
|
481 | 481 | ``decode/encode`` |
|
482 | 482 | ----------------- |
|
483 | 483 | |
|
484 | 484 | Filters for transforming files on checkout/checkin. This would |
|
485 | 485 | typically be used for newline processing or other |
|
486 | 486 | localization/canonicalization of files. |
|
487 | 487 | |
|
488 | 488 | Filters consist of a filter pattern followed by a filter command. |
|
489 | 489 | Filter patterns are globs by default, rooted at the repository root. |
|
490 | 490 | For example, to match any file ending in ``.txt`` in the root |
|
491 | 491 | directory only, use the pattern ``*.txt``. To match any file ending |
|
492 | 492 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. |
|
493 | 493 | For each file only the first matching filter applies. |
|
494 | 494 | |
|
495 | 495 | The filter command can start with a specifier, either ``pipe:`` or |
|
496 | 496 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. |
|
497 | 497 | |
|
498 | 498 | A ``pipe:`` command must accept data on stdin and return the transformed |
|
499 | 499 | data on stdout. |
|
500 | 500 | |
|
501 | 501 | Pipe example:: |
|
502 | 502 | |
|
503 | 503 | [encode] |
|
504 | 504 | # uncompress gzip files on checkin to improve delta compression |
|
505 | 505 | # note: not necessarily a good idea, just an example |
|
506 | 506 | *.gz = pipe: gunzip |
|
507 | 507 | |
|
508 | 508 | [decode] |
|
509 | 509 | # recompress gzip files when writing them to the working dir (we |
|
510 | 510 | # can safely omit "pipe:", because it's the default) |
|
511 | 511 | *.gz = gzip |
|
512 | 512 | |
|
513 | 513 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced |
|
514 | 514 | with the name of a temporary file that contains the data to be |
|
515 | 515 | filtered by the command. The string ``OUTFILE`` is replaced with the name |
|
516 | 516 | of an empty temporary file, where the filtered data must be written by |
|
517 | 517 | the command. |
|
518 | 518 | |
|
519 | 519 | .. note:: |
|
520 | 520 | |
|
521 | 521 | The tempfile mechanism is recommended for Windows systems, |
|
522 | 522 | where the standard shell I/O redirection operators often have |
|
523 | 523 | strange effects and may corrupt the contents of your files. |
|
524 | 524 | |
|
525 | 525 | This filter mechanism is used internally by the ``eol`` extension to |
|
526 | 526 | translate line ending characters between Windows (CRLF) and Unix (LF) |
|
527 | 527 | format. We suggest you use the ``eol`` extension for convenience. |
|
528 | 528 | |
|
529 | 529 | |
|
530 | 530 | ``defaults`` |
|
531 | 531 | ------------ |
|
532 | 532 | |
|
533 | 533 | (defaults are deprecated. Don't use them. Use aliases instead.) |
|
534 | 534 | |
|
535 | 535 | Use the ``[defaults]`` section to define command defaults, i.e. the |
|
536 | 536 | default options/arguments to pass to the specified commands. |
|
537 | 537 | |
|
538 | 538 | The following example makes :hg:`log` run in verbose mode, and |
|
539 | 539 | :hg:`status` show only the modified files, by default:: |
|
540 | 540 | |
|
541 | 541 | [defaults] |
|
542 | 542 | log = -v |
|
543 | 543 | status = -m |
|
544 | 544 | |
|
545 | 545 | The actual commands, instead of their aliases, must be used when |
|
546 | 546 | defining command defaults. The command defaults will also be applied |
|
547 | 547 | to the aliases of the commands defined. |
|
548 | 548 | |
|
549 | 549 | |
|
550 | 550 | ``diff`` |
|
551 | 551 | -------- |
|
552 | 552 | |
|
553 | 553 | Settings used when displaying diffs. Everything except for ``unified`` |
|
554 | 554 | is a Boolean and defaults to False. See :hg:`help config.annotate` |
|
555 | 555 | for related options for the annotate command. |
|
556 | 556 | |
|
557 | 557 | ``git`` |
|
558 | 558 | Use git extended diff format. |
|
559 | 559 | |
|
560 | 560 | ``nobinary`` |
|
561 | 561 | Omit git binary patches. |
|
562 | 562 | |
|
563 | 563 | ``nodates`` |
|
564 | 564 | Don't include dates in diff headers. |
|
565 | 565 | |
|
566 | 566 | ``noprefix`` |
|
567 | 567 | Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode. |
|
568 | 568 | |
|
569 | 569 | ``showfunc`` |
|
570 | 570 | Show which function each change is in. |
|
571 | 571 | |
|
572 | 572 | ``ignorews`` |
|
573 | 573 | Ignore white space when comparing lines. |
|
574 | 574 | |
|
575 | 575 | ``ignorewsamount`` |
|
576 | 576 | Ignore changes in the amount of white space. |
|
577 | 577 | |
|
578 | 578 | ``ignoreblanklines`` |
|
579 | 579 | Ignore changes whose lines are all blank. |
|
580 | 580 | |
|
581 | 581 | ``unified`` |
|
582 | 582 | Number of lines of context to show. |
|
583 | 583 | |
|
584 | 584 | ``email`` |
|
585 | 585 | --------- |
|
586 | 586 | |
|
587 | 587 | Settings for extensions that send email messages. |
|
588 | 588 | |
|
589 | 589 | ``from`` |
|
590 | 590 | Optional. Email address to use in "From" header and SMTP envelope |
|
591 | 591 | of outgoing messages. |
|
592 | 592 | |
|
593 | 593 | ``to`` |
|
594 | 594 | Optional. Comma-separated list of recipients' email addresses. |
|
595 | 595 | |
|
596 | 596 | ``cc`` |
|
597 | 597 | Optional. Comma-separated list of carbon copy recipients' |
|
598 | 598 | email addresses. |
|
599 | 599 | |
|
600 | 600 | ``bcc`` |
|
601 | 601 | Optional. Comma-separated list of blind carbon copy recipients' |
|
602 | 602 | email addresses. |
|
603 | 603 | |
|
604 | 604 | ``method`` |
|
605 | 605 | Optional. Method to use to send email messages. If value is ``smtp`` |
|
606 | 606 | (default), use SMTP (see the ``[smtp]`` section for configuration). |
|
607 | 607 | Otherwise, use as name of program to run that acts like sendmail |
|
608 | 608 | (takes ``-f`` option for sender, list of recipients on command line, |
|
609 | 609 | message on stdin). Normally, setting this to ``sendmail`` or |
|
610 | 610 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. |
|
611 | 611 | |
|
612 | 612 | ``charsets`` |
|
613 | 613 | Optional. Comma-separated list of character sets considered |
|
614 | 614 | convenient for recipients. Addresses, headers, and parts not |
|
615 | 615 | containing patches of outgoing messages will be encoded in the |
|
616 | 616 | first character set to which conversion from local encoding |
|
617 | 617 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct |
|
618 | 618 | conversion fails, the text in question is sent as is. |
|
619 | 619 | (default: '') |
|
620 | 620 | |
|
621 | 621 | Order of outgoing email character sets: |
|
622 | 622 | |
|
623 | 623 | 1. ``us-ascii``: always first, regardless of settings |
|
624 | 624 | 2. ``email.charsets``: in order given by user |
|
625 | 625 | 3. ``ui.fallbackencoding``: if not in email.charsets |
|
626 | 626 | 4. ``$HGENCODING``: if not in email.charsets |
|
627 | 627 | 5. ``utf-8``: always last, regardless of settings |
|
628 | 628 | |
|
629 | 629 | Email example:: |
|
630 | 630 | |
|
631 | 631 | [email] |
|
632 | 632 | from = Joseph User <joe.user@example.com> |
|
633 | 633 | method = /usr/sbin/sendmail |
|
634 | 634 | # charsets for western Europeans |
|
635 | 635 | # us-ascii, utf-8 omitted, as they are tried first and last |
|
636 | 636 | charsets = iso-8859-1, iso-8859-15, windows-1252 |
|
637 | 637 | |
|
638 | 638 | |
|
639 | 639 | ``extensions`` |
|
640 | 640 | -------------- |
|
641 | 641 | |
|
642 | 642 | Mercurial has an extension mechanism for adding new features. To |
|
643 | 643 | enable an extension, create an entry for it in this section. |
|
644 | 644 | |
|
645 | 645 | If you know that the extension is already in Python's search path, |
|
646 | 646 | you can give the name of the module, followed by ``=``, with nothing |
|
647 | 647 | after the ``=``. |
|
648 | 648 | |
|
649 | 649 | Otherwise, give a name that you choose, followed by ``=``, followed by |
|
650 | 650 | the path to the ``.py`` file (including the file name extension) that |
|
651 | 651 | defines the extension. |
|
652 | 652 | |
|
653 | 653 | To explicitly disable an extension that is enabled in an hgrc of |
|
654 | 654 | broader scope, prepend its path with ``!``, as in ``foo = !/ext/path`` |
|
655 | 655 | or ``foo = !`` when path is not supplied. |
|
656 | 656 | |
|
657 | 657 | Example for ``~/.hgrc``:: |
|
658 | 658 | |
|
659 | 659 | [extensions] |
|
660 | 660 | # (the color extension will get loaded from Mercurial's path) |
|
661 | 661 | color = |
|
662 | 662 | # (this extension will get loaded from the file specified) |
|
663 | 663 | myfeature = ~/.hgext/myfeature.py |
|
664 | 664 | |
|
665 | 665 | |
|
666 | 666 | ``format`` |
|
667 | 667 | ---------- |
|
668 | 668 | |
|
669 | 669 | ``usestore`` |
|
670 | 670 | Enable or disable the "store" repository format which improves |
|
671 | 671 | compatibility with systems that fold case or otherwise mangle |
|
672 | 672 | filenames. Enabled by default. Disabling this option will allow |
|
673 | 673 | you to store longer filenames in some situations at the expense of |
|
674 | 674 | compatibility and ensures that the on-disk format of newly created |
|
675 | 675 | repositories will be compatible with Mercurial before version 0.9.4. |
|
676 | 676 | |
|
677 | 677 | ``usefncache`` |
|
678 | 678 | Enable or disable the "fncache" repository format which enhances |
|
679 | 679 | the "store" repository format (which has to be enabled to use |
|
680 | 680 | fncache) to allow longer filenames and avoids using Windows |
|
681 | 681 | reserved names, e.g. "nul". Enabled by default. Disabling this |
|
682 | 682 | option ensures that the on-disk format of newly created |
|
683 | 683 | repositories will be compatible with Mercurial before version 1.1. |
|
684 | 684 | |
|
685 | 685 | ``dotencode`` |
|
686 | 686 | Enable or disable the "dotencode" repository format which enhances |
|
687 | 687 | the "fncache" repository format (which has to be enabled to use |
|
688 | 688 | dotencode) to avoid issues with filenames starting with ._ on |
|
689 | 689 | Mac OS X and spaces on Windows. Enabled by default. Disabling this |
|
690 | 690 | option ensures that the on-disk format of newly created |
|
691 | 691 | repositories will be compatible with Mercurial before version 1.7. |
|
692 | 692 | |
|
693 | 693 | ``graph`` |
|
694 | 694 | --------- |
|
695 | 695 | |
|
696 | 696 | Web graph view configuration. This section let you change graph |
|
697 | 697 | elements display properties by branches, for instance to make the |
|
698 | 698 | ``default`` branch stand out. |
|
699 | 699 | |
|
700 | 700 | Each line has the following format:: |
|
701 | 701 | |
|
702 | 702 | <branch>.<argument> = <value> |
|
703 | 703 | |
|
704 | 704 | where ``<branch>`` is the name of the branch being |
|
705 | 705 | customized. Example:: |
|
706 | 706 | |
|
707 | 707 | [graph] |
|
708 | 708 | # 2px width |
|
709 | 709 | default.width = 2 |
|
710 | 710 | # red color |
|
711 | 711 | default.color = FF0000 |
|
712 | 712 | |
|
713 | 713 | Supported arguments: |
|
714 | 714 | |
|
715 | 715 | ``width`` |
|
716 | 716 | Set branch edges width in pixels. |
|
717 | 717 | |
|
718 | 718 | ``color`` |
|
719 | 719 | Set branch edges color in hexadecimal RGB notation. |
|
720 | 720 | |
|
721 | 721 | ``hooks`` |
|
722 | 722 | --------- |
|
723 | 723 | |
|
724 | 724 | Commands or Python functions that get automatically executed by |
|
725 | 725 | various actions such as starting or finishing a commit. Multiple |
|
726 | 726 | hooks can be run for the same action by appending a suffix to the |
|
727 | 727 | action. Overriding a site-wide hook can be done by changing its |
|
728 | 728 | value or setting it to an empty string. Hooks can be prioritized |
|
729 | 729 | by adding a prefix of ``priority`` to the hook name on a new line |
|
730 | 730 | and setting the priority. The default priority is 0. |
|
731 | 731 | |
|
732 | 732 | Example ``.hg/hgrc``:: |
|
733 | 733 | |
|
734 | 734 | [hooks] |
|
735 | 735 | # update working directory after adding changesets |
|
736 | 736 | changegroup.update = hg update |
|
737 | 737 | # do not use the site-wide hook |
|
738 | 738 | incoming = |
|
739 | 739 | incoming.email = /my/email/hook |
|
740 | 740 | incoming.autobuild = /my/build/hook |
|
741 | 741 | # force autobuild hook to run before other incoming hooks |
|
742 | 742 | priority.incoming.autobuild = 1 |
|
743 | 743 | |
|
744 | 744 | Most hooks are run with environment variables set that give useful |
|
745 | 745 | additional information. For each hook below, the environment |
|
746 | 746 | variables it is passed are listed with names of the form ``$HG_foo``. |
|
747 | 747 | |
|
748 | 748 | ``changegroup`` |
|
749 | 749 | Run after a changegroup has been added via push, pull or unbundle. |
|
750 | 750 | ID of the first new changeset is in ``$HG_NODE``. URL from which |
|
751 | 751 | changes came is in ``$HG_URL``. |
|
752 | 752 | |
|
753 | 753 | ``commit`` |
|
754 | 754 | Run after a changeset has been created in the local repository. ID |
|
755 | 755 | of the newly created changeset is in ``$HG_NODE``. Parent changeset |
|
756 | 756 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
757 | 757 | |
|
758 | 758 | ``incoming`` |
|
759 | 759 | Run after a changeset has been pulled, pushed, or unbundled into |
|
760 | 760 | the local repository. The ID of the newly arrived changeset is in |
|
761 | 761 | ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``. |
|
762 | 762 | |
|
763 | 763 | ``outgoing`` |
|
764 | 764 | Run after sending changes from local repository to another. ID of |
|
765 | 765 | first changeset sent is in ``$HG_NODE``. Source of operation is in |
|
766 | 766 | ``$HG_SOURCE``; Also see :hg:`help config.preoutgoing` hook. |
|
767 | 767 | |
|
768 | 768 | ``post-<command>`` |
|
769 | 769 | Run after successful invocations of the associated command. The |
|
770 | 770 | contents of the command line are passed as ``$HG_ARGS`` and the result |
|
771 | 771 | code in ``$HG_RESULT``. Parsed command line arguments are passed as |
|
772 | 772 | ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of |
|
773 | 773 | the python data internally passed to <command>. ``$HG_OPTS`` is a |
|
774 | 774 | dictionary of options (with unspecified options set to their defaults). |
|
775 | 775 | ``$HG_PATS`` is a list of arguments. Hook failure is ignored. |
|
776 | 776 | |
|
777 | 777 | ``pre-<command>`` |
|
778 | 778 | Run before executing the associated command. The contents of the |
|
779 | 779 | command line are passed as ``$HG_ARGS``. Parsed command line arguments |
|
780 | 780 | are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string |
|
781 | 781 | representations of the data internally passed to <command>. ``$HG_OPTS`` |
|
782 | 782 | is a dictionary of options (with unspecified options set to their |
|
783 | 783 | defaults). ``$HG_PATS`` is a list of arguments. If the hook returns |
|
784 | 784 | failure, the command doesn't execute and Mercurial returns the failure |
|
785 | 785 | code. |
|
786 | 786 | |
|
787 | 787 | ``prechangegroup`` |
|
788 | 788 | Run before a changegroup is added via push, pull or unbundle. Exit |
|
789 | 789 | status 0 allows the changegroup to proceed. Non-zero status will |
|
790 | 790 | cause the push, pull or unbundle to fail. URL from which changes |
|
791 | 791 | will come is in ``$HG_URL``. |
|
792 | 792 | |
|
793 | 793 | ``precommit`` |
|
794 | 794 | Run before starting a local commit. Exit status 0 allows the |
|
795 | 795 | commit to proceed. Non-zero status will cause the commit to fail. |
|
796 | 796 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
797 | 797 | |
|
798 | 798 | ``prelistkeys`` |
|
799 | 799 | Run before listing pushkeys (like bookmarks) in the |
|
800 | 800 | repository. Non-zero status will cause failure. The key namespace is |
|
801 | 801 | in ``$HG_NAMESPACE``. |
|
802 | 802 | |
|
803 | 803 | ``preoutgoing`` |
|
804 | 804 | Run before collecting changes to send from the local repository to |
|
805 | 805 | another. Non-zero status will cause failure. This lets you prevent |
|
806 | 806 | pull over HTTP or SSH. Also prevents against local pull, push |
|
807 | 807 | (outbound) or bundle commands, but not effective, since you can |
|
808 | 808 | just copy files instead then. Source of operation is in |
|
809 | 809 | ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote |
|
810 | 810 | SSH or HTTP repository. If "push", "pull" or "bundle", operation |
|
811 | 811 | is happening on behalf of repository on same system. |
|
812 | 812 | |
|
813 | 813 | ``prepushkey`` |
|
814 | 814 | Run before a pushkey (like a bookmark) is added to the |
|
815 | 815 | repository. Non-zero status will cause the key to be rejected. The |
|
816 | 816 | key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``, |
|
817 | 817 | the old value (if any) is in ``$HG_OLD``, and the new value is in |
|
818 | 818 | ``$HG_NEW``. |
|
819 | 819 | |
|
820 | 820 | ``pretag`` |
|
821 | 821 | Run before creating a tag. Exit status 0 allows the tag to be |
|
822 | 822 | created. Non-zero status will cause the tag to fail. ID of |
|
823 | 823 | changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is |
|
824 | 824 | local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``. |
|
825 | 825 | |
|
826 | 826 | ``pretxnopen`` |
|
827 | 827 | Run before any new repository transaction is open. The reason for the |
|
828 | 828 | transaction will be in ``$HG_TXNNAME`` and a unique identifier for the |
|
829 | 829 | transaction will be in ``HG_TXNID``. A non-zero status will prevent the |
|
830 | 830 | transaction from being opened. |
|
831 | 831 | |
|
832 | 832 | ``pretxnclose`` |
|
833 | 833 | Run right before the transaction is actually finalized. Any |
|
834 | 834 | repository change will be visible to the hook program. This lets you |
|
835 | 835 | validate the transaction content or change it. Exit status 0 allows |
|
836 | 836 | the commit to proceed. Non-zero status will cause the transaction to |
|
837 | 837 | be rolled back. The reason for the transaction opening will be in |
|
838 | 838 | ``$HG_TXNNAME`` and a unique identifier for the transaction will be in |
|
839 | 839 | ``HG_TXNID``. The rest of the available data will vary according the |
|
840 | 840 | transaction type. New changesets will add ``$HG_NODE`` (id of the |
|
841 | 841 | first added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables, |
|
842 | 842 | bookmarks and phases changes will set ``HG_BOOKMARK_MOVED`` and |
|
843 | 843 | ``HG_PHASES_MOVED`` to ``1``, etc. |
|
844 | 844 | |
|
845 | 845 | ``txnclose`` |
|
846 | 846 | Run after any repository transaction has been committed. At this |
|
847 | 847 | point, the transaction can no longer be rolled back. The hook will run |
|
848 | 848 | after the lock is released. See :hg:`help config.pretxnclose` docs for |
|
849 | 849 | details about available variables. |
|
850 | 850 | |
|
851 | 851 | ``txnabort`` |
|
852 | 852 | Run when a transaction is aborted. See :hg:`help config.pretxnclose` |
|
853 | 853 | docs for details about available variables. |
|
854 | 854 | |
|
855 | 855 | ``pretxnchangegroup`` |
|
856 | 856 | Run after a changegroup has been added via push, pull or unbundle, |
|
857 | 857 | but before the transaction has been committed. Changegroup is |
|
858 | 858 | visible to hook program. This lets you validate incoming changes |
|
859 | 859 | before accepting them. Passed the ID of the first new changeset in |
|
860 | 860 | ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero |
|
861 | 861 | status will cause the transaction to be rolled back and the push, |
|
862 | 862 | pull or unbundle will fail. URL that was source of changes is in |
|
863 | 863 | ``$HG_URL``. |
|
864 | 864 | |
|
865 | 865 | ``pretxncommit`` |
|
866 | 866 | Run after a changeset has been created but the transaction not yet |
|
867 | 867 | committed. Changeset is visible to hook program. This lets you |
|
868 | 868 | validate commit message and changes. Exit status 0 allows the |
|
869 | 869 | commit to proceed. Non-zero status will cause the transaction to |
|
870 | 870 | be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset |
|
871 | 871 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
872 | 872 | |
|
873 | 873 | ``preupdate`` |
|
874 | 874 | Run before updating the working directory. Exit status 0 allows |
|
875 | 875 | the update to proceed. Non-zero status will prevent the update. |
|
876 | 876 | Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID |
|
877 | 877 | of second new parent is in ``$HG_PARENT2``. |
|
878 | 878 | |
|
879 | 879 | ``listkeys`` |
|
880 | 880 | Run after listing pushkeys (like bookmarks) in the repository. The |
|
881 | 881 | key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a |
|
882 | 882 | dictionary containing the keys and values. |
|
883 | 883 | |
|
884 | 884 | ``pushkey`` |
|
885 | 885 | Run after a pushkey (like a bookmark) is added to the |
|
886 | 886 | repository. The key namespace is in ``$HG_NAMESPACE``, the key is in |
|
887 | 887 | ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new |
|
888 | 888 | value is in ``$HG_NEW``. |
|
889 | 889 | |
|
890 | 890 | ``tag`` |
|
891 | 891 | Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``. |
|
892 | 892 | Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in |
|
893 | 893 | repository if ``$HG_LOCAL=0``. |
|
894 | 894 | |
|
895 | 895 | ``update`` |
|
896 | 896 | Run after updating the working directory. Changeset ID of first |
|
897 | 897 | new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is |
|
898 | 898 | in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
|
899 | 899 | update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. |
|
900 | 900 | |
|
901 | 901 | .. note:: |
|
902 | 902 | |
|
903 | 903 | It is generally better to use standard hooks rather than the |
|
904 | 904 | generic pre- and post- command hooks as they are guaranteed to be |
|
905 | 905 | called in the appropriate contexts for influencing transactions. |
|
906 | 906 | Also, hooks like "commit" will be called in all contexts that |
|
907 | 907 | generate a commit (e.g. tag) and not just the commit command. |
|
908 | 908 | |
|
909 | 909 | .. note:: |
|
910 | 910 | |
|
911 | 911 | Environment variables with empty values may not be passed to |
|
912 | 912 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
|
913 | 913 | will have an empty value under Unix-like platforms for non-merge |
|
914 | 914 | changesets, while it will not be available at all under Windows. |
|
915 | 915 | |
|
916 | 916 | The syntax for Python hooks is as follows:: |
|
917 | 917 | |
|
918 | 918 | hookname = python:modulename.submodule.callable |
|
919 | 919 | hookname = python:/path/to/python/module.py:callable |
|
920 | 920 | |
|
921 | 921 | Python hooks are run within the Mercurial process. Each hook is |
|
922 | 922 | called with at least three keyword arguments: a ui object (keyword |
|
923 | 923 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` |
|
924 | 924 | keyword that tells what kind of hook is used. Arguments listed as |
|
925 | 925 | environment variables above are passed as keyword arguments, with no |
|
926 | 926 | ``HG_`` prefix, and names in lower case. |
|
927 | 927 | |
|
928 | 928 | If a Python hook returns a "true" value or raises an exception, this |
|
929 | 929 | is treated as a failure. |
|
930 | 930 | |
|
931 | 931 | |
|
932 | 932 | ``hostfingerprints`` |
|
933 | 933 | -------------------- |
|
934 | 934 | |
|
935 | 935 | Fingerprints of the certificates of known HTTPS servers. |
|
936 | 936 | A HTTPS connection to a server with a fingerprint configured here will |
|
937 | 937 | only succeed if the servers certificate matches the fingerprint. |
|
938 | 938 | This is very similar to how ssh known hosts works. |
|
939 | 939 | The fingerprint is the SHA-1 hash value of the DER encoded certificate. |
|
940 | 940 | The CA chain and web.cacerts is not used for servers with a fingerprint. |
|
941 | 941 | |
|
942 | 942 | For example:: |
|
943 | 943 | |
|
944 | 944 | [hostfingerprints] |
|
945 | 945 | hg.intevation.org = fa:1f:d9:48:f1:e7:74:30:38:8d:d8:58:b6:94:b8:58:28:7d:8b:d0 |
|
946 | 946 | |
|
947 | 947 | This feature is only supported when using Python 2.6 or later. |
|
948 | 948 | |
|
949 | 949 | |
|
950 | 950 | ``http_proxy`` |
|
951 | 951 | -------------- |
|
952 | 952 | |
|
953 | 953 | Used to access web-based Mercurial repositories through a HTTP |
|
954 | 954 | proxy. |
|
955 | 955 | |
|
956 | 956 | ``host`` |
|
957 | 957 | Host name and (optional) port of the proxy server, for example |
|
958 | 958 | "myproxy:8000". |
|
959 | 959 | |
|
960 | 960 | ``no`` |
|
961 | 961 | Optional. Comma-separated list of host names that should bypass |
|
962 | 962 | the proxy. |
|
963 | 963 | |
|
964 | 964 | ``passwd`` |
|
965 | 965 | Optional. Password to authenticate with at the proxy server. |
|
966 | 966 | |
|
967 | 967 | ``user`` |
|
968 | 968 | Optional. User name to authenticate with at the proxy server. |
|
969 | 969 | |
|
970 | 970 | ``always`` |
|
971 | 971 | Optional. Always use the proxy, even for localhost and any entries |
|
972 | 972 | in ``http_proxy.no``. (default: False) |
|
973 | 973 | |
|
974 | 974 | ``merge-patterns`` |
|
975 | 975 | ------------------ |
|
976 | 976 | |
|
977 | 977 | This section specifies merge tools to associate with particular file |
|
978 | 978 | patterns. Tools matched here will take precedence over the default |
|
979 | 979 | merge tool. Patterns are globs by default, rooted at the repository |
|
980 | 980 | root. |
|
981 | 981 | |
|
982 | 982 | Example:: |
|
983 | 983 | |
|
984 | 984 | [merge-patterns] |
|
985 | 985 | **.c = kdiff3 |
|
986 | 986 | **.jpg = myimgmerge |
|
987 | 987 | |
|
988 | 988 | ``merge-tools`` |
|
989 | 989 | --------------- |
|
990 | 990 | |
|
991 | 991 | This section configures external merge tools to use for file-level |
|
992 | 992 | merges. This section has likely been preconfigured at install time. |
|
993 | 993 | Use :hg:`config merge-tools` to check the existing configuration. |
|
994 | 994 | Also see :hg:`help merge-tools` for more details. |
|
995 | 995 | |
|
996 | 996 | Example ``~/.hgrc``:: |
|
997 | 997 | |
|
998 | 998 | [merge-tools] |
|
999 | 999 | # Override stock tool location |
|
1000 | 1000 | kdiff3.executable = ~/bin/kdiff3 |
|
1001 | 1001 | # Specify command line |
|
1002 | 1002 | kdiff3.args = $base $local $other -o $output |
|
1003 | 1003 | # Give higher priority |
|
1004 | 1004 | kdiff3.priority = 1 |
|
1005 | 1005 | |
|
1006 | 1006 | # Changing the priority of preconfigured tool |
|
1007 | 1007 | vimdiff.priority = 0 |
|
1008 | 1008 | |
|
1009 | 1009 | # Define new tool |
|
1010 | 1010 | myHtmlTool.args = -m $local $other $base $output |
|
1011 | 1011 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge |
|
1012 | 1012 | myHtmlTool.priority = 1 |
|
1013 | 1013 | |
|
1014 | 1014 | Supported arguments: |
|
1015 | 1015 | |
|
1016 | 1016 | ``priority`` |
|
1017 | 1017 | The priority in which to evaluate this tool. |
|
1018 | 1018 | (default: 0) |
|
1019 | 1019 | |
|
1020 | 1020 | ``executable`` |
|
1021 | 1021 | Either just the name of the executable or its pathname. On Windows, |
|
1022 | 1022 | the path can use environment variables with ${ProgramFiles} syntax. |
|
1023 | 1023 | (default: the tool name) |
|
1024 | 1024 | |
|
1025 | 1025 | ``args`` |
|
1026 | 1026 | The arguments to pass to the tool executable. You can refer to the |
|
1027 | 1027 | files being merged as well as the output file through these |
|
1028 | 1028 | variables: ``$base``, ``$local``, ``$other``, ``$output``. The meaning |
|
1029 | 1029 | of ``$local`` and ``$other`` can vary depending on which action is being |
|
1030 | 1030 | performed. During and update or merge, ``$local`` represents the original |
|
1031 | 1031 | state of the file, while ``$other`` represents the commit you are updating |
|
1032 | 1032 | to or the commit you are merging with. During a rebase ``$local`` |
|
1033 | 1033 | represents the destination of the rebase, and ``$other`` represents the |
|
1034 | 1034 | commit being rebased. |
|
1035 | 1035 | (default: ``$local $base $other``) |
|
1036 | 1036 | |
|
1037 | 1037 | ``premerge`` |
|
1038 | 1038 | Attempt to run internal non-interactive 3-way merge tool before |
|
1039 | 1039 | launching external tool. Options are ``true``, ``false``, ``keep`` or |
|
1040 | 1040 | ``keep-merge3``. The ``keep`` option will leave markers in the file if the |
|
1041 | 1041 | premerge fails. The ``keep-merge3`` will do the same but include information |
|
1042 | 1042 | about the base of the merge in the marker (see internal :merge3 in |
|
1043 | 1043 | :hg:`help merge-tools`). |
|
1044 | 1044 | (default: True) |
|
1045 | 1045 | |
|
1046 | 1046 | ``binary`` |
|
1047 | 1047 | This tool can merge binary files. (default: False, unless tool |
|
1048 | 1048 | was selected by file pattern match) |
|
1049 | 1049 | |
|
1050 | 1050 | ``symlink`` |
|
1051 | 1051 | This tool can merge symlinks. (default: False) |
|
1052 | 1052 | |
|
1053 | 1053 | ``check`` |
|
1054 | 1054 | A list of merge success-checking options: |
|
1055 | 1055 | |
|
1056 | 1056 | ``changed`` |
|
1057 | 1057 | Ask whether merge was successful when the merged file shows no changes. |
|
1058 | 1058 | ``conflicts`` |
|
1059 | 1059 | Check whether there are conflicts even though the tool reported success. |
|
1060 | 1060 | ``prompt`` |
|
1061 | 1061 | Always prompt for merge success, regardless of success reported by tool. |
|
1062 | 1062 | |
|
1063 | 1063 | ``fixeol`` |
|
1064 | 1064 | Attempt to fix up EOL changes caused by the merge tool. |
|
1065 | 1065 | (default: False) |
|
1066 | 1066 | |
|
1067 | 1067 | ``gui`` |
|
1068 | 1068 | This tool requires a graphical interface to run. (default: False) |
|
1069 | 1069 | |
|
1070 | 1070 | ``regkey`` |
|
1071 | 1071 | Windows registry key which describes install location of this |
|
1072 | 1072 | tool. Mercurial will search for this key first under |
|
1073 | 1073 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. |
|
1074 | 1074 | (default: None) |
|
1075 | 1075 | |
|
1076 | 1076 | ``regkeyalt`` |
|
1077 | 1077 | An alternate Windows registry key to try if the first key is not |
|
1078 | 1078 | found. The alternate key uses the same ``regname`` and ``regappend`` |
|
1079 | 1079 | semantics of the primary key. The most common use for this key |
|
1080 | 1080 | is to search for 32bit applications on 64bit operating systems. |
|
1081 | 1081 | (default: None) |
|
1082 | 1082 | |
|
1083 | 1083 | ``regname`` |
|
1084 | 1084 | Name of value to read from specified registry key. |
|
1085 | 1085 | (default: the unnamed (default) value) |
|
1086 | 1086 | |
|
1087 | 1087 | ``regappend`` |
|
1088 | 1088 | String to append to the value read from the registry, typically |
|
1089 | 1089 | the executable name of the tool. |
|
1090 | 1090 | (default: None) |
|
1091 | 1091 | |
|
1092 | 1092 | |
|
1093 | 1093 | ``patch`` |
|
1094 | 1094 | --------- |
|
1095 | 1095 | |
|
1096 | 1096 | Settings used when applying patches, for instance through the 'import' |
|
1097 | 1097 | command or with Mercurial Queues extension. |
|
1098 | 1098 | |
|
1099 | 1099 | ``eol`` |
|
1100 | 1100 | When set to 'strict' patch content and patched files end of lines |
|
1101 | 1101 | are preserved. When set to ``lf`` or ``crlf``, both files end of |
|
1102 | 1102 | lines are ignored when patching and the result line endings are |
|
1103 | 1103 | normalized to either LF (Unix) or CRLF (Windows). When set to |
|
1104 | 1104 | ``auto``, end of lines are again ignored while patching but line |
|
1105 | 1105 | endings in patched files are normalized to their original setting |
|
1106 | 1106 | on a per-file basis. If target file does not exist or has no end |
|
1107 | 1107 | of line, patch line endings are preserved. |
|
1108 | 1108 | (default: strict) |
|
1109 | 1109 | |
|
1110 | 1110 | ``fuzz`` |
|
1111 | 1111 | The number of lines of 'fuzz' to allow when applying patches. This |
|
1112 | 1112 | controls how much context the patcher is allowed to ignore when |
|
1113 | 1113 | trying to apply a patch. |
|
1114 | 1114 | (default: 2) |
|
1115 | 1115 | |
|
1116 | 1116 | ``paths`` |
|
1117 | 1117 | --------- |
|
1118 | 1118 | |
|
1119 | 1119 | Assigns symbolic names to repositories. The left side is the |
|
1120 | 1120 | symbolic name, and the right gives the directory or URL that is the |
|
1121 | 1121 | location of the repository. Default paths can be declared by setting |
|
1122 | 1122 | the following entries. |
|
1123 | 1123 | |
|
1124 | 1124 | ``default`` |
|
1125 | 1125 | Directory or URL to use when pulling if no source is specified. |
|
1126 | 1126 | (default: repository from which the current repository was cloned) |
|
1127 | 1127 | |
|
1128 | 1128 | ``default-push`` |
|
1129 | 1129 | Optional. Directory or URL to use when pushing if no destination |
|
1130 | 1130 | is specified. |
|
1131 | 1131 | |
|
1132 | 1132 | Custom paths can be defined by assigning the path to a name that later can be |
|
1133 | 1133 | used from the command line. Example:: |
|
1134 | 1134 | |
|
1135 | 1135 | [paths] |
|
1136 | 1136 | my_path = http://example.com/path |
|
1137 | 1137 | |
|
1138 | 1138 | To push to the path defined in ``my_path`` run the command:: |
|
1139 | 1139 | |
|
1140 | 1140 | hg push my_path |
|
1141 | 1141 | |
|
1142 | 1142 | |
|
1143 | 1143 | ``phases`` |
|
1144 | 1144 | ---------- |
|
1145 | 1145 | |
|
1146 | 1146 | Specifies default handling of phases. See :hg:`help phases` for more |
|
1147 | 1147 | information about working with phases. |
|
1148 | 1148 | |
|
1149 | 1149 | ``publish`` |
|
1150 | 1150 | Controls draft phase behavior when working as a server. When true, |
|
1151 | 1151 | pushed changesets are set to public in both client and server and |
|
1152 | 1152 | pulled or cloned changesets are set to public in the client. |
|
1153 | 1153 | (default: True) |
|
1154 | 1154 | |
|
1155 | 1155 | ``new-commit`` |
|
1156 | 1156 | Phase of newly-created commits. |
|
1157 | 1157 | (default: draft) |
|
1158 | 1158 | |
|
1159 | 1159 | ``checksubrepos`` |
|
1160 | 1160 | Check the phase of the current revision of each subrepository. Allowed |
|
1161 | 1161 | values are "ignore", "follow" and "abort". For settings other than |
|
1162 | 1162 | "ignore", the phase of the current revision of each subrepository is |
|
1163 | 1163 | checked before committing the parent repository. If any of those phases is |
|
1164 | 1164 | greater than the phase of the parent repository (e.g. if a subrepo is in a |
|
1165 | 1165 | "secret" phase while the parent repo is in "draft" phase), the commit is |
|
1166 | 1166 | either aborted (if checksubrepos is set to "abort") or the higher phase is |
|
1167 | 1167 | used for the parent repository commit (if set to "follow"). |
|
1168 | 1168 | (default: follow) |
|
1169 | 1169 | |
|
1170 | 1170 | |
|
1171 | 1171 | ``profiling`` |
|
1172 | 1172 | ------------- |
|
1173 | 1173 | |
|
1174 | 1174 | Specifies profiling type, format, and file output. Two profilers are |
|
1175 | 1175 | supported: an instrumenting profiler (named ``ls``), and a sampling |
|
1176 | 1176 | profiler (named ``stat``). |
|
1177 | 1177 | |
|
1178 | 1178 | In this section description, 'profiling data' stands for the raw data |
|
1179 | 1179 | collected during profiling, while 'profiling report' stands for a |
|
1180 | 1180 | statistical text report generated from the profiling data. The |
|
1181 | 1181 | profiling is done using lsprof. |
|
1182 | 1182 | |
|
1183 | 1183 | ``type`` |
|
1184 | 1184 | The type of profiler to use. |
|
1185 | 1185 | (default: ls) |
|
1186 | 1186 | |
|
1187 | 1187 | ``ls`` |
|
1188 | 1188 | Use Python's built-in instrumenting profiler. This profiler |
|
1189 | 1189 | works on all platforms, but each line number it reports is the |
|
1190 | 1190 | first line of a function. This restriction makes it difficult to |
|
1191 | 1191 | identify the expensive parts of a non-trivial function. |
|
1192 | 1192 | ``stat`` |
|
1193 | 1193 | Use a third-party statistical profiler, statprof. This profiler |
|
1194 | 1194 | currently runs only on Unix systems, and is most useful for |
|
1195 | 1195 | profiling commands that run for longer than about 0.1 seconds. |
|
1196 | 1196 | |
|
1197 | 1197 | ``format`` |
|
1198 | 1198 | Profiling format. Specific to the ``ls`` instrumenting profiler. |
|
1199 | 1199 | (default: text) |
|
1200 | 1200 | |
|
1201 | 1201 | ``text`` |
|
1202 | 1202 | Generate a profiling report. When saving to a file, it should be |
|
1203 | 1203 | noted that only the report is saved, and the profiling data is |
|
1204 | 1204 | not kept. |
|
1205 | 1205 | ``kcachegrind`` |
|
1206 | 1206 | Format profiling data for kcachegrind use: when saving to a |
|
1207 | 1207 | file, the generated file can directly be loaded into |
|
1208 | 1208 | kcachegrind. |
|
1209 | 1209 | |
|
1210 | 1210 | ``frequency`` |
|
1211 | 1211 | Sampling frequency. Specific to the ``stat`` sampling profiler. |
|
1212 | 1212 | (default: 1000) |
|
1213 | 1213 | |
|
1214 | 1214 | ``output`` |
|
1215 | 1215 | File path where profiling data or report should be saved. If the |
|
1216 | 1216 | file exists, it is replaced. (default: None, data is printed on |
|
1217 | 1217 | stderr) |
|
1218 | 1218 | |
|
1219 | 1219 | ``sort`` |
|
1220 | 1220 | Sort field. Specific to the ``ls`` instrumenting profiler. |
|
1221 | 1221 | One of ``callcount``, ``reccallcount``, ``totaltime`` and |
|
1222 | 1222 | ``inlinetime``. |
|
1223 | 1223 | (default: inlinetime) |
|
1224 | 1224 | |
|
1225 | 1225 | ``limit`` |
|
1226 | 1226 | Number of lines to show. Specific to the ``ls`` instrumenting profiler. |
|
1227 | 1227 | (default: 30) |
|
1228 | 1228 | |
|
1229 | 1229 | ``nested`` |
|
1230 | 1230 | Show at most this number of lines of drill-down info after each main entry. |
|
1231 | 1231 | This can help explain the difference between Total and Inline. |
|
1232 | 1232 | Specific to the ``ls`` instrumenting profiler. |
|
1233 | 1233 | (default: 5) |
|
1234 | 1234 | |
|
1235 | 1235 | ``progress`` |
|
1236 | 1236 | ------------ |
|
1237 | 1237 | |
|
1238 | 1238 | Mercurial commands can draw progress bars that are as informative as |
|
1239 | 1239 | possible. Some progress bars only offer indeterminate information, while others |
|
1240 | 1240 | have a definite end point. |
|
1241 | 1241 | |
|
1242 | 1242 | ``delay`` |
|
1243 | 1243 | Number of seconds (float) before showing the progress bar. (default: 3) |
|
1244 | 1244 | |
|
1245 | 1245 | ``changedelay`` |
|
1246 | 1246 | Minimum delay before showing a new topic. When set to less than 3 * refresh, |
|
1247 | 1247 | that value will be used instead. (default: 1) |
|
1248 | 1248 | |
|
1249 | 1249 | ``refresh`` |
|
1250 | 1250 | Time in seconds between refreshes of the progress bar. (default: 0.1) |
|
1251 | 1251 | |
|
1252 | 1252 | ``format`` |
|
1253 | 1253 | Format of the progress bar. |
|
1254 | 1254 | |
|
1255 | 1255 | Valid entries for the format field are ``topic``, ``bar``, ``number``, |
|
1256 | 1256 | ``unit``, ``estimate``, speed, and item. item defaults to the last 20 |
|
1257 | 1257 | characters of the item, but this can be changed by adding either ``-<num>`` |
|
1258 | 1258 | which would take the last num characters, or ``+<num>`` for the first num |
|
1259 | 1259 | characters. |
|
1260 | 1260 | |
|
1261 | 1261 | (default: Topic bar number estimate) |
|
1262 | 1262 | |
|
1263 | 1263 | ``width`` |
|
1264 | 1264 | If set, the maximum width of the progress information (that is, min(width, |
|
1265 | 1265 | term width) will be used). |
|
1266 | 1266 | |
|
1267 | 1267 | ``clear-complete`` |
|
1268 | 1268 | Clear the progress bar after it's done. (default: True) |
|
1269 | 1269 | |
|
1270 | 1270 | ``disable`` |
|
1271 | 1271 | If true, don't show a progress bar. |
|
1272 | 1272 | |
|
1273 | 1273 | ``assume-tty`` |
|
1274 | 1274 | If true, ALWAYS show a progress bar, unless disable is given. |
|
1275 | 1275 | |
|
1276 | 1276 | ``revsetalias`` |
|
1277 | 1277 | --------------- |
|
1278 | 1278 | |
|
1279 | 1279 | Alias definitions for revsets. See :hg:`help revsets` for details. |
|
1280 | 1280 | |
|
1281 | 1281 | ``server`` |
|
1282 | 1282 | ---------- |
|
1283 | 1283 | |
|
1284 | 1284 | Controls generic server settings. |
|
1285 | 1285 | |
|
1286 | 1286 | ``uncompressed`` |
|
1287 | 1287 | Whether to allow clients to clone a repository using the |
|
1288 | 1288 | uncompressed streaming protocol. This transfers about 40% more |
|
1289 | 1289 | data than a regular clone, but uses less memory and CPU on both |
|
1290 | 1290 | server and client. Over a LAN (100 Mbps or better) or a very fast |
|
1291 | 1291 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a |
|
1292 | 1292 | regular clone. Over most WAN connections (anything slower than |
|
1293 | 1293 | about 6 Mbps), uncompressed streaming is slower, because of the |
|
1294 | 1294 | extra data transfer overhead. This mode will also temporarily hold |
|
1295 | 1295 | the write lock while determining what data to transfer. |
|
1296 | 1296 | (default: True) |
|
1297 | 1297 | |
|
1298 | 1298 | ``preferuncompressed`` |
|
1299 | 1299 | When set, clients will try to use the uncompressed streaming |
|
1300 | 1300 | protocol. (default: False) |
|
1301 | 1301 | |
|
1302 | 1302 | ``validate`` |
|
1303 | 1303 | Whether to validate the completeness of pushed changesets by |
|
1304 | 1304 | checking that all new file revisions specified in manifests are |
|
1305 | 1305 | present. (default: False) |
|
1306 | 1306 | |
|
1307 | 1307 | ``maxhttpheaderlen`` |
|
1308 | 1308 | Instruct HTTP clients not to send request headers longer than this |
|
1309 | 1309 | many bytes. (default: 1024) |
|
1310 | 1310 | |
|
1311 | 1311 | ``smtp`` |
|
1312 | 1312 | -------- |
|
1313 | 1313 | |
|
1314 | 1314 | Configuration for extensions that need to send email messages. |
|
1315 | 1315 | |
|
1316 | 1316 | ``host`` |
|
1317 | 1317 | Host name of mail server, e.g. "mail.example.com". |
|
1318 | 1318 | |
|
1319 | 1319 | ``port`` |
|
1320 | 1320 | Optional. Port to connect to on mail server. (default: 465 if |
|
1321 | 1321 | ``tls`` is smtps; 25 otherwise) |
|
1322 | 1322 | |
|
1323 | 1323 | ``tls`` |
|
1324 | 1324 | Optional. Method to enable TLS when connecting to mail server: starttls, |
|
1325 | 1325 | smtps or none. (default: none) |
|
1326 | 1326 | |
|
1327 | 1327 | ``verifycert`` |
|
1328 | 1328 | Optional. Verification for the certificate of mail server, when |
|
1329 | 1329 | ``tls`` is starttls or smtps. "strict", "loose" or False. For |
|
1330 | 1330 | "strict" or "loose", the certificate is verified as same as the |
|
1331 | 1331 | verification for HTTPS connections (see ``[hostfingerprints]`` and |
|
1332 | 1332 | ``[web] cacerts`` also). For "strict", sending email is also |
|
1333 | 1333 | aborted, if there is no configuration for mail server in |
|
1334 | 1334 | ``[hostfingerprints]`` and ``[web] cacerts``. --insecure for |
|
1335 | 1335 | :hg:`email` overwrites this as "loose". (default: strict) |
|
1336 | 1336 | |
|
1337 | 1337 | ``username`` |
|
1338 | 1338 | Optional. User name for authenticating with the SMTP server. |
|
1339 | 1339 | (default: None) |
|
1340 | 1340 | |
|
1341 | 1341 | ``password`` |
|
1342 | 1342 | Optional. Password for authenticating with the SMTP server. If not |
|
1343 | 1343 | specified, interactive sessions will prompt the user for a |
|
1344 | 1344 | password; non-interactive sessions will fail. (default: None) |
|
1345 | 1345 | |
|
1346 | 1346 | ``local_hostname`` |
|
1347 | 1347 | Optional. The hostname that the sender can use to identify |
|
1348 | 1348 | itself to the MTA. |
|
1349 | 1349 | |
|
1350 | 1350 | |
|
1351 | 1351 | ``subpaths`` |
|
1352 | 1352 | ------------ |
|
1353 | 1353 | |
|
1354 | 1354 | Subrepository source URLs can go stale if a remote server changes name |
|
1355 | 1355 | or becomes temporarily unavailable. This section lets you define |
|
1356 | 1356 | rewrite rules of the form:: |
|
1357 | 1357 | |
|
1358 | 1358 | <pattern> = <replacement> |
|
1359 | 1359 | |
|
1360 | 1360 | where ``pattern`` is a regular expression matching a subrepository |
|
1361 | 1361 | source URL and ``replacement`` is the replacement string used to |
|
1362 | 1362 | rewrite it. Groups can be matched in ``pattern`` and referenced in |
|
1363 | 1363 | ``replacements``. For instance:: |
|
1364 | 1364 | |
|
1365 | 1365 | http://server/(.*)-hg/ = http://hg.server/\1/ |
|
1366 | 1366 | |
|
1367 | 1367 | rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``. |
|
1368 | 1368 | |
|
1369 | 1369 | Relative subrepository paths are first made absolute, and the |
|
1370 | 1370 | rewrite rules are then applied on the full (absolute) path. The rules |
|
1371 | 1371 | are applied in definition order. |
|
1372 | 1372 | |
|
1373 | 1373 | ``trusted`` |
|
1374 | 1374 | ----------- |
|
1375 | 1375 | |
|
1376 | 1376 | Mercurial will not use the settings in the |
|
1377 | 1377 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted |
|
1378 | 1378 | user or to a trusted group, as various hgrc features allow arbitrary |
|
1379 | 1379 | commands to be run. This issue is often encountered when configuring |
|
1380 | 1380 | hooks or extensions for shared repositories or servers. However, |
|
1381 | 1381 | the web interface will use some safe settings from the ``[web]`` |
|
1382 | 1382 | section. |
|
1383 | 1383 | |
|
1384 | 1384 | This section specifies what users and groups are trusted. The |
|
1385 | 1385 | current user is always trusted. To trust everybody, list a user or a |
|
1386 | 1386 | group with name ``*``. These settings must be placed in an |
|
1387 | 1387 | *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the |
|
1388 | 1388 | user or service running Mercurial. |
|
1389 | 1389 | |
|
1390 | 1390 | ``users`` |
|
1391 | 1391 | Comma-separated list of trusted users. |
|
1392 | 1392 | |
|
1393 | 1393 | ``groups`` |
|
1394 | 1394 | Comma-separated list of trusted groups. |
|
1395 | 1395 | |
|
1396 | 1396 | |
|
1397 | 1397 | ``ui`` |
|
1398 | 1398 | ------ |
|
1399 | 1399 | |
|
1400 | 1400 | User interface controls. |
|
1401 | 1401 | |
|
1402 | 1402 | ``archivemeta`` |
|
1403 | 1403 | Whether to include the .hg_archival.txt file containing meta data |
|
1404 | 1404 | (hashes for the repository base and for tip) in archives created |
|
1405 | 1405 | by the :hg:`archive` command or downloaded via hgweb. |
|
1406 | 1406 | (default: True) |
|
1407 | 1407 | |
|
1408 | 1408 | ``askusername`` |
|
1409 | 1409 | Whether to prompt for a username when committing. If True, and |
|
1410 | 1410 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will |
|
1411 | 1411 | be prompted to enter a username. If no username is entered, the |
|
1412 | 1412 | default ``USER@HOST`` is used instead. |
|
1413 | 1413 | (default: False) |
|
1414 | 1414 | |
|
1415 | ``clonebundlefallback`` | |
|
1416 | Whether failure to apply an advertised "clone bundle" from a server | |
|
1417 | should result in fallback to a regular clone. | |
|
1418 | ||
|
1419 | This is disabled by default because servers advertising "clone | |
|
1420 | bundles" often do so to reduce server load. If advertised bundles | |
|
1421 | start mass failing and clients automatically fall back to a regular | |
|
1422 | clone, this would add significant and unexpected load to the server | |
|
1423 | since the server is expecting clone operations to be offloaded to | |
|
1424 | pre-generated bundles. Failing fast (the default behavior) ensures | |
|
1425 | clients don't overwhelm the server when "clone bundle" application | |
|
1426 | fails. | |
|
1427 | ||
|
1428 | (default: False) | |
|
1429 | ||
|
1415 | 1430 | ``commitsubrepos`` |
|
1416 | 1431 | Whether to commit modified subrepositories when committing the |
|
1417 | 1432 | parent repository. If False and one subrepository has uncommitted |
|
1418 | 1433 | changes, abort the commit. |
|
1419 | 1434 | (default: False) |
|
1420 | 1435 | |
|
1421 | 1436 | ``debug`` |
|
1422 | 1437 | Print debugging information. (default: False) |
|
1423 | 1438 | |
|
1424 | 1439 | ``editor`` |
|
1425 | 1440 | The editor to use during a commit. (default: ``$EDITOR`` or ``vi``) |
|
1426 | 1441 | |
|
1427 | 1442 | ``fallbackencoding`` |
|
1428 | 1443 | Encoding to try if it's not possible to decode the changelog using |
|
1429 | 1444 | UTF-8. (default: ISO-8859-1) |
|
1430 | 1445 | |
|
1431 | 1446 | ``ignore`` |
|
1432 | 1447 | A file to read per-user ignore patterns from. This file should be |
|
1433 | 1448 | in the same format as a repository-wide .hgignore file. Filenames |
|
1434 | 1449 | are relative to the repository root. This option supports hook syntax, |
|
1435 | 1450 | so if you want to specify multiple ignore files, you can do so by |
|
1436 | 1451 | setting something like ``ignore.other = ~/.hgignore2``. For details |
|
1437 | 1452 | of the ignore file format, see the ``hgignore(5)`` man page. |
|
1438 | 1453 | |
|
1439 | 1454 | ``interactive`` |
|
1440 | 1455 | Allow to prompt the user. (default: True) |
|
1441 | 1456 | |
|
1442 | 1457 | ``logtemplate`` |
|
1443 | 1458 | Template string for commands that print changesets. |
|
1444 | 1459 | |
|
1445 | 1460 | ``merge`` |
|
1446 | 1461 | The conflict resolution program to use during a manual merge. |
|
1447 | 1462 | For more information on merge tools see :hg:`help merge-tools`. |
|
1448 | 1463 | For configuring merge tools see the ``[merge-tools]`` section. |
|
1449 | 1464 | |
|
1450 | 1465 | ``mergemarkers`` |
|
1451 | 1466 | Sets the merge conflict marker label styling. The ``detailed`` |
|
1452 | 1467 | style uses the ``mergemarkertemplate`` setting to style the labels. |
|
1453 | 1468 | The ``basic`` style just uses 'local' and 'other' as the marker label. |
|
1454 | 1469 | One of ``basic`` or ``detailed``. |
|
1455 | 1470 | (default: ``basic``) |
|
1456 | 1471 | |
|
1457 | 1472 | ``mergemarkertemplate`` |
|
1458 | 1473 | The template used to print the commit description next to each conflict |
|
1459 | 1474 | marker during merge conflicts. See :hg:`help templates` for the template |
|
1460 | 1475 | format. |
|
1461 | 1476 | |
|
1462 | 1477 | Defaults to showing the hash, tags, branches, bookmarks, author, and |
|
1463 | 1478 | the first line of the commit description. |
|
1464 | 1479 | |
|
1465 | 1480 | If you use non-ASCII characters in names for tags, branches, bookmarks, |
|
1466 | 1481 | authors, and/or commit descriptions, you must pay attention to encodings of |
|
1467 | 1482 | managed files. At template expansion, non-ASCII characters use the encoding |
|
1468 | 1483 | specified by the ``--encoding`` global option, ``HGENCODING`` or other |
|
1469 | 1484 | environment variables that govern your locale. If the encoding of the merge |
|
1470 | 1485 | markers is different from the encoding of the merged files, |
|
1471 | 1486 | serious problems may occur. |
|
1472 | 1487 | |
|
1473 | 1488 | ``patch`` |
|
1474 | 1489 | An optional external tool that ``hg import`` and some extensions |
|
1475 | 1490 | will use for applying patches. By default Mercurial uses an |
|
1476 | 1491 | internal patch utility. The external tool must work as the common |
|
1477 | 1492 | Unix ``patch`` program. In particular, it must accept a ``-p`` |
|
1478 | 1493 | argument to strip patch headers, a ``-d`` argument to specify the |
|
1479 | 1494 | current directory, a file name to patch, and a patch file to take |
|
1480 | 1495 | from stdin. |
|
1481 | 1496 | |
|
1482 | 1497 | It is possible to specify a patch tool together with extra |
|
1483 | 1498 | arguments. For example, setting this option to ``patch --merge`` |
|
1484 | 1499 | will use the ``patch`` program with its 2-way merge option. |
|
1485 | 1500 | |
|
1486 | 1501 | ``portablefilenames`` |
|
1487 | 1502 | Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``. |
|
1488 | 1503 | (default: ``warn``) |
|
1489 | 1504 | If set to ``warn`` (or ``true``), a warning message is printed on POSIX |
|
1490 | 1505 | platforms, if a file with a non-portable filename is added (e.g. a file |
|
1491 | 1506 | with a name that can't be created on Windows because it contains reserved |
|
1492 | 1507 | parts like ``AUX``, reserved characters like ``:``, or would cause a case |
|
1493 | 1508 | collision with an existing file). |
|
1494 | 1509 | If set to ``ignore`` (or ``false``), no warning is printed. |
|
1495 | 1510 | If set to ``abort``, the command is aborted. |
|
1496 | 1511 | On Windows, this configuration option is ignored and the command aborted. |
|
1497 | 1512 | |
|
1498 | 1513 | ``quiet`` |
|
1499 | 1514 | Reduce the amount of output printed. (default: False) |
|
1500 | 1515 | |
|
1501 | 1516 | ``remotecmd`` |
|
1502 | 1517 | Remote command to use for clone/push/pull operations. (default: ``hg``) |
|
1503 | 1518 | |
|
1504 | 1519 | ``report_untrusted`` |
|
1505 | 1520 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a |
|
1506 | 1521 | trusted user or group. (default: True) |
|
1507 | 1522 | |
|
1508 | 1523 | ``slash`` |
|
1509 | 1524 | Display paths using a slash (``/``) as the path separator. This |
|
1510 | 1525 | only makes a difference on systems where the default path |
|
1511 | 1526 | separator is not the slash character (e.g. Windows uses the |
|
1512 | 1527 | backslash character (``\``)). |
|
1513 | 1528 | (default: False) |
|
1514 | 1529 | |
|
1515 | 1530 | ``statuscopies`` |
|
1516 | 1531 | Display copies in the status command. |
|
1517 | 1532 | |
|
1518 | 1533 | ``ssh`` |
|
1519 | 1534 | Command to use for SSH connections. (default: ``ssh``) |
|
1520 | 1535 | |
|
1521 | 1536 | ``strict`` |
|
1522 | 1537 | Require exact command names, instead of allowing unambiguous |
|
1523 | 1538 | abbreviations. (default: False) |
|
1524 | 1539 | |
|
1525 | 1540 | ``style`` |
|
1526 | 1541 | Name of style to use for command output. |
|
1527 | 1542 | |
|
1528 | 1543 | ``supportcontact`` |
|
1529 | 1544 | A URL where users should report a Mercurial traceback. Use this if you are a |
|
1530 | 1545 | large organisation with its own Mercurial deployment process and crash |
|
1531 | 1546 | reports should be addressed to your internal support. |
|
1532 | 1547 | |
|
1533 | 1548 | ``timeout`` |
|
1534 | 1549 | The timeout used when a lock is held (in seconds), a negative value |
|
1535 | 1550 | means no timeout. (default: 600) |
|
1536 | 1551 | |
|
1537 | 1552 | ``traceback`` |
|
1538 | 1553 | Mercurial always prints a traceback when an unknown exception |
|
1539 | 1554 | occurs. Setting this to True will make Mercurial print a traceback |
|
1540 | 1555 | on all exceptions, even those recognized by Mercurial (such as |
|
1541 | 1556 | IOError or MemoryError). (default: False) |
|
1542 | 1557 | |
|
1543 | 1558 | ``username`` |
|
1544 | 1559 | The committer of a changeset created when running "commit". |
|
1545 | 1560 | Typically a person's name and email address, e.g. ``Fred Widget |
|
1546 | 1561 | <fred@example.com>``. Environment variables in the |
|
1547 | 1562 | username are expanded. |
|
1548 | 1563 | |
|
1549 | 1564 | (default: ``$EMAIL`` or ``username@hostname``. If the username in |
|
1550 | 1565 | hgrc is empty, e.g. if the system admin set ``username =`` in the |
|
1551 | 1566 | system hgrc, it has to be specified manually or in a different |
|
1552 | 1567 | hgrc file) |
|
1553 | 1568 | |
|
1554 | 1569 | ``verbose`` |
|
1555 | 1570 | Increase the amount of output printed. (default: False) |
|
1556 | 1571 | |
|
1557 | 1572 | |
|
1558 | 1573 | ``web`` |
|
1559 | 1574 | ------- |
|
1560 | 1575 | |
|
1561 | 1576 | Web interface configuration. The settings in this section apply to |
|
1562 | 1577 | both the builtin webserver (started by :hg:`serve`) and the script you |
|
1563 | 1578 | run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI |
|
1564 | 1579 | and WSGI). |
|
1565 | 1580 | |
|
1566 | 1581 | The Mercurial webserver does no authentication (it does not prompt for |
|
1567 | 1582 | usernames and passwords to validate *who* users are), but it does do |
|
1568 | 1583 | authorization (it grants or denies access for *authenticated users* |
|
1569 | 1584 | based on settings in this section). You must either configure your |
|
1570 | 1585 | webserver to do authentication for you, or disable the authorization |
|
1571 | 1586 | checks. |
|
1572 | 1587 | |
|
1573 | 1588 | For a quick setup in a trusted environment, e.g., a private LAN, where |
|
1574 | 1589 | you want it to accept pushes from anybody, you can use the following |
|
1575 | 1590 | command line:: |
|
1576 | 1591 | |
|
1577 | 1592 | $ hg --config web.allow_push=* --config web.push_ssl=False serve |
|
1578 | 1593 | |
|
1579 | 1594 | Note that this will allow anybody to push anything to the server and |
|
1580 | 1595 | that this should not be used for public servers. |
|
1581 | 1596 | |
|
1582 | 1597 | The full set of options is: |
|
1583 | 1598 | |
|
1584 | 1599 | ``accesslog`` |
|
1585 | 1600 | Where to output the access log. (default: stdout) |
|
1586 | 1601 | |
|
1587 | 1602 | ``address`` |
|
1588 | 1603 | Interface address to bind to. (default: all) |
|
1589 | 1604 | |
|
1590 | 1605 | ``allow_archive`` |
|
1591 | 1606 | List of archive format (bz2, gz, zip) allowed for downloading. |
|
1592 | 1607 | (default: empty) |
|
1593 | 1608 | |
|
1594 | 1609 | ``allowbz2`` |
|
1595 | 1610 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository |
|
1596 | 1611 | revisions. |
|
1597 | 1612 | (default: False) |
|
1598 | 1613 | |
|
1599 | 1614 | ``allowgz`` |
|
1600 | 1615 | (DEPRECATED) Whether to allow .tar.gz downloading of repository |
|
1601 | 1616 | revisions. |
|
1602 | 1617 | (default: False) |
|
1603 | 1618 | |
|
1604 | 1619 | ``allowpull`` |
|
1605 | 1620 | Whether to allow pulling from the repository. (default: True) |
|
1606 | 1621 | |
|
1607 | 1622 | ``allow_push`` |
|
1608 | 1623 | Whether to allow pushing to the repository. If empty or not set, |
|
1609 | 1624 | pushing is not allowed. If the special value ``*``, any remote |
|
1610 | 1625 | user can push, including unauthenticated users. Otherwise, the |
|
1611 | 1626 | remote user must have been authenticated, and the authenticated |
|
1612 | 1627 | user name must be present in this list. The contents of the |
|
1613 | 1628 | allow_push list are examined after the deny_push list. |
|
1614 | 1629 | |
|
1615 | 1630 | ``allow_read`` |
|
1616 | 1631 | If the user has not already been denied repository access due to |
|
1617 | 1632 | the contents of deny_read, this list determines whether to grant |
|
1618 | 1633 | repository access to the user. If this list is not empty, and the |
|
1619 | 1634 | user is unauthenticated or not present in the list, then access is |
|
1620 | 1635 | denied for the user. If the list is empty or not set, then access |
|
1621 | 1636 | is permitted to all users by default. Setting allow_read to the |
|
1622 | 1637 | special value ``*`` is equivalent to it not being set (i.e. access |
|
1623 | 1638 | is permitted to all users). The contents of the allow_read list are |
|
1624 | 1639 | examined after the deny_read list. |
|
1625 | 1640 | |
|
1626 | 1641 | ``allowzip`` |
|
1627 | 1642 | (DEPRECATED) Whether to allow .zip downloading of repository |
|
1628 | 1643 | revisions. This feature creates temporary files. |
|
1629 | 1644 | (default: False) |
|
1630 | 1645 | |
|
1631 | 1646 | ``archivesubrepos`` |
|
1632 | 1647 | Whether to recurse into subrepositories when archiving. |
|
1633 | 1648 | (default: False) |
|
1634 | 1649 | |
|
1635 | 1650 | ``baseurl`` |
|
1636 | 1651 | Base URL to use when publishing URLs in other locations, so |
|
1637 | 1652 | third-party tools like email notification hooks can construct |
|
1638 | 1653 | URLs. Example: ``http://hgserver/repos/``. |
|
1639 | 1654 | |
|
1640 | 1655 | ``cacerts`` |
|
1641 | 1656 | Path to file containing a list of PEM encoded certificate |
|
1642 | 1657 | authority certificates. Environment variables and ``~user`` |
|
1643 | 1658 | constructs are expanded in the filename. If specified on the |
|
1644 | 1659 | client, then it will verify the identity of remote HTTPS servers |
|
1645 | 1660 | with these certificates. |
|
1646 | 1661 | |
|
1647 | 1662 | This feature is only supported when using Python 2.6 or later. If you wish |
|
1648 | 1663 | to use it with earlier versions of Python, install the backported |
|
1649 | 1664 | version of the ssl library that is available from |
|
1650 | 1665 | ``http://pypi.python.org``. |
|
1651 | 1666 | |
|
1652 | 1667 | To disable SSL verification temporarily, specify ``--insecure`` from |
|
1653 | 1668 | command line. |
|
1654 | 1669 | |
|
1655 | 1670 | You can use OpenSSL's CA certificate file if your platform has |
|
1656 | 1671 | one. On most Linux systems this will be |
|
1657 | 1672 | ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to |
|
1658 | 1673 | generate this file manually. The form must be as follows:: |
|
1659 | 1674 | |
|
1660 | 1675 | -----BEGIN CERTIFICATE----- |
|
1661 | 1676 | ... (certificate in base64 PEM encoding) ... |
|
1662 | 1677 | -----END CERTIFICATE----- |
|
1663 | 1678 | -----BEGIN CERTIFICATE----- |
|
1664 | 1679 | ... (certificate in base64 PEM encoding) ... |
|
1665 | 1680 | -----END CERTIFICATE----- |
|
1666 | 1681 | |
|
1667 | 1682 | ``cache`` |
|
1668 | 1683 | Whether to support caching in hgweb. (default: True) |
|
1669 | 1684 | |
|
1670 | 1685 | ``certificate`` |
|
1671 | 1686 | Certificate to use when running :hg:`serve`. |
|
1672 | 1687 | |
|
1673 | 1688 | ``collapse`` |
|
1674 | 1689 | With ``descend`` enabled, repositories in subdirectories are shown at |
|
1675 | 1690 | a single level alongside repositories in the current path. With |
|
1676 | 1691 | ``collapse`` also enabled, repositories residing at a deeper level than |
|
1677 | 1692 | the current path are grouped behind navigable directory entries that |
|
1678 | 1693 | lead to the locations of these repositories. In effect, this setting |
|
1679 | 1694 | collapses each collection of repositories found within a subdirectory |
|
1680 | 1695 | into a single entry for that subdirectory. (default: False) |
|
1681 | 1696 | |
|
1682 | 1697 | ``comparisoncontext`` |
|
1683 | 1698 | Number of lines of context to show in side-by-side file comparison. If |
|
1684 | 1699 | negative or the value ``full``, whole files are shown. (default: 5) |
|
1685 | 1700 | |
|
1686 | 1701 | This setting can be overridden by a ``context`` request parameter to the |
|
1687 | 1702 | ``comparison`` command, taking the same values. |
|
1688 | 1703 | |
|
1689 | 1704 | ``contact`` |
|
1690 | 1705 | Name or email address of the person in charge of the repository. |
|
1691 | 1706 | (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty) |
|
1692 | 1707 | |
|
1693 | 1708 | ``deny_push`` |
|
1694 | 1709 | Whether to deny pushing to the repository. If empty or not set, |
|
1695 | 1710 | push is not denied. If the special value ``*``, all remote users are |
|
1696 | 1711 | denied push. Otherwise, unauthenticated users are all denied, and |
|
1697 | 1712 | any authenticated user name present in this list is also denied. The |
|
1698 | 1713 | contents of the deny_push list are examined before the allow_push list. |
|
1699 | 1714 | |
|
1700 | 1715 | ``deny_read`` |
|
1701 | 1716 | Whether to deny reading/viewing of the repository. If this list is |
|
1702 | 1717 | not empty, unauthenticated users are all denied, and any |
|
1703 | 1718 | authenticated user name present in this list is also denied access to |
|
1704 | 1719 | the repository. If set to the special value ``*``, all remote users |
|
1705 | 1720 | are denied access (rarely needed ;). If deny_read is empty or not set, |
|
1706 | 1721 | the determination of repository access depends on the presence and |
|
1707 | 1722 | content of the allow_read list (see description). If both |
|
1708 | 1723 | deny_read and allow_read are empty or not set, then access is |
|
1709 | 1724 | permitted to all users by default. If the repository is being |
|
1710 | 1725 | served via hgwebdir, denied users will not be able to see it in |
|
1711 | 1726 | the list of repositories. The contents of the deny_read list have |
|
1712 | 1727 | priority over (are examined before) the contents of the allow_read |
|
1713 | 1728 | list. |
|
1714 | 1729 | |
|
1715 | 1730 | ``descend`` |
|
1716 | 1731 | hgwebdir indexes will not descend into subdirectories. Only repositories |
|
1717 | 1732 | directly in the current path will be shown (other repositories are still |
|
1718 | 1733 | available from the index corresponding to their containing path). |
|
1719 | 1734 | |
|
1720 | 1735 | ``description`` |
|
1721 | 1736 | Textual description of the repository's purpose or contents. |
|
1722 | 1737 | (default: "unknown") |
|
1723 | 1738 | |
|
1724 | 1739 | ``encoding`` |
|
1725 | 1740 | Character encoding name. (default: the current locale charset) |
|
1726 | 1741 | Example: "UTF-8". |
|
1727 | 1742 | |
|
1728 | 1743 | ``errorlog`` |
|
1729 | 1744 | Where to output the error log. (default: stderr) |
|
1730 | 1745 | |
|
1731 | 1746 | ``guessmime`` |
|
1732 | 1747 | Control MIME types for raw download of file content. |
|
1733 | 1748 | Set to True to let hgweb guess the content type from the file |
|
1734 | 1749 | extension. This will serve HTML files as ``text/html`` and might |
|
1735 | 1750 | allow cross-site scripting attacks when serving untrusted |
|
1736 | 1751 | repositories. (default: False) |
|
1737 | 1752 | |
|
1738 | 1753 | ``hidden`` |
|
1739 | 1754 | Whether to hide the repository in the hgwebdir index. |
|
1740 | 1755 | (default: False) |
|
1741 | 1756 | |
|
1742 | 1757 | ``ipv6`` |
|
1743 | 1758 | Whether to use IPv6. (default: False) |
|
1744 | 1759 | |
|
1745 | 1760 | ``logoimg`` |
|
1746 | 1761 | File name of the logo image that some templates display on each page. |
|
1747 | 1762 | The file name is relative to ``staticurl``. That is, the full path to |
|
1748 | 1763 | the logo image is "staticurl/logoimg". |
|
1749 | 1764 | If unset, ``hglogo.png`` will be used. |
|
1750 | 1765 | |
|
1751 | 1766 | ``logourl`` |
|
1752 | 1767 | Base URL to use for logos. If unset, ``https://mercurial-scm.org/`` |
|
1753 | 1768 | will be used. |
|
1754 | 1769 | |
|
1755 | 1770 | ``maxchanges`` |
|
1756 | 1771 | Maximum number of changes to list on the changelog. (default: 10) |
|
1757 | 1772 | |
|
1758 | 1773 | ``maxfiles`` |
|
1759 | 1774 | Maximum number of files to list per changeset. (default: 10) |
|
1760 | 1775 | |
|
1761 | 1776 | ``maxshortchanges`` |
|
1762 | 1777 | Maximum number of changes to list on the shortlog, graph or filelog |
|
1763 | 1778 | pages. (default: 60) |
|
1764 | 1779 | |
|
1765 | 1780 | ``name`` |
|
1766 | 1781 | Repository name to use in the web interface. |
|
1767 | 1782 | (default: current working directory) |
|
1768 | 1783 | |
|
1769 | 1784 | ``port`` |
|
1770 | 1785 | Port to listen on. (default: 8000) |
|
1771 | 1786 | |
|
1772 | 1787 | ``prefix`` |
|
1773 | 1788 | Prefix path to serve from. (default: '' (server root)) |
|
1774 | 1789 | |
|
1775 | 1790 | ``push_ssl`` |
|
1776 | 1791 | Whether to require that inbound pushes be transported over SSL to |
|
1777 | 1792 | prevent password sniffing. (default: True) |
|
1778 | 1793 | |
|
1779 | 1794 | ``refreshinterval`` |
|
1780 | 1795 | How frequently directory listings re-scan the filesystem for new |
|
1781 | 1796 | repositories, in seconds. This is relevant when wildcards are used |
|
1782 | 1797 | to define paths. Depending on how much filesystem traversal is |
|
1783 | 1798 | required, refreshing may negatively impact performance. |
|
1784 | 1799 | |
|
1785 | 1800 | Values less than or equal to 0 always refresh. |
|
1786 | 1801 | (default: 20) |
|
1787 | 1802 | |
|
1788 | 1803 | ``staticurl`` |
|
1789 | 1804 | Base URL to use for static files. If unset, static files (e.g. the |
|
1790 | 1805 | hgicon.png favicon) will be served by the CGI script itself. Use |
|
1791 | 1806 | this setting to serve them directly with the HTTP server. |
|
1792 | 1807 | Example: ``http://hgserver/static/``. |
|
1793 | 1808 | |
|
1794 | 1809 | ``stripes`` |
|
1795 | 1810 | How many lines a "zebra stripe" should span in multi-line output. |
|
1796 | 1811 | Set to 0 to disable. (default: 1) |
|
1797 | 1812 | |
|
1798 | 1813 | ``style`` |
|
1799 | 1814 | Which template map style to use. The available options are the names of |
|
1800 | 1815 | subdirectories in the HTML templates path. (default: ``paper``) |
|
1801 | 1816 | Example: ``monoblue``. |
|
1802 | 1817 | |
|
1803 | 1818 | ``templates`` |
|
1804 | 1819 | Where to find the HTML templates. The default path to the HTML templates |
|
1805 | 1820 | can be obtained from ``hg debuginstall``. |
|
1806 | 1821 | |
|
1807 | 1822 | ``websub`` |
|
1808 | 1823 | ---------- |
|
1809 | 1824 | |
|
1810 | 1825 | Web substitution filter definition. You can use this section to |
|
1811 | 1826 | define a set of regular expression substitution patterns which |
|
1812 | 1827 | let you automatically modify the hgweb server output. |
|
1813 | 1828 | |
|
1814 | 1829 | The default hgweb templates only apply these substitution patterns |
|
1815 | 1830 | on the revision description fields. You can apply them anywhere |
|
1816 | 1831 | you want when you create your own templates by adding calls to the |
|
1817 | 1832 | "websub" filter (usually after calling the "escape" filter). |
|
1818 | 1833 | |
|
1819 | 1834 | This can be used, for example, to convert issue references to links |
|
1820 | 1835 | to your issue tracker, or to convert "markdown-like" syntax into |
|
1821 | 1836 | HTML (see the examples below). |
|
1822 | 1837 | |
|
1823 | 1838 | Each entry in this section names a substitution filter. |
|
1824 | 1839 | The value of each entry defines the substitution expression itself. |
|
1825 | 1840 | The websub expressions follow the old interhg extension syntax, |
|
1826 | 1841 | which in turn imitates the Unix sed replacement syntax:: |
|
1827 | 1842 | |
|
1828 | 1843 | patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i] |
|
1829 | 1844 | |
|
1830 | 1845 | You can use any separator other than "/". The final "i" is optional |
|
1831 | 1846 | and indicates that the search must be case insensitive. |
|
1832 | 1847 | |
|
1833 | 1848 | Examples:: |
|
1834 | 1849 | |
|
1835 | 1850 | [websub] |
|
1836 | 1851 | issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i |
|
1837 | 1852 | italic = s/\b_(\S+)_\b/<i>\1<\/i>/ |
|
1838 | 1853 | bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/ |
|
1839 | 1854 | |
|
1840 | 1855 | ``worker`` |
|
1841 | 1856 | ---------- |
|
1842 | 1857 | |
|
1843 | 1858 | Parallel master/worker configuration. We currently perform working |
|
1844 | 1859 | directory updates in parallel on Unix-like systems, which greatly |
|
1845 | 1860 | helps performance. |
|
1846 | 1861 | |
|
1847 | 1862 | ``numcpus`` |
|
1848 | 1863 | Number of CPUs to use for parallel operations. A zero or |
|
1849 | 1864 | negative value is treated as ``use the default``. |
|
1850 | 1865 | (default: 4 or the number of CPUs on the system, whichever is larger) |
@@ -1,2377 +1,2381 | |||
|
1 | 1 | Short help: |
|
2 | 2 | |
|
3 | 3 | $ hg |
|
4 | 4 | Mercurial Distributed SCM |
|
5 | 5 | |
|
6 | 6 | basic commands: |
|
7 | 7 | |
|
8 | 8 | add add the specified files on the next commit |
|
9 | 9 | annotate show changeset information by line for each file |
|
10 | 10 | clone make a copy of an existing repository |
|
11 | 11 | commit commit the specified files or all outstanding changes |
|
12 | 12 | diff diff repository (or selected files) |
|
13 | 13 | export dump the header and diffs for one or more changesets |
|
14 | 14 | forget forget the specified files on the next commit |
|
15 | 15 | init create a new repository in the given directory |
|
16 | 16 | log show revision history of entire repository or files |
|
17 | 17 | merge merge another revision into working directory |
|
18 | 18 | pull pull changes from the specified source |
|
19 | 19 | push push changes to the specified destination |
|
20 | 20 | remove remove the specified files on the next commit |
|
21 | 21 | serve start stand-alone webserver |
|
22 | 22 | status show changed files in the working directory |
|
23 | 23 | summary summarize working directory state |
|
24 | 24 | update update working directory (or switch revisions) |
|
25 | 25 | |
|
26 | 26 | (use "hg help" for the full list of commands or "hg -v" for details) |
|
27 | 27 | |
|
28 | 28 | $ hg -q |
|
29 | 29 | add add the specified files on the next commit |
|
30 | 30 | annotate show changeset information by line for each file |
|
31 | 31 | clone make a copy of an existing repository |
|
32 | 32 | commit commit the specified files or all outstanding changes |
|
33 | 33 | diff diff repository (or selected files) |
|
34 | 34 | export dump the header and diffs for one or more changesets |
|
35 | 35 | forget forget the specified files on the next commit |
|
36 | 36 | init create a new repository in the given directory |
|
37 | 37 | log show revision history of entire repository or files |
|
38 | 38 | merge merge another revision into working directory |
|
39 | 39 | pull pull changes from the specified source |
|
40 | 40 | push push changes to the specified destination |
|
41 | 41 | remove remove the specified files on the next commit |
|
42 | 42 | serve start stand-alone webserver |
|
43 | 43 | status show changed files in the working directory |
|
44 | 44 | summary summarize working directory state |
|
45 | 45 | update update working directory (or switch revisions) |
|
46 | 46 | |
|
47 | 47 | $ hg help |
|
48 | 48 | Mercurial Distributed SCM |
|
49 | 49 | |
|
50 | 50 | list of commands: |
|
51 | 51 | |
|
52 | 52 | add add the specified files on the next commit |
|
53 | 53 | addremove add all new files, delete all missing files |
|
54 | 54 | annotate show changeset information by line for each file |
|
55 | 55 | archive create an unversioned archive of a repository revision |
|
56 | 56 | backout reverse effect of earlier changeset |
|
57 | 57 | bisect subdivision search of changesets |
|
58 | 58 | bookmarks create a new bookmark or list existing bookmarks |
|
59 | 59 | branch set or show the current branch name |
|
60 | 60 | branches list repository named branches |
|
61 | 61 | bundle create a changegroup file |
|
62 | 62 | cat output the current or given revision of files |
|
63 | 63 | clone make a copy of an existing repository |
|
64 | 64 | commit commit the specified files or all outstanding changes |
|
65 | 65 | config show combined config settings from all hgrc files |
|
66 | 66 | copy mark files as copied for the next commit |
|
67 | 67 | diff diff repository (or selected files) |
|
68 | 68 | export dump the header and diffs for one or more changesets |
|
69 | 69 | files list tracked files |
|
70 | 70 | forget forget the specified files on the next commit |
|
71 | 71 | graft copy changes from other branches onto the current branch |
|
72 | 72 | grep search for a pattern in specified files and revisions |
|
73 | 73 | heads show branch heads |
|
74 | 74 | help show help for a given topic or a help overview |
|
75 | 75 | identify identify the working directory or specified revision |
|
76 | 76 | import import an ordered set of patches |
|
77 | 77 | incoming show new changesets found in source |
|
78 | 78 | init create a new repository in the given directory |
|
79 | 79 | log show revision history of entire repository or files |
|
80 | 80 | manifest output the current or given revision of the project manifest |
|
81 | 81 | merge merge another revision into working directory |
|
82 | 82 | outgoing show changesets not found in the destination |
|
83 | 83 | paths show aliases for remote repositories |
|
84 | 84 | phase set or show the current phase name |
|
85 | 85 | pull pull changes from the specified source |
|
86 | 86 | push push changes to the specified destination |
|
87 | 87 | recover roll back an interrupted transaction |
|
88 | 88 | remove remove the specified files on the next commit |
|
89 | 89 | rename rename files; equivalent of copy + remove |
|
90 | 90 | resolve redo merges or set/view the merge status of files |
|
91 | 91 | revert restore files to their checkout state |
|
92 | 92 | root print the root (top) of the current working directory |
|
93 | 93 | serve start stand-alone webserver |
|
94 | 94 | status show changed files in the working directory |
|
95 | 95 | summary summarize working directory state |
|
96 | 96 | tag add one or more tags for the current or given revision |
|
97 | 97 | tags list repository tags |
|
98 | 98 | unbundle apply one or more changegroup files |
|
99 | 99 | update update working directory (or switch revisions) |
|
100 | 100 | verify verify the integrity of the repository |
|
101 | 101 | version output version and copyright information |
|
102 | 102 | |
|
103 | 103 | additional help topics: |
|
104 | 104 | |
|
105 | 105 | config Configuration Files |
|
106 | 106 | dates Date Formats |
|
107 | 107 | diffs Diff Formats |
|
108 | 108 | environment Environment Variables |
|
109 | 109 | extensions Using Additional Features |
|
110 | 110 | filesets Specifying File Sets |
|
111 | 111 | glossary Glossary |
|
112 | 112 | hgignore Syntax for Mercurial Ignore Files |
|
113 | 113 | hgweb Configuring hgweb |
|
114 | 114 | merge-tools Merge Tools |
|
115 | 115 | multirevs Specifying Multiple Revisions |
|
116 | 116 | patterns File Name Patterns |
|
117 | 117 | phases Working with Phases |
|
118 | 118 | revisions Specifying Single Revisions |
|
119 | 119 | revsets Specifying Revision Sets |
|
120 | 120 | scripting Using Mercurial from scripts and automation |
|
121 | 121 | subrepos Subrepositories |
|
122 | 122 | templating Template Usage |
|
123 | 123 | urls URL Paths |
|
124 | 124 | |
|
125 | 125 | (use "hg help -v" to show built-in aliases and global options) |
|
126 | 126 | |
|
127 | 127 | $ hg -q help |
|
128 | 128 | add add the specified files on the next commit |
|
129 | 129 | addremove add all new files, delete all missing files |
|
130 | 130 | annotate show changeset information by line for each file |
|
131 | 131 | archive create an unversioned archive of a repository revision |
|
132 | 132 | backout reverse effect of earlier changeset |
|
133 | 133 | bisect subdivision search of changesets |
|
134 | 134 | bookmarks create a new bookmark or list existing bookmarks |
|
135 | 135 | branch set or show the current branch name |
|
136 | 136 | branches list repository named branches |
|
137 | 137 | bundle create a changegroup file |
|
138 | 138 | cat output the current or given revision of files |
|
139 | 139 | clone make a copy of an existing repository |
|
140 | 140 | commit commit the specified files or all outstanding changes |
|
141 | 141 | config show combined config settings from all hgrc files |
|
142 | 142 | copy mark files as copied for the next commit |
|
143 | 143 | diff diff repository (or selected files) |
|
144 | 144 | export dump the header and diffs for one or more changesets |
|
145 | 145 | files list tracked files |
|
146 | 146 | forget forget the specified files on the next commit |
|
147 | 147 | graft copy changes from other branches onto the current branch |
|
148 | 148 | grep search for a pattern in specified files and revisions |
|
149 | 149 | heads show branch heads |
|
150 | 150 | help show help for a given topic or a help overview |
|
151 | 151 | identify identify the working directory or specified revision |
|
152 | 152 | import import an ordered set of patches |
|
153 | 153 | incoming show new changesets found in source |
|
154 | 154 | init create a new repository in the given directory |
|
155 | 155 | log show revision history of entire repository or files |
|
156 | 156 | manifest output the current or given revision of the project manifest |
|
157 | 157 | merge merge another revision into working directory |
|
158 | 158 | outgoing show changesets not found in the destination |
|
159 | 159 | paths show aliases for remote repositories |
|
160 | 160 | phase set or show the current phase name |
|
161 | 161 | pull pull changes from the specified source |
|
162 | 162 | push push changes to the specified destination |
|
163 | 163 | recover roll back an interrupted transaction |
|
164 | 164 | remove remove the specified files on the next commit |
|
165 | 165 | rename rename files; equivalent of copy + remove |
|
166 | 166 | resolve redo merges or set/view the merge status of files |
|
167 | 167 | revert restore files to their checkout state |
|
168 | 168 | root print the root (top) of the current working directory |
|
169 | 169 | serve start stand-alone webserver |
|
170 | 170 | status show changed files in the working directory |
|
171 | 171 | summary summarize working directory state |
|
172 | 172 | tag add one or more tags for the current or given revision |
|
173 | 173 | tags list repository tags |
|
174 | 174 | unbundle apply one or more changegroup files |
|
175 | 175 | update update working directory (or switch revisions) |
|
176 | 176 | verify verify the integrity of the repository |
|
177 | 177 | version output version and copyright information |
|
178 | 178 | |
|
179 | 179 | additional help topics: |
|
180 | 180 | |
|
181 | 181 | config Configuration Files |
|
182 | 182 | dates Date Formats |
|
183 | 183 | diffs Diff Formats |
|
184 | 184 | environment Environment Variables |
|
185 | 185 | extensions Using Additional Features |
|
186 | 186 | filesets Specifying File Sets |
|
187 | 187 | glossary Glossary |
|
188 | 188 | hgignore Syntax for Mercurial Ignore Files |
|
189 | 189 | hgweb Configuring hgweb |
|
190 | 190 | merge-tools Merge Tools |
|
191 | 191 | multirevs Specifying Multiple Revisions |
|
192 | 192 | patterns File Name Patterns |
|
193 | 193 | phases Working with Phases |
|
194 | 194 | revisions Specifying Single Revisions |
|
195 | 195 | revsets Specifying Revision Sets |
|
196 | 196 | scripting Using Mercurial from scripts and automation |
|
197 | 197 | subrepos Subrepositories |
|
198 | 198 | templating Template Usage |
|
199 | 199 | urls URL Paths |
|
200 | 200 | |
|
201 | 201 | Test extension help: |
|
202 | 202 | $ hg help extensions --config extensions.rebase= --config extensions.children= |
|
203 | 203 | Using Additional Features |
|
204 | 204 | """"""""""""""""""""""""" |
|
205 | 205 | |
|
206 | 206 | Mercurial has the ability to add new features through the use of |
|
207 | 207 | extensions. Extensions may add new commands, add options to existing |
|
208 | 208 | commands, change the default behavior of commands, or implement hooks. |
|
209 | 209 | |
|
210 | 210 | To enable the "foo" extension, either shipped with Mercurial or in the |
|
211 | 211 | Python search path, create an entry for it in your configuration file, |
|
212 | 212 | like this: |
|
213 | 213 | |
|
214 | 214 | [extensions] |
|
215 | 215 | foo = |
|
216 | 216 | |
|
217 | 217 | You may also specify the full path to an extension: |
|
218 | 218 | |
|
219 | 219 | [extensions] |
|
220 | 220 | myfeature = ~/.hgext/myfeature.py |
|
221 | 221 | |
|
222 | 222 | See "hg help config" for more information on configuration files. |
|
223 | 223 | |
|
224 | 224 | Extensions are not loaded by default for a variety of reasons: they can |
|
225 | 225 | increase startup overhead; they may be meant for advanced usage only; they |
|
226 | 226 | may provide potentially dangerous abilities (such as letting you destroy |
|
227 | 227 | or modify history); they might not be ready for prime time; or they may |
|
228 | 228 | alter some usual behaviors of stock Mercurial. It is thus up to the user |
|
229 | 229 | to activate extensions as needed. |
|
230 | 230 | |
|
231 | 231 | To explicitly disable an extension enabled in a configuration file of |
|
232 | 232 | broader scope, prepend its path with !: |
|
233 | 233 | |
|
234 | 234 | [extensions] |
|
235 | 235 | # disabling extension bar residing in /path/to/extension/bar.py |
|
236 | 236 | bar = !/path/to/extension/bar.py |
|
237 | 237 | # ditto, but no path was supplied for extension baz |
|
238 | 238 | baz = ! |
|
239 | 239 | |
|
240 | 240 | enabled extensions: |
|
241 | 241 | |
|
242 | 242 | children command to display child changesets (DEPRECATED) |
|
243 | 243 | rebase command to move sets of revisions to a different ancestor |
|
244 | 244 | |
|
245 | 245 | disabled extensions: |
|
246 | 246 | |
|
247 | 247 | acl hooks for controlling repository access |
|
248 | 248 | blackbox log repository events to a blackbox for debugging |
|
249 | 249 | bugzilla hooks for integrating with the Bugzilla bug tracker |
|
250 | 250 | censor erase file content at a given revision |
|
251 | 251 | churn command to display statistics about repository history |
|
252 | clonebundles server side extension to advertise pre-generated bundles to | |
|
253 | seed clones. | |
|
252 | 254 | color colorize output from some commands |
|
253 | 255 | convert import revisions from foreign VCS repositories into |
|
254 | 256 | Mercurial |
|
255 | 257 | eol automatically manage newlines in repository files |
|
256 | 258 | extdiff command to allow external programs to compare revisions |
|
257 | 259 | factotum http authentication with factotum |
|
258 | 260 | gpg commands to sign and verify changesets |
|
259 | 261 | hgcia hooks for integrating with the CIA.vc notification service |
|
260 | 262 | hgk browse the repository in a graphical way |
|
261 | 263 | highlight syntax highlighting for hgweb (requires Pygments) |
|
262 | 264 | histedit interactive history editing |
|
263 | 265 | keyword expand keywords in tracked files |
|
264 | 266 | largefiles track large binary files |
|
265 | 267 | mq manage a stack of patches |
|
266 | 268 | notify hooks for sending email push notifications |
|
267 | 269 | pager browse command output with an external pager |
|
268 | 270 | patchbomb command to send changesets as (a series of) patch emails |
|
269 | 271 | purge command to delete untracked files from the working |
|
270 | 272 | directory |
|
271 | 273 | record commands to interactively select changes for |
|
272 | 274 | commit/qrefresh |
|
273 | 275 | relink recreates hardlinks between repository clones |
|
274 | 276 | schemes extend schemes with shortcuts to repository swarms |
|
275 | 277 | share share a common history between several working directories |
|
276 | 278 | shelve save and restore changes to the working directory |
|
277 | 279 | strip strip changesets and their descendants from history |
|
278 | 280 | transplant command to transplant changesets from another branch |
|
279 | 281 | win32mbcs allow the use of MBCS paths with problematic encodings |
|
280 | 282 | zeroconf discover and advertise repositories on the local network |
|
281 | 283 | |
|
282 | 284 | Verify that extension keywords appear in help templates |
|
283 | 285 | |
|
284 | 286 | $ hg help --config extensions.transplant= templating|grep transplant > /dev/null |
|
285 | 287 | |
|
286 | 288 | Test short command list with verbose option |
|
287 | 289 | |
|
288 | 290 | $ hg -v help shortlist |
|
289 | 291 | Mercurial Distributed SCM |
|
290 | 292 | |
|
291 | 293 | basic commands: |
|
292 | 294 | |
|
293 | 295 | add add the specified files on the next commit |
|
294 | 296 | annotate, blame |
|
295 | 297 | show changeset information by line for each file |
|
296 | 298 | clone make a copy of an existing repository |
|
297 | 299 | commit, ci commit the specified files or all outstanding changes |
|
298 | 300 | diff diff repository (or selected files) |
|
299 | 301 | export dump the header and diffs for one or more changesets |
|
300 | 302 | forget forget the specified files on the next commit |
|
301 | 303 | init create a new repository in the given directory |
|
302 | 304 | log, history show revision history of entire repository or files |
|
303 | 305 | merge merge another revision into working directory |
|
304 | 306 | pull pull changes from the specified source |
|
305 | 307 | push push changes to the specified destination |
|
306 | 308 | remove, rm remove the specified files on the next commit |
|
307 | 309 | serve start stand-alone webserver |
|
308 | 310 | status, st show changed files in the working directory |
|
309 | 311 | summary, sum summarize working directory state |
|
310 | 312 | update, up, checkout, co |
|
311 | 313 | update working directory (or switch revisions) |
|
312 | 314 | |
|
313 | 315 | global options ([+] can be repeated): |
|
314 | 316 | |
|
315 | 317 | -R --repository REPO repository root directory or name of overlay bundle |
|
316 | 318 | file |
|
317 | 319 | --cwd DIR change working directory |
|
318 | 320 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
319 | 321 | all prompts |
|
320 | 322 | -q --quiet suppress output |
|
321 | 323 | -v --verbose enable additional output |
|
322 | 324 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
323 | 325 | --debug enable debugging output |
|
324 | 326 | --debugger start debugger |
|
325 | 327 | --encoding ENCODE set the charset encoding (default: ascii) |
|
326 | 328 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
327 | 329 | --traceback always print a traceback on exception |
|
328 | 330 | --time time how long the command takes |
|
329 | 331 | --profile print command execution profile |
|
330 | 332 | --version output version information and exit |
|
331 | 333 | -h --help display help and exit |
|
332 | 334 | --hidden consider hidden changesets |
|
333 | 335 | |
|
334 | 336 | (use "hg help" for the full list of commands) |
|
335 | 337 | |
|
336 | 338 | $ hg add -h |
|
337 | 339 | hg add [OPTION]... [FILE]... |
|
338 | 340 | |
|
339 | 341 | add the specified files on the next commit |
|
340 | 342 | |
|
341 | 343 | Schedule files to be version controlled and added to the repository. |
|
342 | 344 | |
|
343 | 345 | The files will be added to the repository at the next commit. To undo an |
|
344 | 346 | add before that, see "hg forget". |
|
345 | 347 | |
|
346 | 348 | If no names are given, add all files to the repository. |
|
347 | 349 | |
|
348 | 350 | Returns 0 if all files are successfully added. |
|
349 | 351 | |
|
350 | 352 | options ([+] can be repeated): |
|
351 | 353 | |
|
352 | 354 | -I --include PATTERN [+] include names matching the given patterns |
|
353 | 355 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
354 | 356 | -S --subrepos recurse into subrepositories |
|
355 | 357 | -n --dry-run do not perform actions, just print output |
|
356 | 358 | |
|
357 | 359 | (some details hidden, use --verbose to show complete help) |
|
358 | 360 | |
|
359 | 361 | Verbose help for add |
|
360 | 362 | |
|
361 | 363 | $ hg add -hv |
|
362 | 364 | hg add [OPTION]... [FILE]... |
|
363 | 365 | |
|
364 | 366 | add the specified files on the next commit |
|
365 | 367 | |
|
366 | 368 | Schedule files to be version controlled and added to the repository. |
|
367 | 369 | |
|
368 | 370 | The files will be added to the repository at the next commit. To undo an |
|
369 | 371 | add before that, see "hg forget". |
|
370 | 372 | |
|
371 | 373 | If no names are given, add all files to the repository. |
|
372 | 374 | |
|
373 | 375 | An example showing how new (unknown) files are added automatically by "hg |
|
374 | 376 | add": |
|
375 | 377 | |
|
376 | 378 | $ ls |
|
377 | 379 | foo.c |
|
378 | 380 | $ hg status |
|
379 | 381 | ? foo.c |
|
380 | 382 | $ hg add |
|
381 | 383 | adding foo.c |
|
382 | 384 | $ hg status |
|
383 | 385 | A foo.c |
|
384 | 386 | |
|
385 | 387 | Returns 0 if all files are successfully added. |
|
386 | 388 | |
|
387 | 389 | options ([+] can be repeated): |
|
388 | 390 | |
|
389 | 391 | -I --include PATTERN [+] include names matching the given patterns |
|
390 | 392 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
391 | 393 | -S --subrepos recurse into subrepositories |
|
392 | 394 | -n --dry-run do not perform actions, just print output |
|
393 | 395 | |
|
394 | 396 | global options ([+] can be repeated): |
|
395 | 397 | |
|
396 | 398 | -R --repository REPO repository root directory or name of overlay bundle |
|
397 | 399 | file |
|
398 | 400 | --cwd DIR change working directory |
|
399 | 401 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
400 | 402 | all prompts |
|
401 | 403 | -q --quiet suppress output |
|
402 | 404 | -v --verbose enable additional output |
|
403 | 405 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
404 | 406 | --debug enable debugging output |
|
405 | 407 | --debugger start debugger |
|
406 | 408 | --encoding ENCODE set the charset encoding (default: ascii) |
|
407 | 409 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
408 | 410 | --traceback always print a traceback on exception |
|
409 | 411 | --time time how long the command takes |
|
410 | 412 | --profile print command execution profile |
|
411 | 413 | --version output version information and exit |
|
412 | 414 | -h --help display help and exit |
|
413 | 415 | --hidden consider hidden changesets |
|
414 | 416 | |
|
415 | 417 | Test help option with version option |
|
416 | 418 | |
|
417 | 419 | $ hg add -h --version |
|
418 | 420 | Mercurial Distributed SCM (version *) (glob) |
|
419 | 421 | (see https://mercurial-scm.org for more information) |
|
420 | 422 | |
|
421 | 423 | Copyright (C) 2005-2015 Matt Mackall and others |
|
422 | 424 | This is free software; see the source for copying conditions. There is NO |
|
423 | 425 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
424 | 426 | |
|
425 | 427 | $ hg add --skjdfks |
|
426 | 428 | hg add: option --skjdfks not recognized |
|
427 | 429 | hg add [OPTION]... [FILE]... |
|
428 | 430 | |
|
429 | 431 | add the specified files on the next commit |
|
430 | 432 | |
|
431 | 433 | options ([+] can be repeated): |
|
432 | 434 | |
|
433 | 435 | -I --include PATTERN [+] include names matching the given patterns |
|
434 | 436 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
435 | 437 | -S --subrepos recurse into subrepositories |
|
436 | 438 | -n --dry-run do not perform actions, just print output |
|
437 | 439 | |
|
438 | 440 | (use "hg add -h" to show more help) |
|
439 | 441 | [255] |
|
440 | 442 | |
|
441 | 443 | Test ambiguous command help |
|
442 | 444 | |
|
443 | 445 | $ hg help ad |
|
444 | 446 | list of commands: |
|
445 | 447 | |
|
446 | 448 | add add the specified files on the next commit |
|
447 | 449 | addremove add all new files, delete all missing files |
|
448 | 450 | |
|
449 | 451 | (use "hg help -v ad" to show built-in aliases and global options) |
|
450 | 452 | |
|
451 | 453 | Test command without options |
|
452 | 454 | |
|
453 | 455 | $ hg help verify |
|
454 | 456 | hg verify |
|
455 | 457 | |
|
456 | 458 | verify the integrity of the repository |
|
457 | 459 | |
|
458 | 460 | Verify the integrity of the current repository. |
|
459 | 461 | |
|
460 | 462 | This will perform an extensive check of the repository's integrity, |
|
461 | 463 | validating the hashes and checksums of each entry in the changelog, |
|
462 | 464 | manifest, and tracked files, as well as the integrity of their crosslinks |
|
463 | 465 | and indices. |
|
464 | 466 | |
|
465 | 467 | Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more |
|
466 | 468 | information about recovery from corruption of the repository. |
|
467 | 469 | |
|
468 | 470 | Returns 0 on success, 1 if errors are encountered. |
|
469 | 471 | |
|
470 | 472 | (some details hidden, use --verbose to show complete help) |
|
471 | 473 | |
|
472 | 474 | $ hg help diff |
|
473 | 475 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... |
|
474 | 476 | |
|
475 | 477 | diff repository (or selected files) |
|
476 | 478 | |
|
477 | 479 | Show differences between revisions for the specified files. |
|
478 | 480 | |
|
479 | 481 | Differences between files are shown using the unified diff format. |
|
480 | 482 | |
|
481 | 483 | Note: |
|
482 | 484 | diff may generate unexpected results for merges, as it will default to |
|
483 | 485 | comparing against the working directory's first parent changeset if no |
|
484 | 486 | revisions are specified. |
|
485 | 487 | |
|
486 | 488 | When two revision arguments are given, then changes are shown between |
|
487 | 489 | those revisions. If only one revision is specified then that revision is |
|
488 | 490 | compared to the working directory, and, when no revisions are specified, |
|
489 | 491 | the working directory files are compared to its parent. |
|
490 | 492 | |
|
491 | 493 | Alternatively you can specify -c/--change with a revision to see the |
|
492 | 494 | changes in that changeset relative to its first parent. |
|
493 | 495 | |
|
494 | 496 | Without the -a/--text option, diff will avoid generating diffs of files it |
|
495 | 497 | detects as binary. With -a, diff will generate a diff anyway, probably |
|
496 | 498 | with undesirable results. |
|
497 | 499 | |
|
498 | 500 | Use the -g/--git option to generate diffs in the git extended diff format. |
|
499 | 501 | For more information, read "hg help diffs". |
|
500 | 502 | |
|
501 | 503 | Returns 0 on success. |
|
502 | 504 | |
|
503 | 505 | options ([+] can be repeated): |
|
504 | 506 | |
|
505 | 507 | -r --rev REV [+] revision |
|
506 | 508 | -c --change REV change made by revision |
|
507 | 509 | -a --text treat all files as text |
|
508 | 510 | -g --git use git extended diff format |
|
509 | 511 | --nodates omit dates from diff headers |
|
510 | 512 | --noprefix omit a/ and b/ prefixes from filenames |
|
511 | 513 | -p --show-function show which function each change is in |
|
512 | 514 | --reverse produce a diff that undoes the changes |
|
513 | 515 | -w --ignore-all-space ignore white space when comparing lines |
|
514 | 516 | -b --ignore-space-change ignore changes in the amount of white space |
|
515 | 517 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
516 | 518 | -U --unified NUM number of lines of context to show |
|
517 | 519 | --stat output diffstat-style summary of changes |
|
518 | 520 | --root DIR produce diffs relative to subdirectory |
|
519 | 521 | -I --include PATTERN [+] include names matching the given patterns |
|
520 | 522 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
521 | 523 | -S --subrepos recurse into subrepositories |
|
522 | 524 | |
|
523 | 525 | (some details hidden, use --verbose to show complete help) |
|
524 | 526 | |
|
525 | 527 | $ hg help status |
|
526 | 528 | hg status [OPTION]... [FILE]... |
|
527 | 529 | |
|
528 | 530 | aliases: st |
|
529 | 531 | |
|
530 | 532 | show changed files in the working directory |
|
531 | 533 | |
|
532 | 534 | Show status of files in the repository. If names are given, only files |
|
533 | 535 | that match are shown. Files that are clean or ignored or the source of a |
|
534 | 536 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, |
|
535 | 537 | -C/--copies or -A/--all are given. Unless options described with "show |
|
536 | 538 | only ..." are given, the options -mardu are used. |
|
537 | 539 | |
|
538 | 540 | Option -q/--quiet hides untracked (unknown and ignored) files unless |
|
539 | 541 | explicitly requested with -u/--unknown or -i/--ignored. |
|
540 | 542 | |
|
541 | 543 | Note: |
|
542 | 544 | status may appear to disagree with diff if permissions have changed or |
|
543 | 545 | a merge has occurred. The standard diff format does not report |
|
544 | 546 | permission changes and diff only reports changes relative to one merge |
|
545 | 547 | parent. |
|
546 | 548 | |
|
547 | 549 | If one revision is given, it is used as the base revision. If two |
|
548 | 550 | revisions are given, the differences between them are shown. The --change |
|
549 | 551 | option can also be used as a shortcut to list the changed files of a |
|
550 | 552 | revision from its first parent. |
|
551 | 553 | |
|
552 | 554 | The codes used to show the status of files are: |
|
553 | 555 | |
|
554 | 556 | M = modified |
|
555 | 557 | A = added |
|
556 | 558 | R = removed |
|
557 | 559 | C = clean |
|
558 | 560 | ! = missing (deleted by non-hg command, but still tracked) |
|
559 | 561 | ? = not tracked |
|
560 | 562 | I = ignored |
|
561 | 563 | = origin of the previous file (with --copies) |
|
562 | 564 | |
|
563 | 565 | Returns 0 on success. |
|
564 | 566 | |
|
565 | 567 | options ([+] can be repeated): |
|
566 | 568 | |
|
567 | 569 | -A --all show status of all files |
|
568 | 570 | -m --modified show only modified files |
|
569 | 571 | -a --added show only added files |
|
570 | 572 | -r --removed show only removed files |
|
571 | 573 | -d --deleted show only deleted (but tracked) files |
|
572 | 574 | -c --clean show only files without changes |
|
573 | 575 | -u --unknown show only unknown (not tracked) files |
|
574 | 576 | -i --ignored show only ignored files |
|
575 | 577 | -n --no-status hide status prefix |
|
576 | 578 | -C --copies show source of copied files |
|
577 | 579 | -0 --print0 end filenames with NUL, for use with xargs |
|
578 | 580 | --rev REV [+] show difference from revision |
|
579 | 581 | --change REV list the changed files of a revision |
|
580 | 582 | -I --include PATTERN [+] include names matching the given patterns |
|
581 | 583 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
582 | 584 | -S --subrepos recurse into subrepositories |
|
583 | 585 | |
|
584 | 586 | (some details hidden, use --verbose to show complete help) |
|
585 | 587 | |
|
586 | 588 | $ hg -q help status |
|
587 | 589 | hg status [OPTION]... [FILE]... |
|
588 | 590 | |
|
589 | 591 | show changed files in the working directory |
|
590 | 592 | |
|
591 | 593 | $ hg help foo |
|
592 | 594 | abort: no such help topic: foo |
|
593 | 595 | (try "hg help --keyword foo") |
|
594 | 596 | [255] |
|
595 | 597 | |
|
596 | 598 | $ hg skjdfks |
|
597 | 599 | hg: unknown command 'skjdfks' |
|
598 | 600 | Mercurial Distributed SCM |
|
599 | 601 | |
|
600 | 602 | basic commands: |
|
601 | 603 | |
|
602 | 604 | add add the specified files on the next commit |
|
603 | 605 | annotate show changeset information by line for each file |
|
604 | 606 | clone make a copy of an existing repository |
|
605 | 607 | commit commit the specified files or all outstanding changes |
|
606 | 608 | diff diff repository (or selected files) |
|
607 | 609 | export dump the header and diffs for one or more changesets |
|
608 | 610 | forget forget the specified files on the next commit |
|
609 | 611 | init create a new repository in the given directory |
|
610 | 612 | log show revision history of entire repository or files |
|
611 | 613 | merge merge another revision into working directory |
|
612 | 614 | pull pull changes from the specified source |
|
613 | 615 | push push changes to the specified destination |
|
614 | 616 | remove remove the specified files on the next commit |
|
615 | 617 | serve start stand-alone webserver |
|
616 | 618 | status show changed files in the working directory |
|
617 | 619 | summary summarize working directory state |
|
618 | 620 | update update working directory (or switch revisions) |
|
619 | 621 | |
|
620 | 622 | (use "hg help" for the full list of commands or "hg -v" for details) |
|
621 | 623 | [255] |
|
622 | 624 | |
|
623 | 625 | |
|
624 | 626 | Make sure that we don't run afoul of the help system thinking that |
|
625 | 627 | this is a section and erroring out weirdly. |
|
626 | 628 | |
|
627 | 629 | $ hg .log |
|
628 | 630 | hg: unknown command '.log' |
|
629 | 631 | (did you mean one of log?) |
|
630 | 632 | [255] |
|
631 | 633 | |
|
632 | 634 | $ hg log. |
|
633 | 635 | hg: unknown command 'log.' |
|
634 | 636 | (did you mean one of log?) |
|
635 | 637 | [255] |
|
636 | 638 | $ hg pu.lh |
|
637 | 639 | hg: unknown command 'pu.lh' |
|
638 | 640 | (did you mean one of pull, push?) |
|
639 | 641 | [255] |
|
640 | 642 | |
|
641 | 643 | $ cat > helpext.py <<EOF |
|
642 | 644 | > import os |
|
643 | 645 | > from mercurial import cmdutil, commands |
|
644 | 646 | > |
|
645 | 647 | > cmdtable = {} |
|
646 | 648 | > command = cmdutil.command(cmdtable) |
|
647 | 649 | > |
|
648 | 650 | > @command('nohelp', |
|
649 | 651 | > [('', 'longdesc', 3, 'x'*90), |
|
650 | 652 | > ('n', '', None, 'normal desc'), |
|
651 | 653 | > ('', 'newline', '', 'line1\nline2')], |
|
652 | 654 | > 'hg nohelp', |
|
653 | 655 | > norepo=True) |
|
654 | 656 | > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')]) |
|
655 | 657 | > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')]) |
|
656 | 658 | > def nohelp(ui, *args, **kwargs): |
|
657 | 659 | > pass |
|
658 | 660 | > |
|
659 | 661 | > EOF |
|
660 | 662 | $ echo '[extensions]' >> $HGRCPATH |
|
661 | 663 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
|
662 | 664 | |
|
663 | 665 | Test command with no help text |
|
664 | 666 | |
|
665 | 667 | $ hg help nohelp |
|
666 | 668 | hg nohelp |
|
667 | 669 | |
|
668 | 670 | (no help text available) |
|
669 | 671 | |
|
670 | 672 | options: |
|
671 | 673 | |
|
672 | 674 | --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
673 | 675 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3) |
|
674 | 676 | -n -- normal desc |
|
675 | 677 | --newline VALUE line1 line2 |
|
676 | 678 | |
|
677 | 679 | (some details hidden, use --verbose to show complete help) |
|
678 | 680 | |
|
679 | 681 | $ hg help -k nohelp |
|
680 | 682 | Commands: |
|
681 | 683 | |
|
682 | 684 | nohelp hg nohelp |
|
683 | 685 | |
|
684 | 686 | Extension Commands: |
|
685 | 687 | |
|
686 | 688 | nohelp (no help text available) |
|
687 | 689 | |
|
688 | 690 | Test that default list of commands omits extension commands |
|
689 | 691 | |
|
690 | 692 | $ hg help |
|
691 | 693 | Mercurial Distributed SCM |
|
692 | 694 | |
|
693 | 695 | list of commands: |
|
694 | 696 | |
|
695 | 697 | add add the specified files on the next commit |
|
696 | 698 | addremove add all new files, delete all missing files |
|
697 | 699 | annotate show changeset information by line for each file |
|
698 | 700 | archive create an unversioned archive of a repository revision |
|
699 | 701 | backout reverse effect of earlier changeset |
|
700 | 702 | bisect subdivision search of changesets |
|
701 | 703 | bookmarks create a new bookmark or list existing bookmarks |
|
702 | 704 | branch set or show the current branch name |
|
703 | 705 | branches list repository named branches |
|
704 | 706 | bundle create a changegroup file |
|
705 | 707 | cat output the current or given revision of files |
|
706 | 708 | clone make a copy of an existing repository |
|
707 | 709 | commit commit the specified files or all outstanding changes |
|
708 | 710 | config show combined config settings from all hgrc files |
|
709 | 711 | copy mark files as copied for the next commit |
|
710 | 712 | diff diff repository (or selected files) |
|
711 | 713 | export dump the header and diffs for one or more changesets |
|
712 | 714 | files list tracked files |
|
713 | 715 | forget forget the specified files on the next commit |
|
714 | 716 | graft copy changes from other branches onto the current branch |
|
715 | 717 | grep search for a pattern in specified files and revisions |
|
716 | 718 | heads show branch heads |
|
717 | 719 | help show help for a given topic or a help overview |
|
718 | 720 | identify identify the working directory or specified revision |
|
719 | 721 | import import an ordered set of patches |
|
720 | 722 | incoming show new changesets found in source |
|
721 | 723 | init create a new repository in the given directory |
|
722 | 724 | log show revision history of entire repository or files |
|
723 | 725 | manifest output the current or given revision of the project manifest |
|
724 | 726 | merge merge another revision into working directory |
|
725 | 727 | outgoing show changesets not found in the destination |
|
726 | 728 | paths show aliases for remote repositories |
|
727 | 729 | phase set or show the current phase name |
|
728 | 730 | pull pull changes from the specified source |
|
729 | 731 | push push changes to the specified destination |
|
730 | 732 | recover roll back an interrupted transaction |
|
731 | 733 | remove remove the specified files on the next commit |
|
732 | 734 | rename rename files; equivalent of copy + remove |
|
733 | 735 | resolve redo merges or set/view the merge status of files |
|
734 | 736 | revert restore files to their checkout state |
|
735 | 737 | root print the root (top) of the current working directory |
|
736 | 738 | serve start stand-alone webserver |
|
737 | 739 | status show changed files in the working directory |
|
738 | 740 | summary summarize working directory state |
|
739 | 741 | tag add one or more tags for the current or given revision |
|
740 | 742 | tags list repository tags |
|
741 | 743 | unbundle apply one or more changegroup files |
|
742 | 744 | update update working directory (or switch revisions) |
|
743 | 745 | verify verify the integrity of the repository |
|
744 | 746 | version output version and copyright information |
|
745 | 747 | |
|
746 | 748 | enabled extensions: |
|
747 | 749 | |
|
748 | 750 | helpext (no help text available) |
|
749 | 751 | |
|
750 | 752 | additional help topics: |
|
751 | 753 | |
|
752 | 754 | config Configuration Files |
|
753 | 755 | dates Date Formats |
|
754 | 756 | diffs Diff Formats |
|
755 | 757 | environment Environment Variables |
|
756 | 758 | extensions Using Additional Features |
|
757 | 759 | filesets Specifying File Sets |
|
758 | 760 | glossary Glossary |
|
759 | 761 | hgignore Syntax for Mercurial Ignore Files |
|
760 | 762 | hgweb Configuring hgweb |
|
761 | 763 | merge-tools Merge Tools |
|
762 | 764 | multirevs Specifying Multiple Revisions |
|
763 | 765 | patterns File Name Patterns |
|
764 | 766 | phases Working with Phases |
|
765 | 767 | revisions Specifying Single Revisions |
|
766 | 768 | revsets Specifying Revision Sets |
|
767 | 769 | scripting Using Mercurial from scripts and automation |
|
768 | 770 | subrepos Subrepositories |
|
769 | 771 | templating Template Usage |
|
770 | 772 | urls URL Paths |
|
771 | 773 | |
|
772 | 774 | (use "hg help -v" to show built-in aliases and global options) |
|
773 | 775 | |
|
774 | 776 | |
|
775 | 777 | Test list of internal help commands |
|
776 | 778 | |
|
777 | 779 | $ hg help debug |
|
778 | 780 | debug commands (internal and unsupported): |
|
779 | 781 | |
|
780 | 782 | debugancestor |
|
781 | 783 | find the ancestor revision of two revisions in a given index |
|
782 | 784 | debugbuilddag |
|
783 | 785 | builds a repo with a given DAG from scratch in the current |
|
784 | 786 | empty repo |
|
785 | 787 | debugbundle lists the contents of a bundle |
|
786 | 788 | debugcheckstate |
|
787 | 789 | validate the correctness of the current dirstate |
|
788 | 790 | debugcommands |
|
789 | 791 | list all available commands and options |
|
790 | 792 | debugcomplete |
|
791 | 793 | returns the completion list associated with the given command |
|
792 | 794 | debugdag format the changelog or an index DAG as a concise textual |
|
793 | 795 | description |
|
794 | 796 | debugdata dump the contents of a data file revision |
|
795 | 797 | debugdate parse and display a date |
|
796 | 798 | debugdirstate |
|
797 | 799 | show the contents of the current dirstate |
|
798 | 800 | debugdiscovery |
|
799 | 801 | runs the changeset discovery protocol in isolation |
|
800 | 802 | debugextensions |
|
801 | 803 | show information about active extensions |
|
802 | 804 | debugfileset parse and apply a fileset specification |
|
803 | 805 | debugfsinfo show information detected about current filesystem |
|
804 | 806 | debuggetbundle |
|
805 | 807 | retrieves a bundle from a repo |
|
806 | 808 | debugignore display the combined ignore pattern |
|
807 | 809 | debugindex dump the contents of an index file |
|
808 | 810 | debugindexdot |
|
809 | 811 | dump an index DAG as a graphviz dot file |
|
810 | 812 | debuginstall test Mercurial installation |
|
811 | 813 | debugknown test whether node ids are known to a repo |
|
812 | 814 | debuglocks show or modify state of locks |
|
813 | 815 | debugmergestate |
|
814 | 816 | print merge state |
|
815 | 817 | debugnamecomplete |
|
816 | 818 | complete "names" - tags, open branch names, bookmark names |
|
817 | 819 | debugobsolete |
|
818 | 820 | create arbitrary obsolete marker |
|
819 | 821 | debugoptDEP (no help text available) |
|
820 | 822 | debugoptEXP (no help text available) |
|
821 | 823 | debugpathcomplete |
|
822 | 824 | complete part or all of a tracked path |
|
823 | 825 | debugpushkey access the pushkey key/value protocol |
|
824 | 826 | debugpvec (no help text available) |
|
825 | 827 | debugrebuilddirstate |
|
826 | 828 | rebuild the dirstate as it would look like for the given |
|
827 | 829 | revision |
|
828 | 830 | debugrebuildfncache |
|
829 | 831 | rebuild the fncache file |
|
830 | 832 | debugrename dump rename information |
|
831 | 833 | debugrevlog show data and statistics about a revlog |
|
832 | 834 | debugrevspec parse and apply a revision specification |
|
833 | 835 | debugsetparents |
|
834 | 836 | manually set the parents of the current working directory |
|
835 | 837 | debugsub (no help text available) |
|
836 | 838 | debugsuccessorssets |
|
837 | 839 | show set of successors for revision |
|
838 | 840 | debugwalk show how files match on given patterns |
|
839 | 841 | debugwireargs |
|
840 | 842 | (no help text available) |
|
841 | 843 | |
|
842 | 844 | (use "hg help -v debug" to show built-in aliases and global options) |
|
843 | 845 | |
|
844 | 846 | |
|
845 | 847 | Test list of commands with command with no help text |
|
846 | 848 | |
|
847 | 849 | $ hg help helpext |
|
848 | 850 | helpext extension - no help text available |
|
849 | 851 | |
|
850 | 852 | list of commands: |
|
851 | 853 | |
|
852 | 854 | nohelp (no help text available) |
|
853 | 855 | |
|
854 | 856 | (use "hg help -v helpext" to show built-in aliases and global options) |
|
855 | 857 | |
|
856 | 858 | |
|
857 | 859 | test deprecated and experimental options are hidden in command help |
|
858 | 860 | $ hg help debugoptDEP |
|
859 | 861 | hg debugoptDEP |
|
860 | 862 | |
|
861 | 863 | (no help text available) |
|
862 | 864 | |
|
863 | 865 | options: |
|
864 | 866 | |
|
865 | 867 | (some details hidden, use --verbose to show complete help) |
|
866 | 868 | |
|
867 | 869 | $ hg help debugoptEXP |
|
868 | 870 | hg debugoptEXP |
|
869 | 871 | |
|
870 | 872 | (no help text available) |
|
871 | 873 | |
|
872 | 874 | options: |
|
873 | 875 | |
|
874 | 876 | (some details hidden, use --verbose to show complete help) |
|
875 | 877 | |
|
876 | 878 | test deprecated and experimental options is shown with -v |
|
877 | 879 | $ hg help -v debugoptDEP | grep dopt |
|
878 | 880 | --dopt option is (DEPRECATED) |
|
879 | 881 | $ hg help -v debugoptEXP | grep eopt |
|
880 | 882 | --eopt option is (EXPERIMENTAL) |
|
881 | 883 | |
|
882 | 884 | #if gettext |
|
883 | 885 | test deprecated option is hidden with translation with untranslated description |
|
884 | 886 | (use many globy for not failing on changed transaction) |
|
885 | 887 | $ LANGUAGE=sv hg help debugoptDEP |
|
886 | 888 | hg debugoptDEP |
|
887 | 889 | |
|
888 | 890 | (*) (glob) |
|
889 | 891 | |
|
890 | 892 | options: |
|
891 | 893 | |
|
892 | 894 | (some details hidden, use --verbose to show complete help) |
|
893 | 895 | #endif |
|
894 | 896 | |
|
895 | 897 | Test commands that collide with topics (issue4240) |
|
896 | 898 | |
|
897 | 899 | $ hg config -hq |
|
898 | 900 | hg config [-u] [NAME]... |
|
899 | 901 | |
|
900 | 902 | show combined config settings from all hgrc files |
|
901 | 903 | $ hg showconfig -hq |
|
902 | 904 | hg config [-u] [NAME]... |
|
903 | 905 | |
|
904 | 906 | show combined config settings from all hgrc files |
|
905 | 907 | |
|
906 | 908 | Test a help topic |
|
907 | 909 | |
|
908 | 910 | $ hg help revs |
|
909 | 911 | Specifying Single Revisions |
|
910 | 912 | """"""""""""""""""""""""""" |
|
911 | 913 | |
|
912 | 914 | Mercurial supports several ways to specify individual revisions. |
|
913 | 915 | |
|
914 | 916 | A plain integer is treated as a revision number. Negative integers are |
|
915 | 917 | treated as sequential offsets from the tip, with -1 denoting the tip, -2 |
|
916 | 918 | denoting the revision prior to the tip, and so forth. |
|
917 | 919 | |
|
918 | 920 | A 40-digit hexadecimal string is treated as a unique revision identifier. |
|
919 | 921 | |
|
920 | 922 | A hexadecimal string less than 40 characters long is treated as a unique |
|
921 | 923 | revision identifier and is referred to as a short-form identifier. A |
|
922 | 924 | short-form identifier is only valid if it is the prefix of exactly one |
|
923 | 925 | full-length identifier. |
|
924 | 926 | |
|
925 | 927 | Any other string is treated as a bookmark, tag, or branch name. A bookmark |
|
926 | 928 | is a movable pointer to a revision. A tag is a permanent name associated |
|
927 | 929 | with a revision. A branch name denotes the tipmost open branch head of |
|
928 | 930 | that branch - or if they are all closed, the tipmost closed head of the |
|
929 | 931 | branch. Bookmark, tag, and branch names must not contain the ":" |
|
930 | 932 | character. |
|
931 | 933 | |
|
932 | 934 | The reserved name "tip" always identifies the most recent revision. |
|
933 | 935 | |
|
934 | 936 | The reserved name "null" indicates the null revision. This is the revision |
|
935 | 937 | of an empty repository, and the parent of revision 0. |
|
936 | 938 | |
|
937 | 939 | The reserved name "." indicates the working directory parent. If no |
|
938 | 940 | working directory is checked out, it is equivalent to null. If an |
|
939 | 941 | uncommitted merge is in progress, "." is the revision of the first parent. |
|
940 | 942 | |
|
941 | 943 | Test repeated config section name |
|
942 | 944 | |
|
943 | 945 | $ hg help config.host |
|
944 | 946 | "http_proxy.host" |
|
945 | 947 | Host name and (optional) port of the proxy server, for example |
|
946 | 948 | "myproxy:8000". |
|
947 | 949 | |
|
948 | 950 | "smtp.host" |
|
949 | 951 | Host name of mail server, e.g. "mail.example.com". |
|
950 | 952 | |
|
951 | 953 | Unrelated trailing paragraphs shouldn't be included |
|
952 | 954 | |
|
953 | 955 | $ hg help config.extramsg | grep '^$' |
|
954 | 956 | |
|
955 | 957 | |
|
956 | 958 | Test capitalized section name |
|
957 | 959 | |
|
958 | 960 | $ hg help scripting.HGPLAIN > /dev/null |
|
959 | 961 | |
|
960 | 962 | Help subsection: |
|
961 | 963 | |
|
962 | 964 | $ hg help config.charsets |grep "Email example:" > /dev/null |
|
963 | 965 | [1] |
|
964 | 966 | |
|
965 | 967 | Show nested definitions |
|
966 | 968 | ("profiling.type"[break]"ls"[break]"stat"[break]) |
|
967 | 969 | |
|
968 | 970 | $ hg help config.type | egrep '^$'|wc -l |
|
969 | 971 | \s*3 (re) |
|
970 | 972 | |
|
971 | 973 | Last item in help config.*: |
|
972 | 974 | |
|
973 | 975 | $ hg help config.`hg help config|grep '^ "'| \ |
|
974 | 976 | > tail -1|sed 's![ "]*!!g'`| \ |
|
975 | 977 | > grep "hg help -c config" > /dev/null |
|
976 | 978 | [1] |
|
977 | 979 | |
|
978 | 980 | note to use help -c for general hg help config: |
|
979 | 981 | |
|
980 | 982 | $ hg help config |grep "hg help -c config" > /dev/null |
|
981 | 983 | |
|
982 | 984 | Test templating help |
|
983 | 985 | |
|
984 | 986 | $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) ' |
|
985 | 987 | desc String. The text of the changeset description. |
|
986 | 988 | diffstat String. Statistics of changes with the following format: |
|
987 | 989 | firstline Any text. Returns the first line of text. |
|
988 | 990 | nonempty Any text. Returns '(none)' if the string is empty. |
|
989 | 991 | |
|
990 | 992 | Test deprecated items |
|
991 | 993 | |
|
992 | 994 | $ hg help -v templating | grep currentbookmark |
|
993 | 995 | currentbookmark |
|
994 | 996 | $ hg help templating | (grep currentbookmark || true) |
|
995 | 997 | |
|
996 | 998 | Test help hooks |
|
997 | 999 | |
|
998 | 1000 | $ cat > helphook1.py <<EOF |
|
999 | 1001 | > from mercurial import help |
|
1000 | 1002 | > |
|
1001 | 1003 | > def rewrite(ui, topic, doc): |
|
1002 | 1004 | > return doc + '\nhelphook1\n' |
|
1003 | 1005 | > |
|
1004 | 1006 | > def extsetup(ui): |
|
1005 | 1007 | > help.addtopichook('revsets', rewrite) |
|
1006 | 1008 | > EOF |
|
1007 | 1009 | $ cat > helphook2.py <<EOF |
|
1008 | 1010 | > from mercurial import help |
|
1009 | 1011 | > |
|
1010 | 1012 | > def rewrite(ui, topic, doc): |
|
1011 | 1013 | > return doc + '\nhelphook2\n' |
|
1012 | 1014 | > |
|
1013 | 1015 | > def extsetup(ui): |
|
1014 | 1016 | > help.addtopichook('revsets', rewrite) |
|
1015 | 1017 | > EOF |
|
1016 | 1018 | $ echo '[extensions]' >> $HGRCPATH |
|
1017 | 1019 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
|
1018 | 1020 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
|
1019 | 1021 | $ hg help revsets | grep helphook |
|
1020 | 1022 | helphook1 |
|
1021 | 1023 | helphook2 |
|
1022 | 1024 | |
|
1023 | 1025 | Test -e / -c / -k combinations |
|
1024 | 1026 | |
|
1025 | 1027 | $ hg help -c progress |
|
1026 | 1028 | abort: no such help topic: progress |
|
1027 | 1029 | (try "hg help --keyword progress") |
|
1028 | 1030 | [255] |
|
1029 | 1031 | $ hg help -e progress |head -1 |
|
1030 | 1032 | progress extension - show progress bars for some actions (DEPRECATED) |
|
1031 | 1033 | $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' |
|
1032 | 1034 | Commands: |
|
1033 | 1035 | $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):' |
|
1034 | 1036 | Extensions: |
|
1035 | 1037 | $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):' |
|
1036 | 1038 | Extensions: |
|
1037 | 1039 | Commands: |
|
1038 | 1040 | $ hg help -c commit > /dev/null |
|
1039 | 1041 | $ hg help -e -c commit > /dev/null |
|
1040 | 1042 | $ hg help -e commit > /dev/null |
|
1041 | 1043 | abort: no such help topic: commit |
|
1042 | 1044 | (try "hg help --keyword commit") |
|
1043 | 1045 | [255] |
|
1044 | 1046 | |
|
1045 | 1047 | Test keyword search help |
|
1046 | 1048 | |
|
1047 | 1049 | $ cat > prefixedname.py <<EOF |
|
1048 | 1050 | > '''matched against word "clone" |
|
1049 | 1051 | > ''' |
|
1050 | 1052 | > EOF |
|
1051 | 1053 | $ echo '[extensions]' >> $HGRCPATH |
|
1052 | 1054 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH |
|
1053 | 1055 | $ hg help -k clone |
|
1054 | 1056 | Topics: |
|
1055 | 1057 | |
|
1056 | 1058 | config Configuration Files |
|
1057 | 1059 | extensions Using Additional Features |
|
1058 | 1060 | glossary Glossary |
|
1059 | 1061 | phases Working with Phases |
|
1060 | 1062 | subrepos Subrepositories |
|
1061 | 1063 | urls URL Paths |
|
1062 | 1064 | |
|
1063 | 1065 | Commands: |
|
1064 | 1066 | |
|
1065 | 1067 | bookmarks create a new bookmark or list existing bookmarks |
|
1066 | 1068 | clone make a copy of an existing repository |
|
1067 | 1069 | paths show aliases for remote repositories |
|
1068 | 1070 | update update working directory (or switch revisions) |
|
1069 | 1071 | |
|
1070 | 1072 | Extensions: |
|
1071 | 1073 | |
|
1074 | clonebundles server side extension to advertise pre-generated bundles to seed | |
|
1075 | clones. | |
|
1072 | 1076 | prefixedname matched against word "clone" |
|
1073 | 1077 | relink recreates hardlinks between repository clones |
|
1074 | 1078 | |
|
1075 | 1079 | Extension Commands: |
|
1076 | 1080 | |
|
1077 | 1081 | qclone clone main and patch repository at same time |
|
1078 | 1082 | |
|
1079 | 1083 | Test unfound topic |
|
1080 | 1084 | |
|
1081 | 1085 | $ hg help nonexistingtopicthatwillneverexisteverever |
|
1082 | 1086 | abort: no such help topic: nonexistingtopicthatwillneverexisteverever |
|
1083 | 1087 | (try "hg help --keyword nonexistingtopicthatwillneverexisteverever") |
|
1084 | 1088 | [255] |
|
1085 | 1089 | |
|
1086 | 1090 | Test unfound keyword |
|
1087 | 1091 | |
|
1088 | 1092 | $ hg help --keyword nonexistingwordthatwillneverexisteverever |
|
1089 | 1093 | abort: no matches |
|
1090 | 1094 | (try "hg help" for a list of topics) |
|
1091 | 1095 | [255] |
|
1092 | 1096 | |
|
1093 | 1097 | Test omit indicating for help |
|
1094 | 1098 | |
|
1095 | 1099 | $ cat > addverboseitems.py <<EOF |
|
1096 | 1100 | > '''extension to test omit indicating. |
|
1097 | 1101 | > |
|
1098 | 1102 | > This paragraph is never omitted (for extension) |
|
1099 | 1103 | > |
|
1100 | 1104 | > .. container:: verbose |
|
1101 | 1105 | > |
|
1102 | 1106 | > This paragraph is omitted, |
|
1103 | 1107 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension) |
|
1104 | 1108 | > |
|
1105 | 1109 | > This paragraph is never omitted, too (for extension) |
|
1106 | 1110 | > ''' |
|
1107 | 1111 | > |
|
1108 | 1112 | > from mercurial import help, commands |
|
1109 | 1113 | > testtopic = """This paragraph is never omitted (for topic). |
|
1110 | 1114 | > |
|
1111 | 1115 | > .. container:: verbose |
|
1112 | 1116 | > |
|
1113 | 1117 | > This paragraph is omitted, |
|
1114 | 1118 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) |
|
1115 | 1119 | > |
|
1116 | 1120 | > This paragraph is never omitted, too (for topic) |
|
1117 | 1121 | > """ |
|
1118 | 1122 | > def extsetup(ui): |
|
1119 | 1123 | > help.helptable.append((["topic-containing-verbose"], |
|
1120 | 1124 | > "This is the topic to test omit indicating.", |
|
1121 | 1125 | > lambda ui: testtopic)) |
|
1122 | 1126 | > EOF |
|
1123 | 1127 | $ echo '[extensions]' >> $HGRCPATH |
|
1124 | 1128 | $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
|
1125 | 1129 | $ hg help addverboseitems |
|
1126 | 1130 | addverboseitems extension - extension to test omit indicating. |
|
1127 | 1131 | |
|
1128 | 1132 | This paragraph is never omitted (for extension) |
|
1129 | 1133 | |
|
1130 | 1134 | This paragraph is never omitted, too (for extension) |
|
1131 | 1135 | |
|
1132 | 1136 | (some details hidden, use --verbose to show complete help) |
|
1133 | 1137 | |
|
1134 | 1138 | no commands defined |
|
1135 | 1139 | $ hg help -v addverboseitems |
|
1136 | 1140 | addverboseitems extension - extension to test omit indicating. |
|
1137 | 1141 | |
|
1138 | 1142 | This paragraph is never omitted (for extension) |
|
1139 | 1143 | |
|
1140 | 1144 | This paragraph is omitted, if "hg help" is invoked without "-v" (for |
|
1141 | 1145 | extension) |
|
1142 | 1146 | |
|
1143 | 1147 | This paragraph is never omitted, too (for extension) |
|
1144 | 1148 | |
|
1145 | 1149 | no commands defined |
|
1146 | 1150 | $ hg help topic-containing-verbose |
|
1147 | 1151 | This is the topic to test omit indicating. |
|
1148 | 1152 | """""""""""""""""""""""""""""""""""""""""" |
|
1149 | 1153 | |
|
1150 | 1154 | This paragraph is never omitted (for topic). |
|
1151 | 1155 | |
|
1152 | 1156 | This paragraph is never omitted, too (for topic) |
|
1153 | 1157 | |
|
1154 | 1158 | (some details hidden, use --verbose to show complete help) |
|
1155 | 1159 | $ hg help -v topic-containing-verbose |
|
1156 | 1160 | This is the topic to test omit indicating. |
|
1157 | 1161 | """""""""""""""""""""""""""""""""""""""""" |
|
1158 | 1162 | |
|
1159 | 1163 | This paragraph is never omitted (for topic). |
|
1160 | 1164 | |
|
1161 | 1165 | This paragraph is omitted, if "hg help" is invoked without "-v" (for |
|
1162 | 1166 | topic) |
|
1163 | 1167 | |
|
1164 | 1168 | This paragraph is never omitted, too (for topic) |
|
1165 | 1169 | |
|
1166 | 1170 | Test section lookup |
|
1167 | 1171 | |
|
1168 | 1172 | $ hg help revset.merge |
|
1169 | 1173 | "merge()" |
|
1170 | 1174 | Changeset is a merge changeset. |
|
1171 | 1175 | |
|
1172 | 1176 | $ hg help glossary.dag |
|
1173 | 1177 | DAG |
|
1174 | 1178 | The repository of changesets of a distributed version control system |
|
1175 | 1179 | (DVCS) can be described as a directed acyclic graph (DAG), consisting |
|
1176 | 1180 | of nodes and edges, where nodes correspond to changesets and edges |
|
1177 | 1181 | imply a parent -> child relation. This graph can be visualized by |
|
1178 | 1182 | graphical tools such as "hg log --graph". In Mercurial, the DAG is |
|
1179 | 1183 | limited by the requirement for children to have at most two parents. |
|
1180 | 1184 | |
|
1181 | 1185 | |
|
1182 | 1186 | $ hg help hgrc.paths |
|
1183 | 1187 | "paths" |
|
1184 | 1188 | ------- |
|
1185 | 1189 | |
|
1186 | 1190 | Assigns symbolic names to repositories. The left side is the symbolic |
|
1187 | 1191 | name, and the right gives the directory or URL that is the location of the |
|
1188 | 1192 | repository. Default paths can be declared by setting the following |
|
1189 | 1193 | entries. |
|
1190 | 1194 | |
|
1191 | 1195 | "default" |
|
1192 | 1196 | Directory or URL to use when pulling if no source is specified. |
|
1193 | 1197 | (default: repository from which the current repository was cloned) |
|
1194 | 1198 | |
|
1195 | 1199 | "default-push" |
|
1196 | 1200 | Optional. Directory or URL to use when pushing if no destination is |
|
1197 | 1201 | specified. |
|
1198 | 1202 | |
|
1199 | 1203 | Custom paths can be defined by assigning the path to a name that later can |
|
1200 | 1204 | be used from the command line. Example: |
|
1201 | 1205 | |
|
1202 | 1206 | [paths] |
|
1203 | 1207 | my_path = http://example.com/path |
|
1204 | 1208 | |
|
1205 | 1209 | To push to the path defined in "my_path" run the command: |
|
1206 | 1210 | |
|
1207 | 1211 | hg push my_path |
|
1208 | 1212 | |
|
1209 | 1213 | $ hg help glossary.mcguffin |
|
1210 | 1214 | abort: help section not found |
|
1211 | 1215 | [255] |
|
1212 | 1216 | |
|
1213 | 1217 | $ hg help glossary.mc.guffin |
|
1214 | 1218 | abort: help section not found |
|
1215 | 1219 | [255] |
|
1216 | 1220 | |
|
1217 | 1221 | $ hg help template.files |
|
1218 | 1222 | files List of strings. All files modified, added, or removed by |
|
1219 | 1223 | this changeset. |
|
1220 | 1224 | |
|
1221 | 1225 | Test dynamic list of merge tools only shows up once |
|
1222 | 1226 | $ hg help merge-tools |
|
1223 | 1227 | Merge Tools |
|
1224 | 1228 | """"""""""" |
|
1225 | 1229 | |
|
1226 | 1230 | To merge files Mercurial uses merge tools. |
|
1227 | 1231 | |
|
1228 | 1232 | A merge tool combines two different versions of a file into a merged file. |
|
1229 | 1233 | Merge tools are given the two files and the greatest common ancestor of |
|
1230 | 1234 | the two file versions, so they can determine the changes made on both |
|
1231 | 1235 | branches. |
|
1232 | 1236 | |
|
1233 | 1237 | Merge tools are used both for "hg resolve", "hg merge", "hg update", "hg |
|
1234 | 1238 | backout" and in several extensions. |
|
1235 | 1239 | |
|
1236 | 1240 | Usually, the merge tool tries to automatically reconcile the files by |
|
1237 | 1241 | combining all non-overlapping changes that occurred separately in the two |
|
1238 | 1242 | different evolutions of the same initial base file. Furthermore, some |
|
1239 | 1243 | interactive merge programs make it easier to manually resolve conflicting |
|
1240 | 1244 | merges, either in a graphical way, or by inserting some conflict markers. |
|
1241 | 1245 | Mercurial does not include any interactive merge programs but relies on |
|
1242 | 1246 | external tools for that. |
|
1243 | 1247 | |
|
1244 | 1248 | Available merge tools |
|
1245 | 1249 | ===================== |
|
1246 | 1250 | |
|
1247 | 1251 | External merge tools and their properties are configured in the merge- |
|
1248 | 1252 | tools configuration section - see hgrc(5) - but they can often just be |
|
1249 | 1253 | named by their executable. |
|
1250 | 1254 | |
|
1251 | 1255 | A merge tool is generally usable if its executable can be found on the |
|
1252 | 1256 | system and if it can handle the merge. The executable is found if it is an |
|
1253 | 1257 | absolute or relative executable path or the name of an application in the |
|
1254 | 1258 | executable search path. The tool is assumed to be able to handle the merge |
|
1255 | 1259 | if it can handle symlinks if the file is a symlink, if it can handle |
|
1256 | 1260 | binary files if the file is binary, and if a GUI is available if the tool |
|
1257 | 1261 | requires a GUI. |
|
1258 | 1262 | |
|
1259 | 1263 | There are some internal merge tools which can be used. The internal merge |
|
1260 | 1264 | tools are: |
|
1261 | 1265 | |
|
1262 | 1266 | ":dump" |
|
1263 | 1267 | Creates three versions of the files to merge, containing the contents of |
|
1264 | 1268 | local, other and base. These files can then be used to perform a merge |
|
1265 | 1269 | manually. If the file to be merged is named "a.txt", these files will |
|
1266 | 1270 | accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and |
|
1267 | 1271 | they will be placed in the same directory as "a.txt". |
|
1268 | 1272 | |
|
1269 | 1273 | ":fail" |
|
1270 | 1274 | Rather than attempting to merge files that were modified on both |
|
1271 | 1275 | branches, it marks them as unresolved. The resolve command must be used |
|
1272 | 1276 | to resolve these conflicts. |
|
1273 | 1277 | |
|
1274 | 1278 | ":local" |
|
1275 | 1279 | Uses the local version of files as the merged version. |
|
1276 | 1280 | |
|
1277 | 1281 | ":merge" |
|
1278 | 1282 | Uses the internal non-interactive simple merge algorithm for merging |
|
1279 | 1283 | files. It will fail if there are any conflicts and leave markers in the |
|
1280 | 1284 | partially merged file. Markers will have two sections, one for each side |
|
1281 | 1285 | of merge. |
|
1282 | 1286 | |
|
1283 | 1287 | ":merge-local" |
|
1284 | 1288 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
1285 | 1289 | local changes. |
|
1286 | 1290 | |
|
1287 | 1291 | ":merge-other" |
|
1288 | 1292 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
1289 | 1293 | other changes. |
|
1290 | 1294 | |
|
1291 | 1295 | ":merge3" |
|
1292 | 1296 | Uses the internal non-interactive simple merge algorithm for merging |
|
1293 | 1297 | files. It will fail if there are any conflicts and leave markers in the |
|
1294 | 1298 | partially merged file. Marker will have three sections, one from each |
|
1295 | 1299 | side of the merge and one for the base content. |
|
1296 | 1300 | |
|
1297 | 1301 | ":other" |
|
1298 | 1302 | Uses the other version of files as the merged version. |
|
1299 | 1303 | |
|
1300 | 1304 | ":prompt" |
|
1301 | 1305 | Asks the user which of the local or the other version to keep as the |
|
1302 | 1306 | merged version. |
|
1303 | 1307 | |
|
1304 | 1308 | ":tagmerge" |
|
1305 | 1309 | Uses the internal tag merge algorithm (experimental). |
|
1306 | 1310 | |
|
1307 | 1311 | ":union" |
|
1308 | 1312 | Uses the internal non-interactive simple merge algorithm for merging |
|
1309 | 1313 | files. It will use both left and right sides for conflict regions. No |
|
1310 | 1314 | markers are inserted. |
|
1311 | 1315 | |
|
1312 | 1316 | Internal tools are always available and do not require a GUI but will by |
|
1313 | 1317 | default not handle symlinks or binary files. |
|
1314 | 1318 | |
|
1315 | 1319 | Choosing a merge tool |
|
1316 | 1320 | ===================== |
|
1317 | 1321 | |
|
1318 | 1322 | Mercurial uses these rules when deciding which merge tool to use: |
|
1319 | 1323 | |
|
1320 | 1324 | 1. If a tool has been specified with the --tool option to merge or |
|
1321 | 1325 | resolve, it is used. If it is the name of a tool in the merge-tools |
|
1322 | 1326 | configuration, its configuration is used. Otherwise the specified tool |
|
1323 | 1327 | must be executable by the shell. |
|
1324 | 1328 | 2. If the "HGMERGE" environment variable is present, its value is used and |
|
1325 | 1329 | must be executable by the shell. |
|
1326 | 1330 | 3. If the filename of the file to be merged matches any of the patterns in |
|
1327 | 1331 | the merge-patterns configuration section, the first usable merge tool |
|
1328 | 1332 | corresponding to a matching pattern is used. Here, binary capabilities |
|
1329 | 1333 | of the merge tool are not considered. |
|
1330 | 1334 | 4. If ui.merge is set it will be considered next. If the value is not the |
|
1331 | 1335 | name of a configured tool, the specified value is used and must be |
|
1332 | 1336 | executable by the shell. Otherwise the named tool is used if it is |
|
1333 | 1337 | usable. |
|
1334 | 1338 | 5. If any usable merge tools are present in the merge-tools configuration |
|
1335 | 1339 | section, the one with the highest priority is used. |
|
1336 | 1340 | 6. If a program named "hgmerge" can be found on the system, it is used - |
|
1337 | 1341 | but it will by default not be used for symlinks and binary files. |
|
1338 | 1342 | 7. If the file to be merged is not binary and is not a symlink, then |
|
1339 | 1343 | internal ":merge" is used. |
|
1340 | 1344 | 8. The merge of the file fails and must be resolved before commit. |
|
1341 | 1345 | |
|
1342 | 1346 | Note: |
|
1343 | 1347 | After selecting a merge program, Mercurial will by default attempt to |
|
1344 | 1348 | merge the files using a simple merge algorithm first. Only if it |
|
1345 | 1349 | doesn't succeed because of conflicting changes Mercurial will actually |
|
1346 | 1350 | execute the merge program. Whether to use the simple merge algorithm |
|
1347 | 1351 | first can be controlled by the premerge setting of the merge tool. |
|
1348 | 1352 | Premerge is enabled by default unless the file is binary or a symlink. |
|
1349 | 1353 | |
|
1350 | 1354 | See the merge-tools and ui sections of hgrc(5) for details on the |
|
1351 | 1355 | configuration of merge tools. |
|
1352 | 1356 | |
|
1353 | 1357 | Test usage of section marks in help documents |
|
1354 | 1358 | |
|
1355 | 1359 | $ cd "$TESTDIR"/../doc |
|
1356 | 1360 | $ python check-seclevel.py |
|
1357 | 1361 | $ cd $TESTTMP |
|
1358 | 1362 | |
|
1359 | 1363 | #if serve |
|
1360 | 1364 | |
|
1361 | 1365 | Test the help pages in hgweb. |
|
1362 | 1366 | |
|
1363 | 1367 | Dish up an empty repo; serve it cold. |
|
1364 | 1368 | |
|
1365 | 1369 | $ hg init "$TESTTMP/test" |
|
1366 | 1370 | $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid |
|
1367 | 1371 | $ cat hg.pid >> $DAEMON_PIDS |
|
1368 | 1372 | |
|
1369 | 1373 | $ get-with-headers.py 127.0.0.1:$HGPORT "help" |
|
1370 | 1374 | 200 Script output follows |
|
1371 | 1375 | |
|
1372 | 1376 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
1373 | 1377 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
1374 | 1378 | <head> |
|
1375 | 1379 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
1376 | 1380 | <meta name="robots" content="index, nofollow" /> |
|
1377 | 1381 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
1378 | 1382 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
1379 | 1383 | |
|
1380 | 1384 | <title>Help: Index</title> |
|
1381 | 1385 | </head> |
|
1382 | 1386 | <body> |
|
1383 | 1387 | |
|
1384 | 1388 | <div class="container"> |
|
1385 | 1389 | <div class="menu"> |
|
1386 | 1390 | <div class="logo"> |
|
1387 | 1391 | <a href="https://mercurial-scm.org/"> |
|
1388 | 1392 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
1389 | 1393 | </div> |
|
1390 | 1394 | <ul> |
|
1391 | 1395 | <li><a href="/shortlog">log</a></li> |
|
1392 | 1396 | <li><a href="/graph">graph</a></li> |
|
1393 | 1397 | <li><a href="/tags">tags</a></li> |
|
1394 | 1398 | <li><a href="/bookmarks">bookmarks</a></li> |
|
1395 | 1399 | <li><a href="/branches">branches</a></li> |
|
1396 | 1400 | </ul> |
|
1397 | 1401 | <ul> |
|
1398 | 1402 | <li class="active">help</li> |
|
1399 | 1403 | </ul> |
|
1400 | 1404 | </div> |
|
1401 | 1405 | |
|
1402 | 1406 | <div class="main"> |
|
1403 | 1407 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
1404 | 1408 | <form class="search" action="/log"> |
|
1405 | 1409 | |
|
1406 | 1410 | <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
1407 | 1411 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
1408 | 1412 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
1409 | 1413 | </form> |
|
1410 | 1414 | <table class="bigtable"> |
|
1411 | 1415 | <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr> |
|
1412 | 1416 | |
|
1413 | 1417 | <tr><td> |
|
1414 | 1418 | <a href="/help/config"> |
|
1415 | 1419 | config |
|
1416 | 1420 | </a> |
|
1417 | 1421 | </td><td> |
|
1418 | 1422 | Configuration Files |
|
1419 | 1423 | </td></tr> |
|
1420 | 1424 | <tr><td> |
|
1421 | 1425 | <a href="/help/dates"> |
|
1422 | 1426 | dates |
|
1423 | 1427 | </a> |
|
1424 | 1428 | </td><td> |
|
1425 | 1429 | Date Formats |
|
1426 | 1430 | </td></tr> |
|
1427 | 1431 | <tr><td> |
|
1428 | 1432 | <a href="/help/diffs"> |
|
1429 | 1433 | diffs |
|
1430 | 1434 | </a> |
|
1431 | 1435 | </td><td> |
|
1432 | 1436 | Diff Formats |
|
1433 | 1437 | </td></tr> |
|
1434 | 1438 | <tr><td> |
|
1435 | 1439 | <a href="/help/environment"> |
|
1436 | 1440 | environment |
|
1437 | 1441 | </a> |
|
1438 | 1442 | </td><td> |
|
1439 | 1443 | Environment Variables |
|
1440 | 1444 | </td></tr> |
|
1441 | 1445 | <tr><td> |
|
1442 | 1446 | <a href="/help/extensions"> |
|
1443 | 1447 | extensions |
|
1444 | 1448 | </a> |
|
1445 | 1449 | </td><td> |
|
1446 | 1450 | Using Additional Features |
|
1447 | 1451 | </td></tr> |
|
1448 | 1452 | <tr><td> |
|
1449 | 1453 | <a href="/help/filesets"> |
|
1450 | 1454 | filesets |
|
1451 | 1455 | </a> |
|
1452 | 1456 | </td><td> |
|
1453 | 1457 | Specifying File Sets |
|
1454 | 1458 | </td></tr> |
|
1455 | 1459 | <tr><td> |
|
1456 | 1460 | <a href="/help/glossary"> |
|
1457 | 1461 | glossary |
|
1458 | 1462 | </a> |
|
1459 | 1463 | </td><td> |
|
1460 | 1464 | Glossary |
|
1461 | 1465 | </td></tr> |
|
1462 | 1466 | <tr><td> |
|
1463 | 1467 | <a href="/help/hgignore"> |
|
1464 | 1468 | hgignore |
|
1465 | 1469 | </a> |
|
1466 | 1470 | </td><td> |
|
1467 | 1471 | Syntax for Mercurial Ignore Files |
|
1468 | 1472 | </td></tr> |
|
1469 | 1473 | <tr><td> |
|
1470 | 1474 | <a href="/help/hgweb"> |
|
1471 | 1475 | hgweb |
|
1472 | 1476 | </a> |
|
1473 | 1477 | </td><td> |
|
1474 | 1478 | Configuring hgweb |
|
1475 | 1479 | </td></tr> |
|
1476 | 1480 | <tr><td> |
|
1477 | 1481 | <a href="/help/merge-tools"> |
|
1478 | 1482 | merge-tools |
|
1479 | 1483 | </a> |
|
1480 | 1484 | </td><td> |
|
1481 | 1485 | Merge Tools |
|
1482 | 1486 | </td></tr> |
|
1483 | 1487 | <tr><td> |
|
1484 | 1488 | <a href="/help/multirevs"> |
|
1485 | 1489 | multirevs |
|
1486 | 1490 | </a> |
|
1487 | 1491 | </td><td> |
|
1488 | 1492 | Specifying Multiple Revisions |
|
1489 | 1493 | </td></tr> |
|
1490 | 1494 | <tr><td> |
|
1491 | 1495 | <a href="/help/patterns"> |
|
1492 | 1496 | patterns |
|
1493 | 1497 | </a> |
|
1494 | 1498 | </td><td> |
|
1495 | 1499 | File Name Patterns |
|
1496 | 1500 | </td></tr> |
|
1497 | 1501 | <tr><td> |
|
1498 | 1502 | <a href="/help/phases"> |
|
1499 | 1503 | phases |
|
1500 | 1504 | </a> |
|
1501 | 1505 | </td><td> |
|
1502 | 1506 | Working with Phases |
|
1503 | 1507 | </td></tr> |
|
1504 | 1508 | <tr><td> |
|
1505 | 1509 | <a href="/help/revisions"> |
|
1506 | 1510 | revisions |
|
1507 | 1511 | </a> |
|
1508 | 1512 | </td><td> |
|
1509 | 1513 | Specifying Single Revisions |
|
1510 | 1514 | </td></tr> |
|
1511 | 1515 | <tr><td> |
|
1512 | 1516 | <a href="/help/revsets"> |
|
1513 | 1517 | revsets |
|
1514 | 1518 | </a> |
|
1515 | 1519 | </td><td> |
|
1516 | 1520 | Specifying Revision Sets |
|
1517 | 1521 | </td></tr> |
|
1518 | 1522 | <tr><td> |
|
1519 | 1523 | <a href="/help/scripting"> |
|
1520 | 1524 | scripting |
|
1521 | 1525 | </a> |
|
1522 | 1526 | </td><td> |
|
1523 | 1527 | Using Mercurial from scripts and automation |
|
1524 | 1528 | </td></tr> |
|
1525 | 1529 | <tr><td> |
|
1526 | 1530 | <a href="/help/subrepos"> |
|
1527 | 1531 | subrepos |
|
1528 | 1532 | </a> |
|
1529 | 1533 | </td><td> |
|
1530 | 1534 | Subrepositories |
|
1531 | 1535 | </td></tr> |
|
1532 | 1536 | <tr><td> |
|
1533 | 1537 | <a href="/help/templating"> |
|
1534 | 1538 | templating |
|
1535 | 1539 | </a> |
|
1536 | 1540 | </td><td> |
|
1537 | 1541 | Template Usage |
|
1538 | 1542 | </td></tr> |
|
1539 | 1543 | <tr><td> |
|
1540 | 1544 | <a href="/help/urls"> |
|
1541 | 1545 | urls |
|
1542 | 1546 | </a> |
|
1543 | 1547 | </td><td> |
|
1544 | 1548 | URL Paths |
|
1545 | 1549 | </td></tr> |
|
1546 | 1550 | <tr><td> |
|
1547 | 1551 | <a href="/help/topic-containing-verbose"> |
|
1548 | 1552 | topic-containing-verbose |
|
1549 | 1553 | </a> |
|
1550 | 1554 | </td><td> |
|
1551 | 1555 | This is the topic to test omit indicating. |
|
1552 | 1556 | </td></tr> |
|
1553 | 1557 | |
|
1554 | 1558 | <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr> |
|
1555 | 1559 | |
|
1556 | 1560 | <tr><td> |
|
1557 | 1561 | <a href="/help/add"> |
|
1558 | 1562 | add |
|
1559 | 1563 | </a> |
|
1560 | 1564 | </td><td> |
|
1561 | 1565 | add the specified files on the next commit |
|
1562 | 1566 | </td></tr> |
|
1563 | 1567 | <tr><td> |
|
1564 | 1568 | <a href="/help/annotate"> |
|
1565 | 1569 | annotate |
|
1566 | 1570 | </a> |
|
1567 | 1571 | </td><td> |
|
1568 | 1572 | show changeset information by line for each file |
|
1569 | 1573 | </td></tr> |
|
1570 | 1574 | <tr><td> |
|
1571 | 1575 | <a href="/help/clone"> |
|
1572 | 1576 | clone |
|
1573 | 1577 | </a> |
|
1574 | 1578 | </td><td> |
|
1575 | 1579 | make a copy of an existing repository |
|
1576 | 1580 | </td></tr> |
|
1577 | 1581 | <tr><td> |
|
1578 | 1582 | <a href="/help/commit"> |
|
1579 | 1583 | commit |
|
1580 | 1584 | </a> |
|
1581 | 1585 | </td><td> |
|
1582 | 1586 | commit the specified files or all outstanding changes |
|
1583 | 1587 | </td></tr> |
|
1584 | 1588 | <tr><td> |
|
1585 | 1589 | <a href="/help/diff"> |
|
1586 | 1590 | diff |
|
1587 | 1591 | </a> |
|
1588 | 1592 | </td><td> |
|
1589 | 1593 | diff repository (or selected files) |
|
1590 | 1594 | </td></tr> |
|
1591 | 1595 | <tr><td> |
|
1592 | 1596 | <a href="/help/export"> |
|
1593 | 1597 | export |
|
1594 | 1598 | </a> |
|
1595 | 1599 | </td><td> |
|
1596 | 1600 | dump the header and diffs for one or more changesets |
|
1597 | 1601 | </td></tr> |
|
1598 | 1602 | <tr><td> |
|
1599 | 1603 | <a href="/help/forget"> |
|
1600 | 1604 | forget |
|
1601 | 1605 | </a> |
|
1602 | 1606 | </td><td> |
|
1603 | 1607 | forget the specified files on the next commit |
|
1604 | 1608 | </td></tr> |
|
1605 | 1609 | <tr><td> |
|
1606 | 1610 | <a href="/help/init"> |
|
1607 | 1611 | init |
|
1608 | 1612 | </a> |
|
1609 | 1613 | </td><td> |
|
1610 | 1614 | create a new repository in the given directory |
|
1611 | 1615 | </td></tr> |
|
1612 | 1616 | <tr><td> |
|
1613 | 1617 | <a href="/help/log"> |
|
1614 | 1618 | log |
|
1615 | 1619 | </a> |
|
1616 | 1620 | </td><td> |
|
1617 | 1621 | show revision history of entire repository or files |
|
1618 | 1622 | </td></tr> |
|
1619 | 1623 | <tr><td> |
|
1620 | 1624 | <a href="/help/merge"> |
|
1621 | 1625 | merge |
|
1622 | 1626 | </a> |
|
1623 | 1627 | </td><td> |
|
1624 | 1628 | merge another revision into working directory |
|
1625 | 1629 | </td></tr> |
|
1626 | 1630 | <tr><td> |
|
1627 | 1631 | <a href="/help/pull"> |
|
1628 | 1632 | pull |
|
1629 | 1633 | </a> |
|
1630 | 1634 | </td><td> |
|
1631 | 1635 | pull changes from the specified source |
|
1632 | 1636 | </td></tr> |
|
1633 | 1637 | <tr><td> |
|
1634 | 1638 | <a href="/help/push"> |
|
1635 | 1639 | push |
|
1636 | 1640 | </a> |
|
1637 | 1641 | </td><td> |
|
1638 | 1642 | push changes to the specified destination |
|
1639 | 1643 | </td></tr> |
|
1640 | 1644 | <tr><td> |
|
1641 | 1645 | <a href="/help/remove"> |
|
1642 | 1646 | remove |
|
1643 | 1647 | </a> |
|
1644 | 1648 | </td><td> |
|
1645 | 1649 | remove the specified files on the next commit |
|
1646 | 1650 | </td></tr> |
|
1647 | 1651 | <tr><td> |
|
1648 | 1652 | <a href="/help/serve"> |
|
1649 | 1653 | serve |
|
1650 | 1654 | </a> |
|
1651 | 1655 | </td><td> |
|
1652 | 1656 | start stand-alone webserver |
|
1653 | 1657 | </td></tr> |
|
1654 | 1658 | <tr><td> |
|
1655 | 1659 | <a href="/help/status"> |
|
1656 | 1660 | status |
|
1657 | 1661 | </a> |
|
1658 | 1662 | </td><td> |
|
1659 | 1663 | show changed files in the working directory |
|
1660 | 1664 | </td></tr> |
|
1661 | 1665 | <tr><td> |
|
1662 | 1666 | <a href="/help/summary"> |
|
1663 | 1667 | summary |
|
1664 | 1668 | </a> |
|
1665 | 1669 | </td><td> |
|
1666 | 1670 | summarize working directory state |
|
1667 | 1671 | </td></tr> |
|
1668 | 1672 | <tr><td> |
|
1669 | 1673 | <a href="/help/update"> |
|
1670 | 1674 | update |
|
1671 | 1675 | </a> |
|
1672 | 1676 | </td><td> |
|
1673 | 1677 | update working directory (or switch revisions) |
|
1674 | 1678 | </td></tr> |
|
1675 | 1679 | |
|
1676 | 1680 | <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr> |
|
1677 | 1681 | |
|
1678 | 1682 | <tr><td> |
|
1679 | 1683 | <a href="/help/addremove"> |
|
1680 | 1684 | addremove |
|
1681 | 1685 | </a> |
|
1682 | 1686 | </td><td> |
|
1683 | 1687 | add all new files, delete all missing files |
|
1684 | 1688 | </td></tr> |
|
1685 | 1689 | <tr><td> |
|
1686 | 1690 | <a href="/help/archive"> |
|
1687 | 1691 | archive |
|
1688 | 1692 | </a> |
|
1689 | 1693 | </td><td> |
|
1690 | 1694 | create an unversioned archive of a repository revision |
|
1691 | 1695 | </td></tr> |
|
1692 | 1696 | <tr><td> |
|
1693 | 1697 | <a href="/help/backout"> |
|
1694 | 1698 | backout |
|
1695 | 1699 | </a> |
|
1696 | 1700 | </td><td> |
|
1697 | 1701 | reverse effect of earlier changeset |
|
1698 | 1702 | </td></tr> |
|
1699 | 1703 | <tr><td> |
|
1700 | 1704 | <a href="/help/bisect"> |
|
1701 | 1705 | bisect |
|
1702 | 1706 | </a> |
|
1703 | 1707 | </td><td> |
|
1704 | 1708 | subdivision search of changesets |
|
1705 | 1709 | </td></tr> |
|
1706 | 1710 | <tr><td> |
|
1707 | 1711 | <a href="/help/bookmarks"> |
|
1708 | 1712 | bookmarks |
|
1709 | 1713 | </a> |
|
1710 | 1714 | </td><td> |
|
1711 | 1715 | create a new bookmark or list existing bookmarks |
|
1712 | 1716 | </td></tr> |
|
1713 | 1717 | <tr><td> |
|
1714 | 1718 | <a href="/help/branch"> |
|
1715 | 1719 | branch |
|
1716 | 1720 | </a> |
|
1717 | 1721 | </td><td> |
|
1718 | 1722 | set or show the current branch name |
|
1719 | 1723 | </td></tr> |
|
1720 | 1724 | <tr><td> |
|
1721 | 1725 | <a href="/help/branches"> |
|
1722 | 1726 | branches |
|
1723 | 1727 | </a> |
|
1724 | 1728 | </td><td> |
|
1725 | 1729 | list repository named branches |
|
1726 | 1730 | </td></tr> |
|
1727 | 1731 | <tr><td> |
|
1728 | 1732 | <a href="/help/bundle"> |
|
1729 | 1733 | bundle |
|
1730 | 1734 | </a> |
|
1731 | 1735 | </td><td> |
|
1732 | 1736 | create a changegroup file |
|
1733 | 1737 | </td></tr> |
|
1734 | 1738 | <tr><td> |
|
1735 | 1739 | <a href="/help/cat"> |
|
1736 | 1740 | cat |
|
1737 | 1741 | </a> |
|
1738 | 1742 | </td><td> |
|
1739 | 1743 | output the current or given revision of files |
|
1740 | 1744 | </td></tr> |
|
1741 | 1745 | <tr><td> |
|
1742 | 1746 | <a href="/help/config"> |
|
1743 | 1747 | config |
|
1744 | 1748 | </a> |
|
1745 | 1749 | </td><td> |
|
1746 | 1750 | show combined config settings from all hgrc files |
|
1747 | 1751 | </td></tr> |
|
1748 | 1752 | <tr><td> |
|
1749 | 1753 | <a href="/help/copy"> |
|
1750 | 1754 | copy |
|
1751 | 1755 | </a> |
|
1752 | 1756 | </td><td> |
|
1753 | 1757 | mark files as copied for the next commit |
|
1754 | 1758 | </td></tr> |
|
1755 | 1759 | <tr><td> |
|
1756 | 1760 | <a href="/help/files"> |
|
1757 | 1761 | files |
|
1758 | 1762 | </a> |
|
1759 | 1763 | </td><td> |
|
1760 | 1764 | list tracked files |
|
1761 | 1765 | </td></tr> |
|
1762 | 1766 | <tr><td> |
|
1763 | 1767 | <a href="/help/graft"> |
|
1764 | 1768 | graft |
|
1765 | 1769 | </a> |
|
1766 | 1770 | </td><td> |
|
1767 | 1771 | copy changes from other branches onto the current branch |
|
1768 | 1772 | </td></tr> |
|
1769 | 1773 | <tr><td> |
|
1770 | 1774 | <a href="/help/grep"> |
|
1771 | 1775 | grep |
|
1772 | 1776 | </a> |
|
1773 | 1777 | </td><td> |
|
1774 | 1778 | search for a pattern in specified files and revisions |
|
1775 | 1779 | </td></tr> |
|
1776 | 1780 | <tr><td> |
|
1777 | 1781 | <a href="/help/heads"> |
|
1778 | 1782 | heads |
|
1779 | 1783 | </a> |
|
1780 | 1784 | </td><td> |
|
1781 | 1785 | show branch heads |
|
1782 | 1786 | </td></tr> |
|
1783 | 1787 | <tr><td> |
|
1784 | 1788 | <a href="/help/help"> |
|
1785 | 1789 | help |
|
1786 | 1790 | </a> |
|
1787 | 1791 | </td><td> |
|
1788 | 1792 | show help for a given topic or a help overview |
|
1789 | 1793 | </td></tr> |
|
1790 | 1794 | <tr><td> |
|
1791 | 1795 | <a href="/help/identify"> |
|
1792 | 1796 | identify |
|
1793 | 1797 | </a> |
|
1794 | 1798 | </td><td> |
|
1795 | 1799 | identify the working directory or specified revision |
|
1796 | 1800 | </td></tr> |
|
1797 | 1801 | <tr><td> |
|
1798 | 1802 | <a href="/help/import"> |
|
1799 | 1803 | import |
|
1800 | 1804 | </a> |
|
1801 | 1805 | </td><td> |
|
1802 | 1806 | import an ordered set of patches |
|
1803 | 1807 | </td></tr> |
|
1804 | 1808 | <tr><td> |
|
1805 | 1809 | <a href="/help/incoming"> |
|
1806 | 1810 | incoming |
|
1807 | 1811 | </a> |
|
1808 | 1812 | </td><td> |
|
1809 | 1813 | show new changesets found in source |
|
1810 | 1814 | </td></tr> |
|
1811 | 1815 | <tr><td> |
|
1812 | 1816 | <a href="/help/manifest"> |
|
1813 | 1817 | manifest |
|
1814 | 1818 | </a> |
|
1815 | 1819 | </td><td> |
|
1816 | 1820 | output the current or given revision of the project manifest |
|
1817 | 1821 | </td></tr> |
|
1818 | 1822 | <tr><td> |
|
1819 | 1823 | <a href="/help/nohelp"> |
|
1820 | 1824 | nohelp |
|
1821 | 1825 | </a> |
|
1822 | 1826 | </td><td> |
|
1823 | 1827 | (no help text available) |
|
1824 | 1828 | </td></tr> |
|
1825 | 1829 | <tr><td> |
|
1826 | 1830 | <a href="/help/outgoing"> |
|
1827 | 1831 | outgoing |
|
1828 | 1832 | </a> |
|
1829 | 1833 | </td><td> |
|
1830 | 1834 | show changesets not found in the destination |
|
1831 | 1835 | </td></tr> |
|
1832 | 1836 | <tr><td> |
|
1833 | 1837 | <a href="/help/paths"> |
|
1834 | 1838 | paths |
|
1835 | 1839 | </a> |
|
1836 | 1840 | </td><td> |
|
1837 | 1841 | show aliases for remote repositories |
|
1838 | 1842 | </td></tr> |
|
1839 | 1843 | <tr><td> |
|
1840 | 1844 | <a href="/help/phase"> |
|
1841 | 1845 | phase |
|
1842 | 1846 | </a> |
|
1843 | 1847 | </td><td> |
|
1844 | 1848 | set or show the current phase name |
|
1845 | 1849 | </td></tr> |
|
1846 | 1850 | <tr><td> |
|
1847 | 1851 | <a href="/help/recover"> |
|
1848 | 1852 | recover |
|
1849 | 1853 | </a> |
|
1850 | 1854 | </td><td> |
|
1851 | 1855 | roll back an interrupted transaction |
|
1852 | 1856 | </td></tr> |
|
1853 | 1857 | <tr><td> |
|
1854 | 1858 | <a href="/help/rename"> |
|
1855 | 1859 | rename |
|
1856 | 1860 | </a> |
|
1857 | 1861 | </td><td> |
|
1858 | 1862 | rename files; equivalent of copy + remove |
|
1859 | 1863 | </td></tr> |
|
1860 | 1864 | <tr><td> |
|
1861 | 1865 | <a href="/help/resolve"> |
|
1862 | 1866 | resolve |
|
1863 | 1867 | </a> |
|
1864 | 1868 | </td><td> |
|
1865 | 1869 | redo merges or set/view the merge status of files |
|
1866 | 1870 | </td></tr> |
|
1867 | 1871 | <tr><td> |
|
1868 | 1872 | <a href="/help/revert"> |
|
1869 | 1873 | revert |
|
1870 | 1874 | </a> |
|
1871 | 1875 | </td><td> |
|
1872 | 1876 | restore files to their checkout state |
|
1873 | 1877 | </td></tr> |
|
1874 | 1878 | <tr><td> |
|
1875 | 1879 | <a href="/help/root"> |
|
1876 | 1880 | root |
|
1877 | 1881 | </a> |
|
1878 | 1882 | </td><td> |
|
1879 | 1883 | print the root (top) of the current working directory |
|
1880 | 1884 | </td></tr> |
|
1881 | 1885 | <tr><td> |
|
1882 | 1886 | <a href="/help/tag"> |
|
1883 | 1887 | tag |
|
1884 | 1888 | </a> |
|
1885 | 1889 | </td><td> |
|
1886 | 1890 | add one or more tags for the current or given revision |
|
1887 | 1891 | </td></tr> |
|
1888 | 1892 | <tr><td> |
|
1889 | 1893 | <a href="/help/tags"> |
|
1890 | 1894 | tags |
|
1891 | 1895 | </a> |
|
1892 | 1896 | </td><td> |
|
1893 | 1897 | list repository tags |
|
1894 | 1898 | </td></tr> |
|
1895 | 1899 | <tr><td> |
|
1896 | 1900 | <a href="/help/unbundle"> |
|
1897 | 1901 | unbundle |
|
1898 | 1902 | </a> |
|
1899 | 1903 | </td><td> |
|
1900 | 1904 | apply one or more changegroup files |
|
1901 | 1905 | </td></tr> |
|
1902 | 1906 | <tr><td> |
|
1903 | 1907 | <a href="/help/verify"> |
|
1904 | 1908 | verify |
|
1905 | 1909 | </a> |
|
1906 | 1910 | </td><td> |
|
1907 | 1911 | verify the integrity of the repository |
|
1908 | 1912 | </td></tr> |
|
1909 | 1913 | <tr><td> |
|
1910 | 1914 | <a href="/help/version"> |
|
1911 | 1915 | version |
|
1912 | 1916 | </a> |
|
1913 | 1917 | </td><td> |
|
1914 | 1918 | output version and copyright information |
|
1915 | 1919 | </td></tr> |
|
1916 | 1920 | </table> |
|
1917 | 1921 | </div> |
|
1918 | 1922 | </div> |
|
1919 | 1923 | |
|
1920 | 1924 | <script type="text/javascript">process_dates()</script> |
|
1921 | 1925 | |
|
1922 | 1926 | |
|
1923 | 1927 | </body> |
|
1924 | 1928 | </html> |
|
1925 | 1929 | |
|
1926 | 1930 | |
|
1927 | 1931 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/add" |
|
1928 | 1932 | 200 Script output follows |
|
1929 | 1933 | |
|
1930 | 1934 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
1931 | 1935 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
1932 | 1936 | <head> |
|
1933 | 1937 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
1934 | 1938 | <meta name="robots" content="index, nofollow" /> |
|
1935 | 1939 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
1936 | 1940 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
1937 | 1941 | |
|
1938 | 1942 | <title>Help: add</title> |
|
1939 | 1943 | </head> |
|
1940 | 1944 | <body> |
|
1941 | 1945 | |
|
1942 | 1946 | <div class="container"> |
|
1943 | 1947 | <div class="menu"> |
|
1944 | 1948 | <div class="logo"> |
|
1945 | 1949 | <a href="https://mercurial-scm.org/"> |
|
1946 | 1950 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
1947 | 1951 | </div> |
|
1948 | 1952 | <ul> |
|
1949 | 1953 | <li><a href="/shortlog">log</a></li> |
|
1950 | 1954 | <li><a href="/graph">graph</a></li> |
|
1951 | 1955 | <li><a href="/tags">tags</a></li> |
|
1952 | 1956 | <li><a href="/bookmarks">bookmarks</a></li> |
|
1953 | 1957 | <li><a href="/branches">branches</a></li> |
|
1954 | 1958 | </ul> |
|
1955 | 1959 | <ul> |
|
1956 | 1960 | <li class="active"><a href="/help">help</a></li> |
|
1957 | 1961 | </ul> |
|
1958 | 1962 | </div> |
|
1959 | 1963 | |
|
1960 | 1964 | <div class="main"> |
|
1961 | 1965 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
1962 | 1966 | <h3>Help: add</h3> |
|
1963 | 1967 | |
|
1964 | 1968 | <form class="search" action="/log"> |
|
1965 | 1969 | |
|
1966 | 1970 | <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
1967 | 1971 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
1968 | 1972 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
1969 | 1973 | </form> |
|
1970 | 1974 | <div id="doc"> |
|
1971 | 1975 | <p> |
|
1972 | 1976 | hg add [OPTION]... [FILE]... |
|
1973 | 1977 | </p> |
|
1974 | 1978 | <p> |
|
1975 | 1979 | add the specified files on the next commit |
|
1976 | 1980 | </p> |
|
1977 | 1981 | <p> |
|
1978 | 1982 | Schedule files to be version controlled and added to the |
|
1979 | 1983 | repository. |
|
1980 | 1984 | </p> |
|
1981 | 1985 | <p> |
|
1982 | 1986 | The files will be added to the repository at the next commit. To |
|
1983 | 1987 | undo an add before that, see "hg forget". |
|
1984 | 1988 | </p> |
|
1985 | 1989 | <p> |
|
1986 | 1990 | If no names are given, add all files to the repository. |
|
1987 | 1991 | </p> |
|
1988 | 1992 | <p> |
|
1989 | 1993 | An example showing how new (unknown) files are added |
|
1990 | 1994 | automatically by "hg add": |
|
1991 | 1995 | </p> |
|
1992 | 1996 | <pre> |
|
1993 | 1997 | \$ ls (re) |
|
1994 | 1998 | foo.c |
|
1995 | 1999 | \$ hg status (re) |
|
1996 | 2000 | ? foo.c |
|
1997 | 2001 | \$ hg add (re) |
|
1998 | 2002 | adding foo.c |
|
1999 | 2003 | \$ hg status (re) |
|
2000 | 2004 | A foo.c |
|
2001 | 2005 | </pre> |
|
2002 | 2006 | <p> |
|
2003 | 2007 | Returns 0 if all files are successfully added. |
|
2004 | 2008 | </p> |
|
2005 | 2009 | <p> |
|
2006 | 2010 | options ([+] can be repeated): |
|
2007 | 2011 | </p> |
|
2008 | 2012 | <table> |
|
2009 | 2013 | <tr><td>-I</td> |
|
2010 | 2014 | <td>--include PATTERN [+]</td> |
|
2011 | 2015 | <td>include names matching the given patterns</td></tr> |
|
2012 | 2016 | <tr><td>-X</td> |
|
2013 | 2017 | <td>--exclude PATTERN [+]</td> |
|
2014 | 2018 | <td>exclude names matching the given patterns</td></tr> |
|
2015 | 2019 | <tr><td>-S</td> |
|
2016 | 2020 | <td>--subrepos</td> |
|
2017 | 2021 | <td>recurse into subrepositories</td></tr> |
|
2018 | 2022 | <tr><td>-n</td> |
|
2019 | 2023 | <td>--dry-run</td> |
|
2020 | 2024 | <td>do not perform actions, just print output</td></tr> |
|
2021 | 2025 | </table> |
|
2022 | 2026 | <p> |
|
2023 | 2027 | global options ([+] can be repeated): |
|
2024 | 2028 | </p> |
|
2025 | 2029 | <table> |
|
2026 | 2030 | <tr><td>-R</td> |
|
2027 | 2031 | <td>--repository REPO</td> |
|
2028 | 2032 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
2029 | 2033 | <tr><td></td> |
|
2030 | 2034 | <td>--cwd DIR</td> |
|
2031 | 2035 | <td>change working directory</td></tr> |
|
2032 | 2036 | <tr><td>-y</td> |
|
2033 | 2037 | <td>--noninteractive</td> |
|
2034 | 2038 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
2035 | 2039 | <tr><td>-q</td> |
|
2036 | 2040 | <td>--quiet</td> |
|
2037 | 2041 | <td>suppress output</td></tr> |
|
2038 | 2042 | <tr><td>-v</td> |
|
2039 | 2043 | <td>--verbose</td> |
|
2040 | 2044 | <td>enable additional output</td></tr> |
|
2041 | 2045 | <tr><td></td> |
|
2042 | 2046 | <td>--config CONFIG [+]</td> |
|
2043 | 2047 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
2044 | 2048 | <tr><td></td> |
|
2045 | 2049 | <td>--debug</td> |
|
2046 | 2050 | <td>enable debugging output</td></tr> |
|
2047 | 2051 | <tr><td></td> |
|
2048 | 2052 | <td>--debugger</td> |
|
2049 | 2053 | <td>start debugger</td></tr> |
|
2050 | 2054 | <tr><td></td> |
|
2051 | 2055 | <td>--encoding ENCODE</td> |
|
2052 | 2056 | <td>set the charset encoding (default: ascii)</td></tr> |
|
2053 | 2057 | <tr><td></td> |
|
2054 | 2058 | <td>--encodingmode MODE</td> |
|
2055 | 2059 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
2056 | 2060 | <tr><td></td> |
|
2057 | 2061 | <td>--traceback</td> |
|
2058 | 2062 | <td>always print a traceback on exception</td></tr> |
|
2059 | 2063 | <tr><td></td> |
|
2060 | 2064 | <td>--time</td> |
|
2061 | 2065 | <td>time how long the command takes</td></tr> |
|
2062 | 2066 | <tr><td></td> |
|
2063 | 2067 | <td>--profile</td> |
|
2064 | 2068 | <td>print command execution profile</td></tr> |
|
2065 | 2069 | <tr><td></td> |
|
2066 | 2070 | <td>--version</td> |
|
2067 | 2071 | <td>output version information and exit</td></tr> |
|
2068 | 2072 | <tr><td>-h</td> |
|
2069 | 2073 | <td>--help</td> |
|
2070 | 2074 | <td>display help and exit</td></tr> |
|
2071 | 2075 | <tr><td></td> |
|
2072 | 2076 | <td>--hidden</td> |
|
2073 | 2077 | <td>consider hidden changesets</td></tr> |
|
2074 | 2078 | </table> |
|
2075 | 2079 | |
|
2076 | 2080 | </div> |
|
2077 | 2081 | </div> |
|
2078 | 2082 | </div> |
|
2079 | 2083 | |
|
2080 | 2084 | <script type="text/javascript">process_dates()</script> |
|
2081 | 2085 | |
|
2082 | 2086 | |
|
2083 | 2087 | </body> |
|
2084 | 2088 | </html> |
|
2085 | 2089 | |
|
2086 | 2090 | |
|
2087 | 2091 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove" |
|
2088 | 2092 | 200 Script output follows |
|
2089 | 2093 | |
|
2090 | 2094 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2091 | 2095 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2092 | 2096 | <head> |
|
2093 | 2097 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2094 | 2098 | <meta name="robots" content="index, nofollow" /> |
|
2095 | 2099 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2096 | 2100 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2097 | 2101 | |
|
2098 | 2102 | <title>Help: remove</title> |
|
2099 | 2103 | </head> |
|
2100 | 2104 | <body> |
|
2101 | 2105 | |
|
2102 | 2106 | <div class="container"> |
|
2103 | 2107 | <div class="menu"> |
|
2104 | 2108 | <div class="logo"> |
|
2105 | 2109 | <a href="https://mercurial-scm.org/"> |
|
2106 | 2110 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2107 | 2111 | </div> |
|
2108 | 2112 | <ul> |
|
2109 | 2113 | <li><a href="/shortlog">log</a></li> |
|
2110 | 2114 | <li><a href="/graph">graph</a></li> |
|
2111 | 2115 | <li><a href="/tags">tags</a></li> |
|
2112 | 2116 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2113 | 2117 | <li><a href="/branches">branches</a></li> |
|
2114 | 2118 | </ul> |
|
2115 | 2119 | <ul> |
|
2116 | 2120 | <li class="active"><a href="/help">help</a></li> |
|
2117 | 2121 | </ul> |
|
2118 | 2122 | </div> |
|
2119 | 2123 | |
|
2120 | 2124 | <div class="main"> |
|
2121 | 2125 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2122 | 2126 | <h3>Help: remove</h3> |
|
2123 | 2127 | |
|
2124 | 2128 | <form class="search" action="/log"> |
|
2125 | 2129 | |
|
2126 | 2130 | <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
2127 | 2131 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2128 | 2132 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2129 | 2133 | </form> |
|
2130 | 2134 | <div id="doc"> |
|
2131 | 2135 | <p> |
|
2132 | 2136 | hg remove [OPTION]... FILE... |
|
2133 | 2137 | </p> |
|
2134 | 2138 | <p> |
|
2135 | 2139 | aliases: rm |
|
2136 | 2140 | </p> |
|
2137 | 2141 | <p> |
|
2138 | 2142 | remove the specified files on the next commit |
|
2139 | 2143 | </p> |
|
2140 | 2144 | <p> |
|
2141 | 2145 | Schedule the indicated files for removal from the current branch. |
|
2142 | 2146 | </p> |
|
2143 | 2147 | <p> |
|
2144 | 2148 | This command schedules the files to be removed at the next commit. |
|
2145 | 2149 | To undo a remove before that, see "hg revert". To undo added |
|
2146 | 2150 | files, see "hg forget". |
|
2147 | 2151 | </p> |
|
2148 | 2152 | <p> |
|
2149 | 2153 | -A/--after can be used to remove only files that have already |
|
2150 | 2154 | been deleted, -f/--force can be used to force deletion, and -Af |
|
2151 | 2155 | can be used to remove files from the next revision without |
|
2152 | 2156 | deleting them from the working directory. |
|
2153 | 2157 | </p> |
|
2154 | 2158 | <p> |
|
2155 | 2159 | The following table details the behavior of remove for different |
|
2156 | 2160 | file states (columns) and option combinations (rows). The file |
|
2157 | 2161 | states are Added [A], Clean [C], Modified [M] and Missing [!] |
|
2158 | 2162 | (as reported by "hg status"). The actions are Warn, Remove |
|
2159 | 2163 | (from branch) and Delete (from disk): |
|
2160 | 2164 | </p> |
|
2161 | 2165 | <table> |
|
2162 | 2166 | <tr><td>opt/state</td> |
|
2163 | 2167 | <td>A</td> |
|
2164 | 2168 | <td>C</td> |
|
2165 | 2169 | <td>M</td> |
|
2166 | 2170 | <td>!</td></tr> |
|
2167 | 2171 | <tr><td>none</td> |
|
2168 | 2172 | <td>W</td> |
|
2169 | 2173 | <td>RD</td> |
|
2170 | 2174 | <td>W</td> |
|
2171 | 2175 | <td>R</td></tr> |
|
2172 | 2176 | <tr><td>-f</td> |
|
2173 | 2177 | <td>R</td> |
|
2174 | 2178 | <td>RD</td> |
|
2175 | 2179 | <td>RD</td> |
|
2176 | 2180 | <td>R</td></tr> |
|
2177 | 2181 | <tr><td>-A</td> |
|
2178 | 2182 | <td>W</td> |
|
2179 | 2183 | <td>W</td> |
|
2180 | 2184 | <td>W</td> |
|
2181 | 2185 | <td>R</td></tr> |
|
2182 | 2186 | <tr><td>-Af</td> |
|
2183 | 2187 | <td>R</td> |
|
2184 | 2188 | <td>R</td> |
|
2185 | 2189 | <td>R</td> |
|
2186 | 2190 | <td>R</td></tr> |
|
2187 | 2191 | </table> |
|
2188 | 2192 | <p> |
|
2189 | 2193 | Note that remove never deletes files in Added [A] state from the |
|
2190 | 2194 | working directory, not even if option --force is specified. |
|
2191 | 2195 | </p> |
|
2192 | 2196 | <p> |
|
2193 | 2197 | Returns 0 on success, 1 if any warnings encountered. |
|
2194 | 2198 | </p> |
|
2195 | 2199 | <p> |
|
2196 | 2200 | options ([+] can be repeated): |
|
2197 | 2201 | </p> |
|
2198 | 2202 | <table> |
|
2199 | 2203 | <tr><td>-A</td> |
|
2200 | 2204 | <td>--after</td> |
|
2201 | 2205 | <td>record delete for missing files</td></tr> |
|
2202 | 2206 | <tr><td>-f</td> |
|
2203 | 2207 | <td>--force</td> |
|
2204 | 2208 | <td>remove (and delete) file even if added or modified</td></tr> |
|
2205 | 2209 | <tr><td>-S</td> |
|
2206 | 2210 | <td>--subrepos</td> |
|
2207 | 2211 | <td>recurse into subrepositories</td></tr> |
|
2208 | 2212 | <tr><td>-I</td> |
|
2209 | 2213 | <td>--include PATTERN [+]</td> |
|
2210 | 2214 | <td>include names matching the given patterns</td></tr> |
|
2211 | 2215 | <tr><td>-X</td> |
|
2212 | 2216 | <td>--exclude PATTERN [+]</td> |
|
2213 | 2217 | <td>exclude names matching the given patterns</td></tr> |
|
2214 | 2218 | </table> |
|
2215 | 2219 | <p> |
|
2216 | 2220 | global options ([+] can be repeated): |
|
2217 | 2221 | </p> |
|
2218 | 2222 | <table> |
|
2219 | 2223 | <tr><td>-R</td> |
|
2220 | 2224 | <td>--repository REPO</td> |
|
2221 | 2225 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
2222 | 2226 | <tr><td></td> |
|
2223 | 2227 | <td>--cwd DIR</td> |
|
2224 | 2228 | <td>change working directory</td></tr> |
|
2225 | 2229 | <tr><td>-y</td> |
|
2226 | 2230 | <td>--noninteractive</td> |
|
2227 | 2231 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
2228 | 2232 | <tr><td>-q</td> |
|
2229 | 2233 | <td>--quiet</td> |
|
2230 | 2234 | <td>suppress output</td></tr> |
|
2231 | 2235 | <tr><td>-v</td> |
|
2232 | 2236 | <td>--verbose</td> |
|
2233 | 2237 | <td>enable additional output</td></tr> |
|
2234 | 2238 | <tr><td></td> |
|
2235 | 2239 | <td>--config CONFIG [+]</td> |
|
2236 | 2240 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
2237 | 2241 | <tr><td></td> |
|
2238 | 2242 | <td>--debug</td> |
|
2239 | 2243 | <td>enable debugging output</td></tr> |
|
2240 | 2244 | <tr><td></td> |
|
2241 | 2245 | <td>--debugger</td> |
|
2242 | 2246 | <td>start debugger</td></tr> |
|
2243 | 2247 | <tr><td></td> |
|
2244 | 2248 | <td>--encoding ENCODE</td> |
|
2245 | 2249 | <td>set the charset encoding (default: ascii)</td></tr> |
|
2246 | 2250 | <tr><td></td> |
|
2247 | 2251 | <td>--encodingmode MODE</td> |
|
2248 | 2252 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
2249 | 2253 | <tr><td></td> |
|
2250 | 2254 | <td>--traceback</td> |
|
2251 | 2255 | <td>always print a traceback on exception</td></tr> |
|
2252 | 2256 | <tr><td></td> |
|
2253 | 2257 | <td>--time</td> |
|
2254 | 2258 | <td>time how long the command takes</td></tr> |
|
2255 | 2259 | <tr><td></td> |
|
2256 | 2260 | <td>--profile</td> |
|
2257 | 2261 | <td>print command execution profile</td></tr> |
|
2258 | 2262 | <tr><td></td> |
|
2259 | 2263 | <td>--version</td> |
|
2260 | 2264 | <td>output version information and exit</td></tr> |
|
2261 | 2265 | <tr><td>-h</td> |
|
2262 | 2266 | <td>--help</td> |
|
2263 | 2267 | <td>display help and exit</td></tr> |
|
2264 | 2268 | <tr><td></td> |
|
2265 | 2269 | <td>--hidden</td> |
|
2266 | 2270 | <td>consider hidden changesets</td></tr> |
|
2267 | 2271 | </table> |
|
2268 | 2272 | |
|
2269 | 2273 | </div> |
|
2270 | 2274 | </div> |
|
2271 | 2275 | </div> |
|
2272 | 2276 | |
|
2273 | 2277 | <script type="text/javascript">process_dates()</script> |
|
2274 | 2278 | |
|
2275 | 2279 | |
|
2276 | 2280 | </body> |
|
2277 | 2281 | </html> |
|
2278 | 2282 | |
|
2279 | 2283 | |
|
2280 | 2284 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions" |
|
2281 | 2285 | 200 Script output follows |
|
2282 | 2286 | |
|
2283 | 2287 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2284 | 2288 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2285 | 2289 | <head> |
|
2286 | 2290 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2287 | 2291 | <meta name="robots" content="index, nofollow" /> |
|
2288 | 2292 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2289 | 2293 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2290 | 2294 | |
|
2291 | 2295 | <title>Help: revisions</title> |
|
2292 | 2296 | </head> |
|
2293 | 2297 | <body> |
|
2294 | 2298 | |
|
2295 | 2299 | <div class="container"> |
|
2296 | 2300 | <div class="menu"> |
|
2297 | 2301 | <div class="logo"> |
|
2298 | 2302 | <a href="https://mercurial-scm.org/"> |
|
2299 | 2303 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2300 | 2304 | </div> |
|
2301 | 2305 | <ul> |
|
2302 | 2306 | <li><a href="/shortlog">log</a></li> |
|
2303 | 2307 | <li><a href="/graph">graph</a></li> |
|
2304 | 2308 | <li><a href="/tags">tags</a></li> |
|
2305 | 2309 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2306 | 2310 | <li><a href="/branches">branches</a></li> |
|
2307 | 2311 | </ul> |
|
2308 | 2312 | <ul> |
|
2309 | 2313 | <li class="active"><a href="/help">help</a></li> |
|
2310 | 2314 | </ul> |
|
2311 | 2315 | </div> |
|
2312 | 2316 | |
|
2313 | 2317 | <div class="main"> |
|
2314 | 2318 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2315 | 2319 | <h3>Help: revisions</h3> |
|
2316 | 2320 | |
|
2317 | 2321 | <form class="search" action="/log"> |
|
2318 | 2322 | |
|
2319 | 2323 | <p><input name="rev" id="search1" type="text" size="30" /></p> |
|
2320 | 2324 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2321 | 2325 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2322 | 2326 | </form> |
|
2323 | 2327 | <div id="doc"> |
|
2324 | 2328 | <h1>Specifying Single Revisions</h1> |
|
2325 | 2329 | <p> |
|
2326 | 2330 | Mercurial supports several ways to specify individual revisions. |
|
2327 | 2331 | </p> |
|
2328 | 2332 | <p> |
|
2329 | 2333 | A plain integer is treated as a revision number. Negative integers are |
|
2330 | 2334 | treated as sequential offsets from the tip, with -1 denoting the tip, |
|
2331 | 2335 | -2 denoting the revision prior to the tip, and so forth. |
|
2332 | 2336 | </p> |
|
2333 | 2337 | <p> |
|
2334 | 2338 | A 40-digit hexadecimal string is treated as a unique revision |
|
2335 | 2339 | identifier. |
|
2336 | 2340 | </p> |
|
2337 | 2341 | <p> |
|
2338 | 2342 | A hexadecimal string less than 40 characters long is treated as a |
|
2339 | 2343 | unique revision identifier and is referred to as a short-form |
|
2340 | 2344 | identifier. A short-form identifier is only valid if it is the prefix |
|
2341 | 2345 | of exactly one full-length identifier. |
|
2342 | 2346 | </p> |
|
2343 | 2347 | <p> |
|
2344 | 2348 | Any other string is treated as a bookmark, tag, or branch name. A |
|
2345 | 2349 | bookmark is a movable pointer to a revision. A tag is a permanent name |
|
2346 | 2350 | associated with a revision. A branch name denotes the tipmost open branch head |
|
2347 | 2351 | of that branch - or if they are all closed, the tipmost closed head of the |
|
2348 | 2352 | branch. Bookmark, tag, and branch names must not contain the ":" character. |
|
2349 | 2353 | </p> |
|
2350 | 2354 | <p> |
|
2351 | 2355 | The reserved name "tip" always identifies the most recent revision. |
|
2352 | 2356 | </p> |
|
2353 | 2357 | <p> |
|
2354 | 2358 | The reserved name "null" indicates the null revision. This is the |
|
2355 | 2359 | revision of an empty repository, and the parent of revision 0. |
|
2356 | 2360 | </p> |
|
2357 | 2361 | <p> |
|
2358 | 2362 | The reserved name "." indicates the working directory parent. If no |
|
2359 | 2363 | working directory is checked out, it is equivalent to null. If an |
|
2360 | 2364 | uncommitted merge is in progress, "." is the revision of the first |
|
2361 | 2365 | parent. |
|
2362 | 2366 | </p> |
|
2363 | 2367 | |
|
2364 | 2368 | </div> |
|
2365 | 2369 | </div> |
|
2366 | 2370 | </div> |
|
2367 | 2371 | |
|
2368 | 2372 | <script type="text/javascript">process_dates()</script> |
|
2369 | 2373 | |
|
2370 | 2374 | |
|
2371 | 2375 | </body> |
|
2372 | 2376 | </html> |
|
2373 | 2377 | |
|
2374 | 2378 | |
|
2375 | 2379 | $ killdaemons.py |
|
2376 | 2380 | |
|
2377 | 2381 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now