Show More
@@ -1,2365 +1,2368 | |||||
1 | The Mercurial system uses a set of configuration files to control |
|
1 | The Mercurial system uses a set of configuration files to control | |
2 | aspects of its behavior. |
|
2 | aspects of its behavior. | |
3 |
|
3 | |||
4 | Troubleshooting |
|
4 | Troubleshooting | |
5 | =============== |
|
5 | =============== | |
6 |
|
6 | |||
7 | If you're having problems with your configuration, |
|
7 | If you're having problems with your configuration, | |
8 | :hg:`config --debug` can help you understand what is introducing |
|
8 | :hg:`config --debug` can help you understand what is introducing | |
9 | a setting into your environment. |
|
9 | a setting into your environment. | |
10 |
|
10 | |||
11 | See :hg:`help config.syntax` and :hg:`help config.files` |
|
11 | See :hg:`help config.syntax` and :hg:`help config.files` | |
12 | for information about how and where to override things. |
|
12 | for information about how and where to override things. | |
13 |
|
13 | |||
14 | Structure |
|
14 | Structure | |
15 | ========= |
|
15 | ========= | |
16 |
|
16 | |||
17 | The configuration files use a simple ini-file format. A configuration |
|
17 | The configuration files use a simple ini-file format. A configuration | |
18 | file consists of sections, led by a ``[section]`` header and followed |
|
18 | file consists of sections, led by a ``[section]`` header and followed | |
19 | by ``name = value`` entries:: |
|
19 | by ``name = value`` entries:: | |
20 |
|
20 | |||
21 | [ui] |
|
21 | [ui] | |
22 | username = Firstname Lastname <firstname.lastname@example.net> |
|
22 | username = Firstname Lastname <firstname.lastname@example.net> | |
23 | verbose = True |
|
23 | verbose = True | |
24 |
|
24 | |||
25 | The above entries will be referred to as ``ui.username`` and |
|
25 | The above entries will be referred to as ``ui.username`` and | |
26 | ``ui.verbose``, respectively. See :hg:`help config.syntax`. |
|
26 | ``ui.verbose``, respectively. See :hg:`help config.syntax`. | |
27 |
|
27 | |||
28 | Files |
|
28 | Files | |
29 | ===== |
|
29 | ===== | |
30 |
|
30 | |||
31 | Mercurial reads configuration data from several files, if they exist. |
|
31 | Mercurial reads configuration data from several files, if they exist. | |
32 | These files do not exist by default and you will have to create the |
|
32 | These files do not exist by default and you will have to create the | |
33 | appropriate configuration files yourself: |
|
33 | appropriate configuration files yourself: | |
34 |
|
34 | |||
35 | Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file. |
|
35 | Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file. | |
36 |
|
36 | |||
37 | Global configuration like the username setting is typically put into: |
|
37 | Global configuration like the username setting is typically put into: | |
38 |
|
38 | |||
39 | .. container:: windows |
|
39 | .. container:: windows | |
40 |
|
40 | |||
41 | - ``%USERPROFILE%\mercurial.ini`` (on Windows) |
|
41 | - ``%USERPROFILE%\mercurial.ini`` (on Windows) | |
42 |
|
42 | |||
43 | .. container:: unix.plan9 |
|
43 | .. container:: unix.plan9 | |
44 |
|
44 | |||
45 | - ``$HOME/.hgrc`` (on Unix, Plan9) |
|
45 | - ``$HOME/.hgrc`` (on Unix, Plan9) | |
46 |
|
46 | |||
47 | The names of these files depend on the system on which Mercurial is |
|
47 | The names of these files depend on the system on which Mercurial is | |
48 | installed. ``*.rc`` files from a single directory are read in |
|
48 | installed. ``*.rc`` files from a single directory are read in | |
49 | alphabetical order, later ones overriding earlier ones. Where multiple |
|
49 | alphabetical order, later ones overriding earlier ones. Where multiple | |
50 | paths are given below, settings from earlier paths override later |
|
50 | paths are given below, settings from earlier paths override later | |
51 | ones. |
|
51 | ones. | |
52 |
|
52 | |||
53 | .. container:: verbose.unix |
|
53 | .. container:: verbose.unix | |
54 |
|
54 | |||
55 | On Unix, the following files are consulted: |
|
55 | On Unix, the following files are consulted: | |
56 |
|
56 | |||
57 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
57 | - ``<repo>/.hg/hgrc`` (per-repository) | |
58 | - ``$HOME/.hgrc`` (per-user) |
|
58 | - ``$HOME/.hgrc`` (per-user) | |
59 | - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user) |
|
59 | - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user) | |
60 | - ``<install-root>/etc/mercurial/hgrc`` (per-installation) |
|
60 | - ``<install-root>/etc/mercurial/hgrc`` (per-installation) | |
61 | - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation) |
|
61 | - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation) | |
62 | - ``/etc/mercurial/hgrc`` (per-system) |
|
62 | - ``/etc/mercurial/hgrc`` (per-system) | |
63 | - ``/etc/mercurial/hgrc.d/*.rc`` (per-system) |
|
63 | - ``/etc/mercurial/hgrc.d/*.rc`` (per-system) | |
64 | - ``<internal>/default.d/*.rc`` (defaults) |
|
64 | - ``<internal>/default.d/*.rc`` (defaults) | |
65 |
|
65 | |||
66 | .. container:: verbose.windows |
|
66 | .. container:: verbose.windows | |
67 |
|
67 | |||
68 | On Windows, the following files are consulted: |
|
68 | On Windows, the following files are consulted: | |
69 |
|
69 | |||
70 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
70 | - ``<repo>/.hg/hgrc`` (per-repository) | |
71 | - ``%USERPROFILE%\.hgrc`` (per-user) |
|
71 | - ``%USERPROFILE%\.hgrc`` (per-user) | |
72 | - ``%USERPROFILE%\Mercurial.ini`` (per-user) |
|
72 | - ``%USERPROFILE%\Mercurial.ini`` (per-user) | |
73 | - ``%HOME%\.hgrc`` (per-user) |
|
73 | - ``%HOME%\.hgrc`` (per-user) | |
74 | - ``%HOME%\Mercurial.ini`` (per-user) |
|
74 | - ``%HOME%\Mercurial.ini`` (per-user) | |
75 | - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation) |
|
75 | - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation) | |
76 | - ``<install-dir>\hgrc.d\*.rc`` (per-installation) |
|
76 | - ``<install-dir>\hgrc.d\*.rc`` (per-installation) | |
77 | - ``<install-dir>\Mercurial.ini`` (per-installation) |
|
77 | - ``<install-dir>\Mercurial.ini`` (per-installation) | |
78 | - ``<internal>/default.d/*.rc`` (defaults) |
|
78 | - ``<internal>/default.d/*.rc`` (defaults) | |
79 |
|
79 | |||
80 | .. note:: |
|
80 | .. note:: | |
81 |
|
81 | |||
82 | The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` |
|
82 | The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` | |
83 | is used when running 32-bit Python on 64-bit Windows. |
|
83 | is used when running 32-bit Python on 64-bit Windows. | |
84 |
|
84 | |||
85 | .. container:: windows |
|
85 | .. container:: windows | |
86 |
|
86 | |||
87 | On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. |
|
87 | On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. | |
88 |
|
88 | |||
89 | .. container:: verbose.plan9 |
|
89 | .. container:: verbose.plan9 | |
90 |
|
90 | |||
91 | On Plan9, the following files are consulted: |
|
91 | On Plan9, the following files are consulted: | |
92 |
|
92 | |||
93 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
93 | - ``<repo>/.hg/hgrc`` (per-repository) | |
94 | - ``$home/lib/hgrc`` (per-user) |
|
94 | - ``$home/lib/hgrc`` (per-user) | |
95 | - ``<install-root>/lib/mercurial/hgrc`` (per-installation) |
|
95 | - ``<install-root>/lib/mercurial/hgrc`` (per-installation) | |
96 | - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation) |
|
96 | - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation) | |
97 | - ``/lib/mercurial/hgrc`` (per-system) |
|
97 | - ``/lib/mercurial/hgrc`` (per-system) | |
98 | - ``/lib/mercurial/hgrc.d/*.rc`` (per-system) |
|
98 | - ``/lib/mercurial/hgrc.d/*.rc`` (per-system) | |
99 | - ``<internal>/default.d/*.rc`` (defaults) |
|
99 | - ``<internal>/default.d/*.rc`` (defaults) | |
100 |
|
100 | |||
101 | Per-repository configuration options only apply in a |
|
101 | Per-repository configuration options only apply in a | |
102 | particular repository. This file is not version-controlled, and |
|
102 | particular repository. This file is not version-controlled, and | |
103 | will not get transferred during a "clone" operation. Options in |
|
103 | will not get transferred during a "clone" operation. Options in | |
104 | this file override options in all other configuration files. |
|
104 | this file override options in all other configuration files. | |
105 |
|
105 | |||
106 | .. container:: unix.plan9 |
|
106 | .. container:: unix.plan9 | |
107 |
|
107 | |||
108 | On Plan 9 and Unix, most of this file will be ignored if it doesn't |
|
108 | On Plan 9 and Unix, most of this file will be ignored if it doesn't | |
109 | belong to a trusted user or to a trusted group. See |
|
109 | belong to a trusted user or to a trusted group. See | |
110 | :hg:`help config.trusted` for more details. |
|
110 | :hg:`help config.trusted` for more details. | |
111 |
|
111 | |||
112 | Per-user configuration file(s) are for the user running Mercurial. Options |
|
112 | Per-user configuration file(s) are for the user running Mercurial. Options | |
113 | in these files apply to all Mercurial commands executed by this user in any |
|
113 | in these files apply to all Mercurial commands executed by this user in any | |
114 | directory. Options in these files override per-system and per-installation |
|
114 | directory. Options in these files override per-system and per-installation | |
115 | options. |
|
115 | options. | |
116 |
|
116 | |||
117 | Per-installation configuration files are searched for in the |
|
117 | Per-installation configuration files are searched for in the | |
118 | directory where Mercurial is installed. ``<install-root>`` is the |
|
118 | directory where Mercurial is installed. ``<install-root>`` is the | |
119 | parent directory of the **hg** executable (or symlink) being run. |
|
119 | parent directory of the **hg** executable (or symlink) being run. | |
120 |
|
120 | |||
121 | .. container:: unix.plan9 |
|
121 | .. container:: unix.plan9 | |
122 |
|
122 | |||
123 | For example, if installed in ``/shared/tools/bin/hg``, Mercurial |
|
123 | For example, if installed in ``/shared/tools/bin/hg``, Mercurial | |
124 | will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these |
|
124 | will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these | |
125 | files apply to all Mercurial commands executed by any user in any |
|
125 | files apply to all Mercurial commands executed by any user in any | |
126 | directory. |
|
126 | directory. | |
127 |
|
127 | |||
128 | Per-installation configuration files are for the system on |
|
128 | Per-installation configuration files are for the system on | |
129 | which Mercurial is running. Options in these files apply to all |
|
129 | which Mercurial is running. Options in these files apply to all | |
130 | Mercurial commands executed by any user in any directory. Registry |
|
130 | Mercurial commands executed by any user in any directory. Registry | |
131 | keys contain PATH-like strings, every part of which must reference |
|
131 | keys contain PATH-like strings, every part of which must reference | |
132 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
|
132 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will | |
133 | be read. Mercurial checks each of these locations in the specified |
|
133 | be read. Mercurial checks each of these locations in the specified | |
134 | order until one or more configuration files are detected. |
|
134 | order until one or more configuration files are detected. | |
135 |
|
135 | |||
136 | Per-system configuration files are for the system on which Mercurial |
|
136 | Per-system configuration files are for the system on which Mercurial | |
137 | is running. Options in these files apply to all Mercurial commands |
|
137 | is running. Options in these files apply to all Mercurial commands | |
138 | executed by any user in any directory. Options in these files |
|
138 | executed by any user in any directory. Options in these files | |
139 | override per-installation options. |
|
139 | override per-installation options. | |
140 |
|
140 | |||
141 | Mercurial comes with some default configuration. The default configuration |
|
141 | Mercurial comes with some default configuration. The default configuration | |
142 | files are installed with Mercurial and will be overwritten on upgrades. Default |
|
142 | files are installed with Mercurial and will be overwritten on upgrades. Default | |
143 | configuration files should never be edited by users or administrators but can |
|
143 | configuration files should never be edited by users or administrators but can | |
144 | be overridden in other configuration files. So far the directory only contains |
|
144 | be overridden in other configuration files. So far the directory only contains | |
145 | merge tool configuration but packagers can also put other default configuration |
|
145 | merge tool configuration but packagers can also put other default configuration | |
146 | there. |
|
146 | there. | |
147 |
|
147 | |||
148 | Syntax |
|
148 | Syntax | |
149 | ====== |
|
149 | ====== | |
150 |
|
150 | |||
151 | A configuration file consists of sections, led by a ``[section]`` header |
|
151 | A configuration file consists of sections, led by a ``[section]`` header | |
152 | and followed by ``name = value`` entries (sometimes called |
|
152 | and followed by ``name = value`` entries (sometimes called | |
153 | ``configuration keys``):: |
|
153 | ``configuration keys``):: | |
154 |
|
154 | |||
155 | [spam] |
|
155 | [spam] | |
156 | eggs=ham |
|
156 | eggs=ham | |
157 | green= |
|
157 | green= | |
158 | eggs |
|
158 | eggs | |
159 |
|
159 | |||
160 | Each line contains one entry. If the lines that follow are indented, |
|
160 | Each line contains one entry. If the lines that follow are indented, | |
161 | they are treated as continuations of that entry. Leading whitespace is |
|
161 | they are treated as continuations of that entry. Leading whitespace is | |
162 | removed from values. Empty lines are skipped. Lines beginning with |
|
162 | removed from values. Empty lines are skipped. Lines beginning with | |
163 | ``#`` or ``;`` are ignored and may be used to provide comments. |
|
163 | ``#`` or ``;`` are ignored and may be used to provide comments. | |
164 |
|
164 | |||
165 | Configuration keys can be set multiple times, in which case Mercurial |
|
165 | Configuration keys can be set multiple times, in which case Mercurial | |
166 | will use the value that was configured last. As an example:: |
|
166 | will use the value that was configured last. As an example:: | |
167 |
|
167 | |||
168 | [spam] |
|
168 | [spam] | |
169 | eggs=large |
|
169 | eggs=large | |
170 | ham=serrano |
|
170 | ham=serrano | |
171 | eggs=small |
|
171 | eggs=small | |
172 |
|
172 | |||
173 | This would set the configuration key named ``eggs`` to ``small``. |
|
173 | This would set the configuration key named ``eggs`` to ``small``. | |
174 |
|
174 | |||
175 | It is also possible to define a section multiple times. A section can |
|
175 | It is also possible to define a section multiple times. A section can | |
176 | be redefined on the same and/or on different configuration files. For |
|
176 | be redefined on the same and/or on different configuration files. For | |
177 | example:: |
|
177 | example:: | |
178 |
|
178 | |||
179 | [foo] |
|
179 | [foo] | |
180 | eggs=large |
|
180 | eggs=large | |
181 | ham=serrano |
|
181 | ham=serrano | |
182 | eggs=small |
|
182 | eggs=small | |
183 |
|
183 | |||
184 | [bar] |
|
184 | [bar] | |
185 | eggs=ham |
|
185 | eggs=ham | |
186 | green= |
|
186 | green= | |
187 | eggs |
|
187 | eggs | |
188 |
|
188 | |||
189 | [foo] |
|
189 | [foo] | |
190 | ham=prosciutto |
|
190 | ham=prosciutto | |
191 | eggs=medium |
|
191 | eggs=medium | |
192 | bread=toasted |
|
192 | bread=toasted | |
193 |
|
193 | |||
194 | This would set the ``eggs``, ``ham``, and ``bread`` configuration keys |
|
194 | This would set the ``eggs``, ``ham``, and ``bread`` configuration keys | |
195 | of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``, |
|
195 | of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``, | |
196 | respectively. As you can see there only thing that matters is the last |
|
196 | respectively. As you can see there only thing that matters is the last | |
197 | value that was set for each of the configuration keys. |
|
197 | value that was set for each of the configuration keys. | |
198 |
|
198 | |||
199 | If a configuration key is set multiple times in different |
|
199 | If a configuration key is set multiple times in different | |
200 | configuration files the final value will depend on the order in which |
|
200 | configuration files the final value will depend on the order in which | |
201 | the different configuration files are read, with settings from earlier |
|
201 | the different configuration files are read, with settings from earlier | |
202 | paths overriding later ones as described on the ``Files`` section |
|
202 | paths overriding later ones as described on the ``Files`` section | |
203 | above. |
|
203 | above. | |
204 |
|
204 | |||
205 | A line of the form ``%include file`` will include ``file`` into the |
|
205 | A line of the form ``%include file`` will include ``file`` into the | |
206 | current configuration file. The inclusion is recursive, which means |
|
206 | current configuration file. The inclusion is recursive, which means | |
207 | that included files can include other files. Filenames are relative to |
|
207 | that included files can include other files. Filenames are relative to | |
208 | the configuration file in which the ``%include`` directive is found. |
|
208 | the configuration file in which the ``%include`` directive is found. | |
209 | Environment variables and ``~user`` constructs are expanded in |
|
209 | Environment variables and ``~user`` constructs are expanded in | |
210 | ``file``. This lets you do something like:: |
|
210 | ``file``. This lets you do something like:: | |
211 |
|
211 | |||
212 | %include ~/.hgrc.d/$HOST.rc |
|
212 | %include ~/.hgrc.d/$HOST.rc | |
213 |
|
213 | |||
214 | to include a different configuration file on each computer you use. |
|
214 | to include a different configuration file on each computer you use. | |
215 |
|
215 | |||
216 | A line with ``%unset name`` will remove ``name`` from the current |
|
216 | A line with ``%unset name`` will remove ``name`` from the current | |
217 | section, if it has been set previously. |
|
217 | section, if it has been set previously. | |
218 |
|
218 | |||
219 | The values are either free-form text strings, lists of text strings, |
|
219 | The values are either free-form text strings, lists of text strings, | |
220 | or Boolean values. Boolean values can be set to true using any of "1", |
|
220 | or Boolean values. Boolean values can be set to true using any of "1", | |
221 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" |
|
221 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" | |
222 | (all case insensitive). |
|
222 | (all case insensitive). | |
223 |
|
223 | |||
224 | List values are separated by whitespace or comma, except when values are |
|
224 | List values are separated by whitespace or comma, except when values are | |
225 | placed in double quotation marks:: |
|
225 | placed in double quotation marks:: | |
226 |
|
226 | |||
227 | allow_read = "John Doe, PhD", brian, betty |
|
227 | allow_read = "John Doe, PhD", brian, betty | |
228 |
|
228 | |||
229 | Quotation marks can be escaped by prefixing them with a backslash. Only |
|
229 | Quotation marks can be escaped by prefixing them with a backslash. Only | |
230 | quotation marks at the beginning of a word is counted as a quotation |
|
230 | quotation marks at the beginning of a word is counted as a quotation | |
231 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). |
|
231 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). | |
232 |
|
232 | |||
233 | Sections |
|
233 | Sections | |
234 | ======== |
|
234 | ======== | |
235 |
|
235 | |||
236 | This section describes the different sections that may appear in a |
|
236 | This section describes the different sections that may appear in a | |
237 | Mercurial configuration file, the purpose of each section, its possible |
|
237 | Mercurial configuration file, the purpose of each section, its possible | |
238 | keys, and their possible values. |
|
238 | keys, and their possible values. | |
239 |
|
239 | |||
240 | ``alias`` |
|
240 | ``alias`` | |
241 | --------- |
|
241 | --------- | |
242 |
|
242 | |||
243 | Defines command aliases. |
|
243 | Defines command aliases. | |
244 |
|
244 | |||
245 | Aliases allow you to define your own commands in terms of other |
|
245 | Aliases allow you to define your own commands in terms of other | |
246 | commands (or aliases), optionally including arguments. Positional |
|
246 | commands (or aliases), optionally including arguments. Positional | |
247 | arguments in the form of ``$1``, ``$2``, etc. in the alias definition |
|
247 | arguments in the form of ``$1``, ``$2``, etc. in the alias definition | |
248 | are expanded by Mercurial before execution. Positional arguments not |
|
248 | are expanded by Mercurial before execution. Positional arguments not | |
249 | already used by ``$N`` in the definition are put at the end of the |
|
249 | already used by ``$N`` in the definition are put at the end of the | |
250 | command to be executed. |
|
250 | command to be executed. | |
251 |
|
251 | |||
252 | Alias definitions consist of lines of the form:: |
|
252 | Alias definitions consist of lines of the form:: | |
253 |
|
253 | |||
254 | <alias> = <command> [<argument>]... |
|
254 | <alias> = <command> [<argument>]... | |
255 |
|
255 | |||
256 | For example, this definition:: |
|
256 | For example, this definition:: | |
257 |
|
257 | |||
258 | latest = log --limit 5 |
|
258 | latest = log --limit 5 | |
259 |
|
259 | |||
260 | creates a new command ``latest`` that shows only the five most recent |
|
260 | creates a new command ``latest`` that shows only the five most recent | |
261 | changesets. You can define subsequent aliases using earlier ones:: |
|
261 | changesets. You can define subsequent aliases using earlier ones:: | |
262 |
|
262 | |||
263 | stable5 = latest -b stable |
|
263 | stable5 = latest -b stable | |
264 |
|
264 | |||
265 | .. note:: |
|
265 | .. note:: | |
266 |
|
266 | |||
267 | It is possible to create aliases with the same names as |
|
267 | It is possible to create aliases with the same names as | |
268 | existing commands, which will then override the original |
|
268 | existing commands, which will then override the original | |
269 | definitions. This is almost always a bad idea! |
|
269 | definitions. This is almost always a bad idea! | |
270 |
|
270 | |||
271 | An alias can start with an exclamation point (``!``) to make it a |
|
271 | An alias can start with an exclamation point (``!``) to make it a | |
272 | shell alias. A shell alias is executed with the shell and will let you |
|
272 | shell alias. A shell alias is executed with the shell and will let you | |
273 | run arbitrary commands. As an example, :: |
|
273 | run arbitrary commands. As an example, :: | |
274 |
|
274 | |||
275 | echo = !echo $@ |
|
275 | echo = !echo $@ | |
276 |
|
276 | |||
277 | will let you do ``hg echo foo`` to have ``foo`` printed in your |
|
277 | will let you do ``hg echo foo`` to have ``foo`` printed in your | |
278 | terminal. A better example might be:: |
|
278 | terminal. A better example might be:: | |
279 |
|
279 | |||
280 | purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f |
|
280 | purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f | |
281 |
|
281 | |||
282 | which will make ``hg purge`` delete all unknown files in the |
|
282 | which will make ``hg purge`` delete all unknown files in the | |
283 | repository in the same manner as the purge extension. |
|
283 | repository in the same manner as the purge extension. | |
284 |
|
284 | |||
285 | Positional arguments like ``$1``, ``$2``, etc. in the alias definition |
|
285 | Positional arguments like ``$1``, ``$2``, etc. in the alias definition | |
286 | expand to the command arguments. Unmatched arguments are |
|
286 | expand to the command arguments. Unmatched arguments are | |
287 | removed. ``$0`` expands to the alias name and ``$@`` expands to all |
|
287 | removed. ``$0`` expands to the alias name and ``$@`` expands to all | |
288 | arguments separated by a space. ``"$@"`` (with quotes) expands to all |
|
288 | arguments separated by a space. ``"$@"`` (with quotes) expands to all | |
289 | arguments quoted individually and separated by a space. These expansions |
|
289 | arguments quoted individually and separated by a space. These expansions | |
290 | happen before the command is passed to the shell. |
|
290 | happen before the command is passed to the shell. | |
291 |
|
291 | |||
292 | Shell aliases are executed in an environment where ``$HG`` expands to |
|
292 | Shell aliases are executed in an environment where ``$HG`` expands to | |
293 | the path of the Mercurial that was used to execute the alias. This is |
|
293 | the path of the Mercurial that was used to execute the alias. This is | |
294 | useful when you want to call further Mercurial commands in a shell |
|
294 | useful when you want to call further Mercurial commands in a shell | |
295 | alias, as was done above for the purge alias. In addition, |
|
295 | alias, as was done above for the purge alias. In addition, | |
296 | ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg |
|
296 | ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg | |
297 | echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. |
|
297 | echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. | |
298 |
|
298 | |||
299 | .. note:: |
|
299 | .. note:: | |
300 |
|
300 | |||
301 | Some global configuration options such as ``-R`` are |
|
301 | Some global configuration options such as ``-R`` are | |
302 | processed before shell aliases and will thus not be passed to |
|
302 | processed before shell aliases and will thus not be passed to | |
303 | aliases. |
|
303 | aliases. | |
304 |
|
304 | |||
305 |
|
305 | |||
306 | ``annotate`` |
|
306 | ``annotate`` | |
307 | ------------ |
|
307 | ------------ | |
308 |
|
308 | |||
309 | Settings used when displaying file annotations. All values are |
|
309 | Settings used when displaying file annotations. All values are | |
310 | Booleans and default to False. See :hg:`help config.diff` for |
|
310 | Booleans and default to False. See :hg:`help config.diff` for | |
311 | related options for the diff command. |
|
311 | related options for the diff command. | |
312 |
|
312 | |||
313 | ``ignorews`` |
|
313 | ``ignorews`` | |
314 | Ignore white space when comparing lines. |
|
314 | Ignore white space when comparing lines. | |
315 |
|
315 | |||
316 | ``ignorewsamount`` |
|
316 | ``ignorewsamount`` | |
317 | Ignore changes in the amount of white space. |
|
317 | Ignore changes in the amount of white space. | |
318 |
|
318 | |||
319 | ``ignoreblanklines`` |
|
319 | ``ignoreblanklines`` | |
320 | Ignore changes whose lines are all blank. |
|
320 | Ignore changes whose lines are all blank. | |
321 |
|
321 | |||
322 |
|
322 | |||
323 | ``auth`` |
|
323 | ``auth`` | |
324 | -------- |
|
324 | -------- | |
325 |
|
325 | |||
326 | Authentication credentials for HTTP authentication. This section |
|
326 | Authentication credentials for HTTP authentication. This section | |
327 | allows you to store usernames and passwords for use when logging |
|
327 | allows you to store usernames and passwords for use when logging | |
328 | *into* HTTP servers. See :hg:`help config.web` if |
|
328 | *into* HTTP servers. See :hg:`help config.web` if | |
329 | you want to configure *who* can login to your HTTP server. |
|
329 | you want to configure *who* can login to your HTTP server. | |
330 |
|
330 | |||
331 | Each line has the following format:: |
|
331 | Each line has the following format:: | |
332 |
|
332 | |||
333 | <name>.<argument> = <value> |
|
333 | <name>.<argument> = <value> | |
334 |
|
334 | |||
335 | where ``<name>`` is used to group arguments into authentication |
|
335 | where ``<name>`` is used to group arguments into authentication | |
336 | entries. Example:: |
|
336 | entries. Example:: | |
337 |
|
337 | |||
338 | foo.prefix = hg.intevation.de/mercurial |
|
338 | foo.prefix = hg.intevation.de/mercurial | |
339 | foo.username = foo |
|
339 | foo.username = foo | |
340 | foo.password = bar |
|
340 | foo.password = bar | |
341 | foo.schemes = http https |
|
341 | foo.schemes = http https | |
342 |
|
342 | |||
343 | bar.prefix = secure.example.org |
|
343 | bar.prefix = secure.example.org | |
344 | bar.key = path/to/file.key |
|
344 | bar.key = path/to/file.key | |
345 | bar.cert = path/to/file.cert |
|
345 | bar.cert = path/to/file.cert | |
346 | bar.schemes = https |
|
346 | bar.schemes = https | |
347 |
|
347 | |||
348 | Supported arguments: |
|
348 | Supported arguments: | |
349 |
|
349 | |||
350 | ``prefix`` |
|
350 | ``prefix`` | |
351 | Either ``*`` or a URI prefix with or without the scheme part. |
|
351 | Either ``*`` or a URI prefix with or without the scheme part. | |
352 | The authentication entry with the longest matching prefix is used |
|
352 | The authentication entry with the longest matching prefix is used | |
353 | (where ``*`` matches everything and counts as a match of length |
|
353 | (where ``*`` matches everything and counts as a match of length | |
354 | 1). If the prefix doesn't include a scheme, the match is performed |
|
354 | 1). If the prefix doesn't include a scheme, the match is performed | |
355 | against the URI with its scheme stripped as well, and the schemes |
|
355 | against the URI with its scheme stripped as well, and the schemes | |
356 | argument, q.v., is then subsequently consulted. |
|
356 | argument, q.v., is then subsequently consulted. | |
357 |
|
357 | |||
358 | ``username`` |
|
358 | ``username`` | |
359 | Optional. Username to authenticate with. If not given, and the |
|
359 | Optional. Username to authenticate with. If not given, and the | |
360 | remote site requires basic or digest authentication, the user will |
|
360 | remote site requires basic or digest authentication, the user will | |
361 | be prompted for it. Environment variables are expanded in the |
|
361 | be prompted for it. Environment variables are expanded in the | |
362 | username letting you do ``foo.username = $USER``. If the URI |
|
362 | username letting you do ``foo.username = $USER``. If the URI | |
363 | includes a username, only ``[auth]`` entries with a matching |
|
363 | includes a username, only ``[auth]`` entries with a matching | |
364 | username or without a username will be considered. |
|
364 | username or without a username will be considered. | |
365 |
|
365 | |||
366 | ``password`` |
|
366 | ``password`` | |
367 | Optional. Password to authenticate with. If not given, and the |
|
367 | Optional. Password to authenticate with. If not given, and the | |
368 | remote site requires basic or digest authentication, the user |
|
368 | remote site requires basic or digest authentication, the user | |
369 | will be prompted for it. |
|
369 | will be prompted for it. | |
370 |
|
370 | |||
371 | ``key`` |
|
371 | ``key`` | |
372 | Optional. PEM encoded client certificate key file. Environment |
|
372 | Optional. PEM encoded client certificate key file. Environment | |
373 | variables are expanded in the filename. |
|
373 | variables are expanded in the filename. | |
374 |
|
374 | |||
375 | ``cert`` |
|
375 | ``cert`` | |
376 | Optional. PEM encoded client certificate chain file. Environment |
|
376 | Optional. PEM encoded client certificate chain file. Environment | |
377 | variables are expanded in the filename. |
|
377 | variables are expanded in the filename. | |
378 |
|
378 | |||
379 | ``schemes`` |
|
379 | ``schemes`` | |
380 | Optional. Space separated list of URI schemes to use this |
|
380 | Optional. Space separated list of URI schemes to use this | |
381 | authentication entry with. Only used if the prefix doesn't include |
|
381 | authentication entry with. Only used if the prefix doesn't include | |
382 | a scheme. Supported schemes are http and https. They will match |
|
382 | a scheme. Supported schemes are http and https. They will match | |
383 | static-http and static-https respectively, as well. |
|
383 | static-http and static-https respectively, as well. | |
384 | (default: https) |
|
384 | (default: https) | |
385 |
|
385 | |||
386 | If no suitable authentication entry is found, the user is prompted |
|
386 | If no suitable authentication entry is found, the user is prompted | |
387 | for credentials as usual if required by the remote. |
|
387 | for credentials as usual if required by the remote. | |
388 |
|
388 | |||
389 | ``color`` |
|
389 | ``color`` | |
390 | --------- |
|
390 | --------- | |
391 |
|
391 | |||
392 | Configure the Mercurial color mode. For details about how to define your custom |
|
392 | Configure the Mercurial color mode. For details about how to define your custom | |
393 | effect and style see :hg:`help color`. |
|
393 | effect and style see :hg:`help color`. | |
394 |
|
394 | |||
395 | ``mode`` |
|
395 | ``mode`` | |
396 | String: control the method used to output color. One of ``auto``, ``ansi``, |
|
396 | String: control the method used to output color. One of ``auto``, ``ansi``, | |
397 | ``win32``, ``terminfo`` or ``debug``. In auto mode the color extension will |
|
397 | ``win32``, ``terminfo`` or ``debug``. In auto mode the color extension will | |
398 | use ANSI mode by default (or win32 mode on Windows) if it detects a |
|
398 | use ANSI mode by default (or win32 mode on Windows) if it detects a | |
399 | terminal. Any invalid value will disable color. |
|
399 | terminal. Any invalid value will disable color. | |
400 |
|
400 | |||
401 | ``pagermode`` |
|
401 | ``pagermode`` | |
402 | String: optinal override of ``color.mode`` used with pager (from the pager |
|
402 | String: optinal override of ``color.mode`` used with pager (from the pager | |
403 | extensions). |
|
403 | extensions). | |
404 |
|
404 | |||
405 | On some systems, terminfo mode may cause problems when using |
|
405 | On some systems, terminfo mode may cause problems when using | |
406 | color with the pager extension and less -R. less with the -R option |
|
406 | color with the pager extension and less -R. less with the -R option | |
407 | will only display ECMA-48 color codes, and terminfo mode may sometimes |
|
407 | will only display ECMA-48 color codes, and terminfo mode may sometimes | |
408 | emit codes that less doesn't understand. You can work around this by |
|
408 | emit codes that less doesn't understand. You can work around this by | |
409 | either using ansi mode (or auto mode), or by using less -r (which will |
|
409 | either using ansi mode (or auto mode), or by using less -r (which will | |
410 | pass through all terminal control codes, not just color control |
|
410 | pass through all terminal control codes, not just color control | |
411 | codes). |
|
411 | codes). | |
412 |
|
412 | |||
413 | On some systems (such as MSYS in Windows), the terminal may support |
|
413 | On some systems (such as MSYS in Windows), the terminal may support | |
414 | a different color mode than the pager (activated via the "pager" |
|
414 | a different color mode than the pager (activated via the "pager" | |
415 | extension). |
|
415 | extension). | |
416 |
|
416 | |||
417 | ``commands`` |
|
417 | ``commands`` | |
418 | ------------ |
|
418 | ------------ | |
419 |
|
419 | |||
420 | ``status.relative`` |
|
420 | ``status.relative`` | |
421 | Make paths in ``hg status`` output relative to the current directory. |
|
421 | Make paths in ``hg status`` output relative to the current directory. | |
422 | (default: False) |
|
422 | (default: False) | |
423 |
|
423 | |||
424 | ``update.requiredest`` |
|
424 | ``update.requiredest`` | |
425 | Require that the user pass a destination when running ``hg update``. |
|
425 | Require that the user pass a destination when running ``hg update``. | |
426 | For example, ``hg update .::`` will be allowed, but a plain ``hg update`` |
|
426 | For example, ``hg update .::`` will be allowed, but a plain ``hg update`` | |
427 | will be disallowed. |
|
427 | will be disallowed. | |
428 | (default: False) |
|
428 | (default: False) | |
429 |
|
429 | |||
430 | ``committemplate`` |
|
430 | ``committemplate`` | |
431 | ------------------ |
|
431 | ------------------ | |
432 |
|
432 | |||
433 | ``changeset`` |
|
433 | ``changeset`` | |
434 | String: configuration in this section is used as the template to |
|
434 | String: configuration in this section is used as the template to | |
435 | customize the text shown in the editor when committing. |
|
435 | customize the text shown in the editor when committing. | |
436 |
|
436 | |||
437 | In addition to pre-defined template keywords, commit log specific one |
|
437 | In addition to pre-defined template keywords, commit log specific one | |
438 | below can be used for customization: |
|
438 | below can be used for customization: | |
439 |
|
439 | |||
440 | ``extramsg`` |
|
440 | ``extramsg`` | |
441 | String: Extra message (typically 'Leave message empty to abort |
|
441 | String: Extra message (typically 'Leave message empty to abort | |
442 | commit.'). This may be changed by some commands or extensions. |
|
442 | commit.'). This may be changed by some commands or extensions. | |
443 |
|
443 | |||
444 | For example, the template configuration below shows as same text as |
|
444 | For example, the template configuration below shows as same text as | |
445 | one shown by default:: |
|
445 | one shown by default:: | |
446 |
|
446 | |||
447 | [committemplate] |
|
447 | [committemplate] | |
448 | changeset = {desc}\n\n |
|
448 | changeset = {desc}\n\n | |
449 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
449 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
450 | HG: {extramsg} |
|
450 | HG: {extramsg} | |
451 | HG: -- |
|
451 | HG: -- | |
452 | HG: user: {author}\n{ifeq(p2rev, "-1", "", |
|
452 | HG: user: {author}\n{ifeq(p2rev, "-1", "", | |
453 | "HG: branch merge\n") |
|
453 | "HG: branch merge\n") | |
454 | }HG: branch '{branch}'\n{if(activebookmark, |
|
454 | }HG: branch '{branch}'\n{if(activebookmark, | |
455 | "HG: bookmark '{activebookmark}'\n") }{subrepos % |
|
455 | "HG: bookmark '{activebookmark}'\n") }{subrepos % | |
456 | "HG: subrepo {subrepo}\n" }{file_adds % |
|
456 | "HG: subrepo {subrepo}\n" }{file_adds % | |
457 | "HG: added {file}\n" }{file_mods % |
|
457 | "HG: added {file}\n" }{file_mods % | |
458 | "HG: changed {file}\n" }{file_dels % |
|
458 | "HG: changed {file}\n" }{file_dels % | |
459 | "HG: removed {file}\n" }{if(files, "", |
|
459 | "HG: removed {file}\n" }{if(files, "", | |
460 | "HG: no files changed\n")} |
|
460 | "HG: no files changed\n")} | |
461 |
|
461 | |||
462 | ``diff()`` |
|
462 | ``diff()`` | |
463 | String: show the diff (see :hg:`help templates` for detail) |
|
463 | String: show the diff (see :hg:`help templates` for detail) | |
464 |
|
464 | |||
465 | Sometimes it is helpful to show the diff of the changeset in the editor without |
|
465 | Sometimes it is helpful to show the diff of the changeset in the editor without | |
466 | having to prefix 'HG: ' to each line so that highlighting works correctly. For |
|
466 | having to prefix 'HG: ' to each line so that highlighting works correctly. For | |
467 | this, Mercurial provides a special string which will ignore everything below |
|
467 | this, Mercurial provides a special string which will ignore everything below | |
468 | it:: |
|
468 | it:: | |
469 |
|
469 | |||
470 | HG: ------------------------ >8 ------------------------ |
|
470 | HG: ------------------------ >8 ------------------------ | |
471 |
|
471 | |||
472 | For example, the template configuration below will show the diff below the |
|
472 | For example, the template configuration below will show the diff below the | |
473 | extra message:: |
|
473 | extra message:: | |
474 |
|
474 | |||
475 | [committemplate] |
|
475 | [committemplate] | |
476 | changeset = {desc}\n\n |
|
476 | changeset = {desc}\n\n | |
477 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
477 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
478 | HG: {extramsg} |
|
478 | HG: {extramsg} | |
479 | HG: ------------------------ >8 ------------------------ |
|
479 | HG: ------------------------ >8 ------------------------ | |
480 | HG: Do not touch the line above. |
|
480 | HG: Do not touch the line above. | |
481 | HG: Everything below will be removed. |
|
481 | HG: Everything below will be removed. | |
482 | {diff()} |
|
482 | {diff()} | |
483 |
|
483 | |||
484 | .. note:: |
|
484 | .. note:: | |
485 |
|
485 | |||
486 | For some problematic encodings (see :hg:`help win32mbcs` for |
|
486 | For some problematic encodings (see :hg:`help win32mbcs` for | |
487 | detail), this customization should be configured carefully, to |
|
487 | detail), this customization should be configured carefully, to | |
488 | avoid showing broken characters. |
|
488 | avoid showing broken characters. | |
489 |
|
489 | |||
490 | For example, if a multibyte character ending with backslash (0x5c) is |
|
490 | For example, if a multibyte character ending with backslash (0x5c) is | |
491 | followed by the ASCII character 'n' in the customized template, |
|
491 | followed by the ASCII character 'n' in the customized template, | |
492 | the sequence of backslash and 'n' is treated as line-feed unexpectedly |
|
492 | the sequence of backslash and 'n' is treated as line-feed unexpectedly | |
493 | (and the multibyte character is broken, too). |
|
493 | (and the multibyte character is broken, too). | |
494 |
|
494 | |||
495 | Customized template is used for commands below (``--edit`` may be |
|
495 | Customized template is used for commands below (``--edit`` may be | |
496 | required): |
|
496 | required): | |
497 |
|
497 | |||
498 | - :hg:`backout` |
|
498 | - :hg:`backout` | |
499 | - :hg:`commit` |
|
499 | - :hg:`commit` | |
500 | - :hg:`fetch` (for merge commit only) |
|
500 | - :hg:`fetch` (for merge commit only) | |
501 | - :hg:`graft` |
|
501 | - :hg:`graft` | |
502 | - :hg:`histedit` |
|
502 | - :hg:`histedit` | |
503 | - :hg:`import` |
|
503 | - :hg:`import` | |
504 | - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh` |
|
504 | - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh` | |
505 | - :hg:`rebase` |
|
505 | - :hg:`rebase` | |
506 | - :hg:`shelve` |
|
506 | - :hg:`shelve` | |
507 | - :hg:`sign` |
|
507 | - :hg:`sign` | |
508 | - :hg:`tag` |
|
508 | - :hg:`tag` | |
509 | - :hg:`transplant` |
|
509 | - :hg:`transplant` | |
510 |
|
510 | |||
511 | Configuring items below instead of ``changeset`` allows showing |
|
511 | Configuring items below instead of ``changeset`` allows showing | |
512 | customized message only for specific actions, or showing different |
|
512 | customized message only for specific actions, or showing different | |
513 | messages for each action. |
|
513 | messages for each action. | |
514 |
|
514 | |||
515 | - ``changeset.backout`` for :hg:`backout` |
|
515 | - ``changeset.backout`` for :hg:`backout` | |
516 | - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges |
|
516 | - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges | |
517 | - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other |
|
517 | - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other | |
518 | - ``changeset.commit.normal.merge`` for :hg:`commit` on merges |
|
518 | - ``changeset.commit.normal.merge`` for :hg:`commit` on merges | |
519 | - ``changeset.commit.normal.normal`` for :hg:`commit` on other |
|
519 | - ``changeset.commit.normal.normal`` for :hg:`commit` on other | |
520 | - ``changeset.fetch`` for :hg:`fetch` (impling merge commit) |
|
520 | - ``changeset.fetch`` for :hg:`fetch` (impling merge commit) | |
521 | - ``changeset.gpg.sign`` for :hg:`sign` |
|
521 | - ``changeset.gpg.sign`` for :hg:`sign` | |
522 | - ``changeset.graft`` for :hg:`graft` |
|
522 | - ``changeset.graft`` for :hg:`graft` | |
523 | - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit` |
|
523 | - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit` | |
524 | - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit` |
|
524 | - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit` | |
525 | - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit` |
|
525 | - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit` | |
526 | - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit` |
|
526 | - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit` | |
527 | - ``changeset.import.bypass`` for :hg:`import --bypass` |
|
527 | - ``changeset.import.bypass`` for :hg:`import --bypass` | |
528 | - ``changeset.import.normal.merge`` for :hg:`import` on merges |
|
528 | - ``changeset.import.normal.merge`` for :hg:`import` on merges | |
529 | - ``changeset.import.normal.normal`` for :hg:`import` on other |
|
529 | - ``changeset.import.normal.normal`` for :hg:`import` on other | |
530 | - ``changeset.mq.qnew`` for :hg:`qnew` |
|
530 | - ``changeset.mq.qnew`` for :hg:`qnew` | |
531 | - ``changeset.mq.qfold`` for :hg:`qfold` |
|
531 | - ``changeset.mq.qfold`` for :hg:`qfold` | |
532 | - ``changeset.mq.qrefresh`` for :hg:`qrefresh` |
|
532 | - ``changeset.mq.qrefresh`` for :hg:`qrefresh` | |
533 | - ``changeset.rebase.collapse`` for :hg:`rebase --collapse` |
|
533 | - ``changeset.rebase.collapse`` for :hg:`rebase --collapse` | |
534 | - ``changeset.rebase.merge`` for :hg:`rebase` on merges |
|
534 | - ``changeset.rebase.merge`` for :hg:`rebase` on merges | |
535 | - ``changeset.rebase.normal`` for :hg:`rebase` on other |
|
535 | - ``changeset.rebase.normal`` for :hg:`rebase` on other | |
536 | - ``changeset.shelve.shelve`` for :hg:`shelve` |
|
536 | - ``changeset.shelve.shelve`` for :hg:`shelve` | |
537 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` |
|
537 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` | |
538 | - ``changeset.tag.remove`` for :hg:`tag --remove` |
|
538 | - ``changeset.tag.remove`` for :hg:`tag --remove` | |
539 | - ``changeset.transplant.merge`` for :hg:`transplant` on merges |
|
539 | - ``changeset.transplant.merge`` for :hg:`transplant` on merges | |
540 | - ``changeset.transplant.normal`` for :hg:`transplant` on other |
|
540 | - ``changeset.transplant.normal`` for :hg:`transplant` on other | |
541 |
|
541 | |||
542 | These dot-separated lists of names are treated as hierarchical ones. |
|
542 | These dot-separated lists of names are treated as hierarchical ones. | |
543 | For example, ``changeset.tag.remove`` customizes the commit message |
|
543 | For example, ``changeset.tag.remove`` customizes the commit message | |
544 | only for :hg:`tag --remove`, but ``changeset.tag`` customizes the |
|
544 | only for :hg:`tag --remove`, but ``changeset.tag`` customizes the | |
545 | commit message for :hg:`tag` regardless of ``--remove`` option. |
|
545 | commit message for :hg:`tag` regardless of ``--remove`` option. | |
546 |
|
546 | |||
547 | When the external editor is invoked for a commit, the corresponding |
|
547 | When the external editor is invoked for a commit, the corresponding | |
548 | dot-separated list of names without the ``changeset.`` prefix |
|
548 | dot-separated list of names without the ``changeset.`` prefix | |
549 | (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment |
|
549 | (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment | |
550 | variable. |
|
550 | variable. | |
551 |
|
551 | |||
552 | In this section, items other than ``changeset`` can be referred from |
|
552 | In this section, items other than ``changeset`` can be referred from | |
553 | others. For example, the configuration to list committed files up |
|
553 | others. For example, the configuration to list committed files up | |
554 | below can be referred as ``{listupfiles}``:: |
|
554 | below can be referred as ``{listupfiles}``:: | |
555 |
|
555 | |||
556 | [committemplate] |
|
556 | [committemplate] | |
557 | listupfiles = {file_adds % |
|
557 | listupfiles = {file_adds % | |
558 | "HG: added {file}\n" }{file_mods % |
|
558 | "HG: added {file}\n" }{file_mods % | |
559 | "HG: changed {file}\n" }{file_dels % |
|
559 | "HG: changed {file}\n" }{file_dels % | |
560 | "HG: removed {file}\n" }{if(files, "", |
|
560 | "HG: removed {file}\n" }{if(files, "", | |
561 | "HG: no files changed\n")} |
|
561 | "HG: no files changed\n")} | |
562 |
|
562 | |||
563 | ``decode/encode`` |
|
563 | ``decode/encode`` | |
564 | ----------------- |
|
564 | ----------------- | |
565 |
|
565 | |||
566 | Filters for transforming files on checkout/checkin. This would |
|
566 | Filters for transforming files on checkout/checkin. This would | |
567 | typically be used for newline processing or other |
|
567 | typically be used for newline processing or other | |
568 | localization/canonicalization of files. |
|
568 | localization/canonicalization of files. | |
569 |
|
569 | |||
570 | Filters consist of a filter pattern followed by a filter command. |
|
570 | Filters consist of a filter pattern followed by a filter command. | |
571 | Filter patterns are globs by default, rooted at the repository root. |
|
571 | Filter patterns are globs by default, rooted at the repository root. | |
572 | For example, to match any file ending in ``.txt`` in the root |
|
572 | For example, to match any file ending in ``.txt`` in the root | |
573 | directory only, use the pattern ``*.txt``. To match any file ending |
|
573 | directory only, use the pattern ``*.txt``. To match any file ending | |
574 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. |
|
574 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. | |
575 | For each file only the first matching filter applies. |
|
575 | For each file only the first matching filter applies. | |
576 |
|
576 | |||
577 | The filter command can start with a specifier, either ``pipe:`` or |
|
577 | The filter command can start with a specifier, either ``pipe:`` or | |
578 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. |
|
578 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. | |
579 |
|
579 | |||
580 | A ``pipe:`` command must accept data on stdin and return the transformed |
|
580 | A ``pipe:`` command must accept data on stdin and return the transformed | |
581 | data on stdout. |
|
581 | data on stdout. | |
582 |
|
582 | |||
583 | Pipe example:: |
|
583 | Pipe example:: | |
584 |
|
584 | |||
585 | [encode] |
|
585 | [encode] | |
586 | # uncompress gzip files on checkin to improve delta compression |
|
586 | # uncompress gzip files on checkin to improve delta compression | |
587 | # note: not necessarily a good idea, just an example |
|
587 | # note: not necessarily a good idea, just an example | |
588 | *.gz = pipe: gunzip |
|
588 | *.gz = pipe: gunzip | |
589 |
|
589 | |||
590 | [decode] |
|
590 | [decode] | |
591 | # recompress gzip files when writing them to the working dir (we |
|
591 | # recompress gzip files when writing them to the working dir (we | |
592 | # can safely omit "pipe:", because it's the default) |
|
592 | # can safely omit "pipe:", because it's the default) | |
593 | *.gz = gzip |
|
593 | *.gz = gzip | |
594 |
|
594 | |||
595 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced |
|
595 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced | |
596 | with the name of a temporary file that contains the data to be |
|
596 | with the name of a temporary file that contains the data to be | |
597 | filtered by the command. The string ``OUTFILE`` is replaced with the name |
|
597 | filtered by the command. The string ``OUTFILE`` is replaced with the name | |
598 | of an empty temporary file, where the filtered data must be written by |
|
598 | of an empty temporary file, where the filtered data must be written by | |
599 | the command. |
|
599 | the command. | |
600 |
|
600 | |||
601 | .. container:: windows |
|
601 | .. container:: windows | |
602 |
|
602 | |||
603 | .. note:: |
|
603 | .. note:: | |
604 |
|
604 | |||
605 | The tempfile mechanism is recommended for Windows systems, |
|
605 | The tempfile mechanism is recommended for Windows systems, | |
606 | where the standard shell I/O redirection operators often have |
|
606 | where the standard shell I/O redirection operators often have | |
607 | strange effects and may corrupt the contents of your files. |
|
607 | strange effects and may corrupt the contents of your files. | |
608 |
|
608 | |||
609 | This filter mechanism is used internally by the ``eol`` extension to |
|
609 | This filter mechanism is used internally by the ``eol`` extension to | |
610 | translate line ending characters between Windows (CRLF) and Unix (LF) |
|
610 | translate line ending characters between Windows (CRLF) and Unix (LF) | |
611 | format. We suggest you use the ``eol`` extension for convenience. |
|
611 | format. We suggest you use the ``eol`` extension for convenience. | |
612 |
|
612 | |||
613 |
|
613 | |||
614 | ``defaults`` |
|
614 | ``defaults`` | |
615 | ------------ |
|
615 | ------------ | |
616 |
|
616 | |||
617 | (defaults are deprecated. Don't use them. Use aliases instead.) |
|
617 | (defaults are deprecated. Don't use them. Use aliases instead.) | |
618 |
|
618 | |||
619 | Use the ``[defaults]`` section to define command defaults, i.e. the |
|
619 | Use the ``[defaults]`` section to define command defaults, i.e. the | |
620 | default options/arguments to pass to the specified commands. |
|
620 | default options/arguments to pass to the specified commands. | |
621 |
|
621 | |||
622 | The following example makes :hg:`log` run in verbose mode, and |
|
622 | The following example makes :hg:`log` run in verbose mode, and | |
623 | :hg:`status` show only the modified files, by default:: |
|
623 | :hg:`status` show only the modified files, by default:: | |
624 |
|
624 | |||
625 | [defaults] |
|
625 | [defaults] | |
626 | log = -v |
|
626 | log = -v | |
627 | status = -m |
|
627 | status = -m | |
628 |
|
628 | |||
629 | The actual commands, instead of their aliases, must be used when |
|
629 | The actual commands, instead of their aliases, must be used when | |
630 | defining command defaults. The command defaults will also be applied |
|
630 | defining command defaults. The command defaults will also be applied | |
631 | to the aliases of the commands defined. |
|
631 | to the aliases of the commands defined. | |
632 |
|
632 | |||
633 |
|
633 | |||
634 | ``diff`` |
|
634 | ``diff`` | |
635 | -------- |
|
635 | -------- | |
636 |
|
636 | |||
637 | Settings used when displaying diffs. Everything except for ``unified`` |
|
637 | Settings used when displaying diffs. Everything except for ``unified`` | |
638 | is a Boolean and defaults to False. See :hg:`help config.annotate` |
|
638 | is a Boolean and defaults to False. See :hg:`help config.annotate` | |
639 | for related options for the annotate command. |
|
639 | for related options for the annotate command. | |
640 |
|
640 | |||
641 | ``git`` |
|
641 | ``git`` | |
642 | Use git extended diff format. |
|
642 | Use git extended diff format. | |
643 |
|
643 | |||
644 | ``nobinary`` |
|
644 | ``nobinary`` | |
645 | Omit git binary patches. |
|
645 | Omit git binary patches. | |
646 |
|
646 | |||
647 | ``nodates`` |
|
647 | ``nodates`` | |
648 | Don't include dates in diff headers. |
|
648 | Don't include dates in diff headers. | |
649 |
|
649 | |||
650 | ``noprefix`` |
|
650 | ``noprefix`` | |
651 | Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode. |
|
651 | Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode. | |
652 |
|
652 | |||
653 | ``showfunc`` |
|
653 | ``showfunc`` | |
654 | Show which function each change is in. |
|
654 | Show which function each change is in. | |
655 |
|
655 | |||
656 | ``ignorews`` |
|
656 | ``ignorews`` | |
657 | Ignore white space when comparing lines. |
|
657 | Ignore white space when comparing lines. | |
658 |
|
658 | |||
659 | ``ignorewsamount`` |
|
659 | ``ignorewsamount`` | |
660 | Ignore changes in the amount of white space. |
|
660 | Ignore changes in the amount of white space. | |
661 |
|
661 | |||
662 | ``ignoreblanklines`` |
|
662 | ``ignoreblanklines`` | |
663 | Ignore changes whose lines are all blank. |
|
663 | Ignore changes whose lines are all blank. | |
664 |
|
664 | |||
665 | ``unified`` |
|
665 | ``unified`` | |
666 | Number of lines of context to show. |
|
666 | Number of lines of context to show. | |
667 |
|
667 | |||
668 | ``email`` |
|
668 | ``email`` | |
669 | --------- |
|
669 | --------- | |
670 |
|
670 | |||
671 | Settings for extensions that send email messages. |
|
671 | Settings for extensions that send email messages. | |
672 |
|
672 | |||
673 | ``from`` |
|
673 | ``from`` | |
674 | Optional. Email address to use in "From" header and SMTP envelope |
|
674 | Optional. Email address to use in "From" header and SMTP envelope | |
675 | of outgoing messages. |
|
675 | of outgoing messages. | |
676 |
|
676 | |||
677 | ``to`` |
|
677 | ``to`` | |
678 | Optional. Comma-separated list of recipients' email addresses. |
|
678 | Optional. Comma-separated list of recipients' email addresses. | |
679 |
|
679 | |||
680 | ``cc`` |
|
680 | ``cc`` | |
681 | Optional. Comma-separated list of carbon copy recipients' |
|
681 | Optional. Comma-separated list of carbon copy recipients' | |
682 | email addresses. |
|
682 | email addresses. | |
683 |
|
683 | |||
684 | ``bcc`` |
|
684 | ``bcc`` | |
685 | Optional. Comma-separated list of blind carbon copy recipients' |
|
685 | Optional. Comma-separated list of blind carbon copy recipients' | |
686 | email addresses. |
|
686 | email addresses. | |
687 |
|
687 | |||
688 | ``method`` |
|
688 | ``method`` | |
689 | Optional. Method to use to send email messages. If value is ``smtp`` |
|
689 | Optional. Method to use to send email messages. If value is ``smtp`` | |
690 | (default), use SMTP (see the ``[smtp]`` section for configuration). |
|
690 | (default), use SMTP (see the ``[smtp]`` section for configuration). | |
691 | Otherwise, use as name of program to run that acts like sendmail |
|
691 | Otherwise, use as name of program to run that acts like sendmail | |
692 | (takes ``-f`` option for sender, list of recipients on command line, |
|
692 | (takes ``-f`` option for sender, list of recipients on command line, | |
693 | message on stdin). Normally, setting this to ``sendmail`` or |
|
693 | message on stdin). Normally, setting this to ``sendmail`` or | |
694 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. |
|
694 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. | |
695 |
|
695 | |||
696 | ``charsets`` |
|
696 | ``charsets`` | |
697 | Optional. Comma-separated list of character sets considered |
|
697 | Optional. Comma-separated list of character sets considered | |
698 | convenient for recipients. Addresses, headers, and parts not |
|
698 | convenient for recipients. Addresses, headers, and parts not | |
699 | containing patches of outgoing messages will be encoded in the |
|
699 | containing patches of outgoing messages will be encoded in the | |
700 | first character set to which conversion from local encoding |
|
700 | first character set to which conversion from local encoding | |
701 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct |
|
701 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct | |
702 | conversion fails, the text in question is sent as is. |
|
702 | conversion fails, the text in question is sent as is. | |
703 | (default: '') |
|
703 | (default: '') | |
704 |
|
704 | |||
705 | Order of outgoing email character sets: |
|
705 | Order of outgoing email character sets: | |
706 |
|
706 | |||
707 | 1. ``us-ascii``: always first, regardless of settings |
|
707 | 1. ``us-ascii``: always first, regardless of settings | |
708 | 2. ``email.charsets``: in order given by user |
|
708 | 2. ``email.charsets``: in order given by user | |
709 | 3. ``ui.fallbackencoding``: if not in email.charsets |
|
709 | 3. ``ui.fallbackencoding``: if not in email.charsets | |
710 | 4. ``$HGENCODING``: if not in email.charsets |
|
710 | 4. ``$HGENCODING``: if not in email.charsets | |
711 | 5. ``utf-8``: always last, regardless of settings |
|
711 | 5. ``utf-8``: always last, regardless of settings | |
712 |
|
712 | |||
713 | Email example:: |
|
713 | Email example:: | |
714 |
|
714 | |||
715 | [email] |
|
715 | [email] | |
716 | from = Joseph User <joe.user@example.com> |
|
716 | from = Joseph User <joe.user@example.com> | |
717 | method = /usr/sbin/sendmail |
|
717 | method = /usr/sbin/sendmail | |
718 | # charsets for western Europeans |
|
718 | # charsets for western Europeans | |
719 | # us-ascii, utf-8 omitted, as they are tried first and last |
|
719 | # us-ascii, utf-8 omitted, as they are tried first and last | |
720 | charsets = iso-8859-1, iso-8859-15, windows-1252 |
|
720 | charsets = iso-8859-1, iso-8859-15, windows-1252 | |
721 |
|
721 | |||
722 |
|
722 | |||
723 | ``extensions`` |
|
723 | ``extensions`` | |
724 | -------------- |
|
724 | -------------- | |
725 |
|
725 | |||
726 | Mercurial has an extension mechanism for adding new features. To |
|
726 | Mercurial has an extension mechanism for adding new features. To | |
727 | enable an extension, create an entry for it in this section. |
|
727 | enable an extension, create an entry for it in this section. | |
728 |
|
728 | |||
729 | If you know that the extension is already in Python's search path, |
|
729 | If you know that the extension is already in Python's search path, | |
730 | you can give the name of the module, followed by ``=``, with nothing |
|
730 | you can give the name of the module, followed by ``=``, with nothing | |
731 | after the ``=``. |
|
731 | after the ``=``. | |
732 |
|
732 | |||
733 | Otherwise, give a name that you choose, followed by ``=``, followed by |
|
733 | Otherwise, give a name that you choose, followed by ``=``, followed by | |
734 | the path to the ``.py`` file (including the file name extension) that |
|
734 | the path to the ``.py`` file (including the file name extension) that | |
735 | defines the extension. |
|
735 | defines the extension. | |
736 |
|
736 | |||
737 | To explicitly disable an extension that is enabled in an hgrc of |
|
737 | To explicitly disable an extension that is enabled in an hgrc of | |
738 | broader scope, prepend its path with ``!``, as in ``foo = !/ext/path`` |
|
738 | broader scope, prepend its path with ``!``, as in ``foo = !/ext/path`` | |
739 | or ``foo = !`` when path is not supplied. |
|
739 | or ``foo = !`` when path is not supplied. | |
740 |
|
740 | |||
741 | Example for ``~/.hgrc``:: |
|
741 | Example for ``~/.hgrc``:: | |
742 |
|
742 | |||
743 | [extensions] |
|
743 | [extensions] | |
744 | # (the churn extension will get loaded from Mercurial's path) |
|
744 | # (the churn extension will get loaded from Mercurial's path) | |
745 | churn = |
|
745 | churn = | |
746 | # (this extension will get loaded from the file specified) |
|
746 | # (this extension will get loaded from the file specified) | |
747 | myfeature = ~/.hgext/myfeature.py |
|
747 | myfeature = ~/.hgext/myfeature.py | |
748 |
|
748 | |||
749 |
|
749 | |||
750 | ``format`` |
|
750 | ``format`` | |
751 | ---------- |
|
751 | ---------- | |
752 |
|
752 | |||
753 | ``usegeneraldelta`` |
|
753 | ``usegeneraldelta`` | |
754 | Enable or disable the "generaldelta" repository format which improves |
|
754 | Enable or disable the "generaldelta" repository format which improves | |
755 | repository compression by allowing "revlog" to store delta against arbitrary |
|
755 | repository compression by allowing "revlog" to store delta against arbitrary | |
756 | revision instead of the previous stored one. This provides significant |
|
756 | revision instead of the previous stored one. This provides significant | |
757 | improvement for repositories with branches. |
|
757 | improvement for repositories with branches. | |
758 |
|
758 | |||
759 | Repositories with this on-disk format require Mercurial version 1.9. |
|
759 | Repositories with this on-disk format require Mercurial version 1.9. | |
760 |
|
760 | |||
761 | Enabled by default. |
|
761 | Enabled by default. | |
762 |
|
762 | |||
763 | ``dotencode`` |
|
763 | ``dotencode`` | |
764 | Enable or disable the "dotencode" repository format which enhances |
|
764 | Enable or disable the "dotencode" repository format which enhances | |
765 | the "fncache" repository format (which has to be enabled to use |
|
765 | the "fncache" repository format (which has to be enabled to use | |
766 | dotencode) to avoid issues with filenames starting with ._ on |
|
766 | dotencode) to avoid issues with filenames starting with ._ on | |
767 | Mac OS X and spaces on Windows. |
|
767 | Mac OS X and spaces on Windows. | |
768 |
|
768 | |||
769 | Repositories with this on-disk format require Mercurial version 1.7. |
|
769 | Repositories with this on-disk format require Mercurial version 1.7. | |
770 |
|
770 | |||
771 | Enabled by default. |
|
771 | Enabled by default. | |
772 |
|
772 | |||
773 | ``usefncache`` |
|
773 | ``usefncache`` | |
774 | Enable or disable the "fncache" repository format which enhances |
|
774 | Enable or disable the "fncache" repository format which enhances | |
775 | the "store" repository format (which has to be enabled to use |
|
775 | the "store" repository format (which has to be enabled to use | |
776 | fncache) to allow longer filenames and avoids using Windows |
|
776 | fncache) to allow longer filenames and avoids using Windows | |
777 | reserved names, e.g. "nul". |
|
777 | reserved names, e.g. "nul". | |
778 |
|
778 | |||
779 | Repositories with this on-disk format require Mercurial version 1.1. |
|
779 | Repositories with this on-disk format require Mercurial version 1.1. | |
780 |
|
780 | |||
781 | Enabled by default. |
|
781 | Enabled by default. | |
782 |
|
782 | |||
783 | ``usestore`` |
|
783 | ``usestore`` | |
784 | Enable or disable the "store" repository format which improves |
|
784 | Enable or disable the "store" repository format which improves | |
785 | compatibility with systems that fold case or otherwise mangle |
|
785 | compatibility with systems that fold case or otherwise mangle | |
786 | filenames. Disabling this option will allow you to store longer filenames |
|
786 | filenames. Disabling this option will allow you to store longer filenames | |
787 | in some situations at the expense of compatibility. |
|
787 | in some situations at the expense of compatibility. | |
788 |
|
788 | |||
789 | Repositories with this on-disk format require Mercurial version 0.9.4. |
|
789 | Repositories with this on-disk format require Mercurial version 0.9.4. | |
790 |
|
790 | |||
791 | Enabled by default. |
|
791 | Enabled by default. | |
792 |
|
792 | |||
793 | ``graph`` |
|
793 | ``graph`` | |
794 | --------- |
|
794 | --------- | |
795 |
|
795 | |||
796 | Web graph view configuration. This section let you change graph |
|
796 | Web graph view configuration. This section let you change graph | |
797 | elements display properties by branches, for instance to make the |
|
797 | elements display properties by branches, for instance to make the | |
798 | ``default`` branch stand out. |
|
798 | ``default`` branch stand out. | |
799 |
|
799 | |||
800 | Each line has the following format:: |
|
800 | Each line has the following format:: | |
801 |
|
801 | |||
802 | <branch>.<argument> = <value> |
|
802 | <branch>.<argument> = <value> | |
803 |
|
803 | |||
804 | where ``<branch>`` is the name of the branch being |
|
804 | where ``<branch>`` is the name of the branch being | |
805 | customized. Example:: |
|
805 | customized. Example:: | |
806 |
|
806 | |||
807 | [graph] |
|
807 | [graph] | |
808 | # 2px width |
|
808 | # 2px width | |
809 | default.width = 2 |
|
809 | default.width = 2 | |
810 | # red color |
|
810 | # red color | |
811 | default.color = FF0000 |
|
811 | default.color = FF0000 | |
812 |
|
812 | |||
813 | Supported arguments: |
|
813 | Supported arguments: | |
814 |
|
814 | |||
815 | ``width`` |
|
815 | ``width`` | |
816 | Set branch edges width in pixels. |
|
816 | Set branch edges width in pixels. | |
817 |
|
817 | |||
818 | ``color`` |
|
818 | ``color`` | |
819 | Set branch edges color in hexadecimal RGB notation. |
|
819 | Set branch edges color in hexadecimal RGB notation. | |
820 |
|
820 | |||
821 | ``hooks`` |
|
821 | ``hooks`` | |
822 | --------- |
|
822 | --------- | |
823 |
|
823 | |||
824 | Commands or Python functions that get automatically executed by |
|
824 | Commands or Python functions that get automatically executed by | |
825 | various actions such as starting or finishing a commit. Multiple |
|
825 | various actions such as starting or finishing a commit. Multiple | |
826 | hooks can be run for the same action by appending a suffix to the |
|
826 | hooks can be run for the same action by appending a suffix to the | |
827 | action. Overriding a site-wide hook can be done by changing its |
|
827 | action. Overriding a site-wide hook can be done by changing its | |
828 | value or setting it to an empty string. Hooks can be prioritized |
|
828 | value or setting it to an empty string. Hooks can be prioritized | |
829 | by adding a prefix of ``priority.`` to the hook name on a new line |
|
829 | by adding a prefix of ``priority.`` to the hook name on a new line | |
830 | and setting the priority. The default priority is 0. |
|
830 | and setting the priority. The default priority is 0. | |
831 |
|
831 | |||
832 | Example ``.hg/hgrc``:: |
|
832 | Example ``.hg/hgrc``:: | |
833 |
|
833 | |||
834 | [hooks] |
|
834 | [hooks] | |
835 | # update working directory after adding changesets |
|
835 | # update working directory after adding changesets | |
836 | changegroup.update = hg update |
|
836 | changegroup.update = hg update | |
837 | # do not use the site-wide hook |
|
837 | # do not use the site-wide hook | |
838 | incoming = |
|
838 | incoming = | |
839 | incoming.email = /my/email/hook |
|
839 | incoming.email = /my/email/hook | |
840 | incoming.autobuild = /my/build/hook |
|
840 | incoming.autobuild = /my/build/hook | |
841 | # force autobuild hook to run before other incoming hooks |
|
841 | # force autobuild hook to run before other incoming hooks | |
842 | priority.incoming.autobuild = 1 |
|
842 | priority.incoming.autobuild = 1 | |
843 |
|
843 | |||
844 | Most hooks are run with environment variables set that give useful |
|
844 | Most hooks are run with environment variables set that give useful | |
845 | additional information. For each hook below, the environment |
|
845 | additional information. For each hook below, the environment variables | |
846 |
|
|
846 | it is passed are listed with names of the form ``$HG_foo``. The | |
|
847 | ``$HG_HOOKTYPE`` variable is set for all hooks. It contains the type of | |||
|
848 | hook which triggered the run. In the example about this will be | |||
|
849 | ``$HG_HOOKTYPE=incoming``. | |||
847 |
|
850 | |||
848 | ``changegroup`` |
|
851 | ``changegroup`` | |
849 | Run after a changegroup has been added via push, pull or unbundle. ID of the |
|
852 | Run after a changegroup has been added via push, pull or unbundle. ID of the | |
850 | first new changeset is in ``$HG_NODE`` and last in ``$HG_NODE_LAST``. URL |
|
853 | first new changeset is in ``$HG_NODE`` and last in ``$HG_NODE_LAST``. URL | |
851 | from which changes came is in ``$HG_URL``. |
|
854 | from which changes came is in ``$HG_URL``. | |
852 |
|
855 | |||
853 | ``commit`` |
|
856 | ``commit`` | |
854 | Run after a changeset has been created in the local repository. ID |
|
857 | Run after a changeset has been created in the local repository. ID | |
855 | of the newly created changeset is in ``$HG_NODE``. Parent changeset |
|
858 | of the newly created changeset is in ``$HG_NODE``. Parent changeset | |
856 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
859 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. | |
857 |
|
860 | |||
858 | ``incoming`` |
|
861 | ``incoming`` | |
859 | Run after a changeset has been pulled, pushed, or unbundled into |
|
862 | Run after a changeset has been pulled, pushed, or unbundled into | |
860 | the local repository. The ID of the newly arrived changeset is in |
|
863 | the local repository. The ID of the newly arrived changeset is in | |
861 | ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``. |
|
864 | ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``. | |
862 |
|
865 | |||
863 | ``outgoing`` |
|
866 | ``outgoing`` | |
864 | Run after sending changes from local repository to another. ID of |
|
867 | Run after sending changes from local repository to another. ID of | |
865 | first changeset sent is in ``$HG_NODE``. Source of operation is in |
|
868 | first changeset sent is in ``$HG_NODE``. Source of operation is in | |
866 | ``$HG_SOURCE``; Also see :hg:`help config.hooks.preoutgoing` hook. |
|
869 | ``$HG_SOURCE``; Also see :hg:`help config.hooks.preoutgoing` hook. | |
867 |
|
870 | |||
868 | ``post-<command>`` |
|
871 | ``post-<command>`` | |
869 | Run after successful invocations of the associated command. The |
|
872 | Run after successful invocations of the associated command. The | |
870 | contents of the command line are passed as ``$HG_ARGS`` and the result |
|
873 | contents of the command line are passed as ``$HG_ARGS`` and the result | |
871 | code in ``$HG_RESULT``. Parsed command line arguments are passed as |
|
874 | code in ``$HG_RESULT``. Parsed command line arguments are passed as | |
872 | ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of |
|
875 | ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of | |
873 | the python data internally passed to <command>. ``$HG_OPTS`` is a |
|
876 | the python data internally passed to <command>. ``$HG_OPTS`` is a | |
874 | dictionary of options (with unspecified options set to their defaults). |
|
877 | dictionary of options (with unspecified options set to their defaults). | |
875 | ``$HG_PATS`` is a list of arguments. Hook failure is ignored. |
|
878 | ``$HG_PATS`` is a list of arguments. Hook failure is ignored. | |
876 |
|
879 | |||
877 | ``fail-<command>`` |
|
880 | ``fail-<command>`` | |
878 | Run after a failed invocation of an associated command. The contents |
|
881 | Run after a failed invocation of an associated command. The contents | |
879 | of the command line are passed as ``$HG_ARGS``. Parsed command line |
|
882 | of the command line are passed as ``$HG_ARGS``. Parsed command line | |
880 | arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain |
|
883 | arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain | |
881 | string representations of the python data internally passed to |
|
884 | string representations of the python data internally passed to | |
882 | <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified |
|
885 | <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified | |
883 | options set to their defaults). ``$HG_PATS`` is a list of arguments. |
|
886 | options set to their defaults). ``$HG_PATS`` is a list of arguments. | |
884 | Hook failure is ignored. |
|
887 | Hook failure is ignored. | |
885 |
|
888 | |||
886 | ``pre-<command>`` |
|
889 | ``pre-<command>`` | |
887 | Run before executing the associated command. The contents of the |
|
890 | Run before executing the associated command. The contents of the | |
888 | command line are passed as ``$HG_ARGS``. Parsed command line arguments |
|
891 | command line are passed as ``$HG_ARGS``. Parsed command line arguments | |
889 | are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string |
|
892 | are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string | |
890 | representations of the data internally passed to <command>. ``$HG_OPTS`` |
|
893 | representations of the data internally passed to <command>. ``$HG_OPTS`` | |
891 | is a dictionary of options (with unspecified options set to their |
|
894 | is a dictionary of options (with unspecified options set to their | |
892 | defaults). ``$HG_PATS`` is a list of arguments. If the hook returns |
|
895 | defaults). ``$HG_PATS`` is a list of arguments. If the hook returns | |
893 | failure, the command doesn't execute and Mercurial returns the failure |
|
896 | failure, the command doesn't execute and Mercurial returns the failure | |
894 | code. |
|
897 | code. | |
895 |
|
898 | |||
896 | ``prechangegroup`` |
|
899 | ``prechangegroup`` | |
897 | Run before a changegroup is added via push, pull or unbundle. Exit |
|
900 | Run before a changegroup is added via push, pull or unbundle. Exit | |
898 | status 0 allows the changegroup to proceed. Non-zero status will |
|
901 | status 0 allows the changegroup to proceed. Non-zero status will | |
899 | cause the push, pull or unbundle to fail. URL from which changes |
|
902 | cause the push, pull or unbundle to fail. URL from which changes | |
900 | will come is in ``$HG_URL``. |
|
903 | will come is in ``$HG_URL``. | |
901 |
|
904 | |||
902 | ``precommit`` |
|
905 | ``precommit`` | |
903 | Run before starting a local commit. Exit status 0 allows the |
|
906 | Run before starting a local commit. Exit status 0 allows the | |
904 | commit to proceed. Non-zero status will cause the commit to fail. |
|
907 | commit to proceed. Non-zero status will cause the commit to fail. | |
905 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
908 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. | |
906 |
|
909 | |||
907 | ``prelistkeys`` |
|
910 | ``prelistkeys`` | |
908 | Run before listing pushkeys (like bookmarks) in the |
|
911 | Run before listing pushkeys (like bookmarks) in the | |
909 | repository. Non-zero status will cause failure. The key namespace is |
|
912 | repository. Non-zero status will cause failure. The key namespace is | |
910 | in ``$HG_NAMESPACE``. |
|
913 | in ``$HG_NAMESPACE``. | |
911 |
|
914 | |||
912 | ``preoutgoing`` |
|
915 | ``preoutgoing`` | |
913 | Run before collecting changes to send from the local repository to |
|
916 | Run before collecting changes to send from the local repository to | |
914 | another. Non-zero status will cause failure. This lets you prevent |
|
917 | another. Non-zero status will cause failure. This lets you prevent | |
915 | pull over HTTP or SSH. Also prevents against local pull, push |
|
918 | pull over HTTP or SSH. Also prevents against local pull, push | |
916 | (outbound) or bundle commands, but not effective, since you can |
|
919 | (outbound) or bundle commands, but not effective, since you can | |
917 | just copy files instead then. Source of operation is in |
|
920 | just copy files instead then. Source of operation is in | |
918 | ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote |
|
921 | ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote | |
919 | SSH or HTTP repository. If "push", "pull" or "bundle", operation |
|
922 | SSH or HTTP repository. If "push", "pull" or "bundle", operation | |
920 | is happening on behalf of repository on same system. |
|
923 | is happening on behalf of repository on same system. | |
921 |
|
924 | |||
922 | ``prepushkey`` |
|
925 | ``prepushkey`` | |
923 | Run before a pushkey (like a bookmark) is added to the |
|
926 | Run before a pushkey (like a bookmark) is added to the | |
924 | repository. Non-zero status will cause the key to be rejected. The |
|
927 | repository. Non-zero status will cause the key to be rejected. The | |
925 | key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``, |
|
928 | key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``, | |
926 | the old value (if any) is in ``$HG_OLD``, and the new value is in |
|
929 | the old value (if any) is in ``$HG_OLD``, and the new value is in | |
927 | ``$HG_NEW``. |
|
930 | ``$HG_NEW``. | |
928 |
|
931 | |||
929 | ``pretag`` |
|
932 | ``pretag`` | |
930 | Run before creating a tag. Exit status 0 allows the tag to be |
|
933 | Run before creating a tag. Exit status 0 allows the tag to be | |
931 | created. Non-zero status will cause the tag to fail. ID of |
|
934 | created. Non-zero status will cause the tag to fail. ID of | |
932 | changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is |
|
935 | changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is | |
933 | local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``. |
|
936 | local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``. | |
934 |
|
937 | |||
935 | ``pretxnopen`` |
|
938 | ``pretxnopen`` | |
936 | Run before any new repository transaction is open. The reason for the |
|
939 | Run before any new repository transaction is open. The reason for the | |
937 | transaction will be in ``$HG_TXNNAME`` and a unique identifier for the |
|
940 | transaction will be in ``$HG_TXNNAME`` and a unique identifier for the | |
938 | transaction will be in ``HG_TXNID``. A non-zero status will prevent the |
|
941 | transaction will be in ``HG_TXNID``. A non-zero status will prevent the | |
939 | transaction from being opened. |
|
942 | transaction from being opened. | |
940 |
|
943 | |||
941 | ``pretxnclose`` |
|
944 | ``pretxnclose`` | |
942 | Run right before the transaction is actually finalized. Any repository change |
|
945 | Run right before the transaction is actually finalized. Any repository change | |
943 | will be visible to the hook program. This lets you validate the transaction |
|
946 | will be visible to the hook program. This lets you validate the transaction | |
944 | content or change it. Exit status 0 allows the commit to proceed. Non-zero |
|
947 | content or change it. Exit status 0 allows the commit to proceed. Non-zero | |
945 | status will cause the transaction to be rolled back. The reason for the |
|
948 | status will cause the transaction to be rolled back. The reason for the | |
946 | transaction opening will be in ``$HG_TXNNAME`` and a unique identifier for |
|
949 | transaction opening will be in ``$HG_TXNNAME`` and a unique identifier for | |
947 | the transaction will be in ``HG_TXNID``. The rest of the available data will |
|
950 | the transaction will be in ``HG_TXNID``. The rest of the available data will | |
948 | vary according the transaction type. New changesets will add ``$HG_NODE`` (id |
|
951 | vary according the transaction type. New changesets will add ``$HG_NODE`` (id | |
949 | of the first added changeset), ``$HG_NODE_LAST`` (id of the last added |
|
952 | of the first added changeset), ``$HG_NODE_LAST`` (id of the last added | |
950 | changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables, bookmarks and phases |
|
953 | changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables, bookmarks and phases | |
951 | changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``, etc. |
|
954 | changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``, etc. | |
952 |
|
955 | |||
953 | ``txnclose`` |
|
956 | ``txnclose`` | |
954 | Run after any repository transaction has been committed. At this |
|
957 | Run after any repository transaction has been committed. At this | |
955 | point, the transaction can no longer be rolled back. The hook will run |
|
958 | point, the transaction can no longer be rolled back. The hook will run | |
956 | after the lock is released. See :hg:`help config.hooks.pretxnclose` docs for |
|
959 | after the lock is released. See :hg:`help config.hooks.pretxnclose` docs for | |
957 | details about available variables. |
|
960 | details about available variables. | |
958 |
|
961 | |||
959 | ``txnabort`` |
|
962 | ``txnabort`` | |
960 | Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose` |
|
963 | Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose` | |
961 | docs for details about available variables. |
|
964 | docs for details about available variables. | |
962 |
|
965 | |||
963 | ``pretxnchangegroup`` |
|
966 | ``pretxnchangegroup`` | |
964 | Run after a changegroup has been added via push, pull or unbundle, but before |
|
967 | Run after a changegroup has been added via push, pull or unbundle, but before | |
965 | the transaction has been committed. Changegroup is visible to hook program. |
|
968 | the transaction has been committed. Changegroup is visible to hook program. | |
966 | This lets you validate incoming changes before accepting them. Passed the ID |
|
969 | This lets you validate incoming changes before accepting them. Passed the ID | |
967 | of the first new changeset in ``$HG_NODE`` and last in ``$HG_NODE_LAST``. |
|
970 | of the first new changeset in ``$HG_NODE`` and last in ``$HG_NODE_LAST``. | |
968 | Exit status 0 allows the transaction to commit. Non-zero status will cause |
|
971 | Exit status 0 allows the transaction to commit. Non-zero status will cause | |
969 | the transaction to be rolled back and the push, pull or unbundle will fail. |
|
972 | the transaction to be rolled back and the push, pull or unbundle will fail. | |
970 | URL that was source of changes is in ``$HG_URL``. |
|
973 | URL that was source of changes is in ``$HG_URL``. | |
971 |
|
974 | |||
972 | ``pretxncommit`` |
|
975 | ``pretxncommit`` | |
973 | Run after a changeset has been created but the transaction not yet |
|
976 | Run after a changeset has been created but the transaction not yet | |
974 | committed. Changeset is visible to hook program. This lets you |
|
977 | committed. Changeset is visible to hook program. This lets you | |
975 | validate commit message and changes. Exit status 0 allows the |
|
978 | validate commit message and changes. Exit status 0 allows the | |
976 | commit to proceed. Non-zero status will cause the transaction to |
|
979 | commit to proceed. Non-zero status will cause the transaction to | |
977 | be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset |
|
980 | be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset | |
978 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
981 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. | |
979 |
|
982 | |||
980 | ``preupdate`` |
|
983 | ``preupdate`` | |
981 | Run before updating the working directory. Exit status 0 allows |
|
984 | Run before updating the working directory. Exit status 0 allows | |
982 | the update to proceed. Non-zero status will prevent the update. |
|
985 | the update to proceed. Non-zero status will prevent the update. | |
983 | Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID |
|
986 | Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID | |
984 | of second new parent is in ``$HG_PARENT2``. |
|
987 | of second new parent is in ``$HG_PARENT2``. | |
985 |
|
988 | |||
986 | ``listkeys`` |
|
989 | ``listkeys`` | |
987 | Run after listing pushkeys (like bookmarks) in the repository. The |
|
990 | Run after listing pushkeys (like bookmarks) in the repository. The | |
988 | key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a |
|
991 | key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a | |
989 | dictionary containing the keys and values. |
|
992 | dictionary containing the keys and values. | |
990 |
|
993 | |||
991 | ``pushkey`` |
|
994 | ``pushkey`` | |
992 | Run after a pushkey (like a bookmark) is added to the |
|
995 | Run after a pushkey (like a bookmark) is added to the | |
993 | repository. The key namespace is in ``$HG_NAMESPACE``, the key is in |
|
996 | repository. The key namespace is in ``$HG_NAMESPACE``, the key is in | |
994 | ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new |
|
997 | ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new | |
995 | value is in ``$HG_NEW``. |
|
998 | value is in ``$HG_NEW``. | |
996 |
|
999 | |||
997 | ``tag`` |
|
1000 | ``tag`` | |
998 | Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``. |
|
1001 | Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``. | |
999 | Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in |
|
1002 | Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in | |
1000 | repository if ``$HG_LOCAL=0``. |
|
1003 | repository if ``$HG_LOCAL=0``. | |
1001 |
|
1004 | |||
1002 | ``update`` |
|
1005 | ``update`` | |
1003 | Run after updating the working directory. Changeset ID of first |
|
1006 | Run after updating the working directory. Changeset ID of first | |
1004 | new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is |
|
1007 | new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is | |
1005 | in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
|
1008 | in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the | |
1006 | update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. |
|
1009 | update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. | |
1007 |
|
1010 | |||
1008 | .. note:: |
|
1011 | .. note:: | |
1009 |
|
1012 | |||
1010 | It is generally better to use standard hooks rather than the |
|
1013 | It is generally better to use standard hooks rather than the | |
1011 | generic pre- and post- command hooks as they are guaranteed to be |
|
1014 | generic pre- and post- command hooks as they are guaranteed to be | |
1012 | called in the appropriate contexts for influencing transactions. |
|
1015 | called in the appropriate contexts for influencing transactions. | |
1013 | Also, hooks like "commit" will be called in all contexts that |
|
1016 | Also, hooks like "commit" will be called in all contexts that | |
1014 | generate a commit (e.g. tag) and not just the commit command. |
|
1017 | generate a commit (e.g. tag) and not just the commit command. | |
1015 |
|
1018 | |||
1016 | .. note:: |
|
1019 | .. note:: | |
1017 |
|
1020 | |||
1018 | Environment variables with empty values may not be passed to |
|
1021 | Environment variables with empty values may not be passed to | |
1019 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
|
1022 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` | |
1020 | will have an empty value under Unix-like platforms for non-merge |
|
1023 | will have an empty value under Unix-like platforms for non-merge | |
1021 | changesets, while it will not be available at all under Windows. |
|
1024 | changesets, while it will not be available at all under Windows. | |
1022 |
|
1025 | |||
1023 | The syntax for Python hooks is as follows:: |
|
1026 | The syntax for Python hooks is as follows:: | |
1024 |
|
1027 | |||
1025 | hookname = python:modulename.submodule.callable |
|
1028 | hookname = python:modulename.submodule.callable | |
1026 | hookname = python:/path/to/python/module.py:callable |
|
1029 | hookname = python:/path/to/python/module.py:callable | |
1027 |
|
1030 | |||
1028 | Python hooks are run within the Mercurial process. Each hook is |
|
1031 | Python hooks are run within the Mercurial process. Each hook is | |
1029 | called with at least three keyword arguments: a ui object (keyword |
|
1032 | called with at least three keyword arguments: a ui object (keyword | |
1030 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` |
|
1033 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` | |
1031 | keyword that tells what kind of hook is used. Arguments listed as |
|
1034 | keyword that tells what kind of hook is used. Arguments listed as | |
1032 | environment variables above are passed as keyword arguments, with no |
|
1035 | environment variables above are passed as keyword arguments, with no | |
1033 | ``HG_`` prefix, and names in lower case. |
|
1036 | ``HG_`` prefix, and names in lower case. | |
1034 |
|
1037 | |||
1035 | If a Python hook returns a "true" value or raises an exception, this |
|
1038 | If a Python hook returns a "true" value or raises an exception, this | |
1036 | is treated as a failure. |
|
1039 | is treated as a failure. | |
1037 |
|
1040 | |||
1038 |
|
1041 | |||
1039 | ``hostfingerprints`` |
|
1042 | ``hostfingerprints`` | |
1040 | -------------------- |
|
1043 | -------------------- | |
1041 |
|
1044 | |||
1042 | (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.) |
|
1045 | (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.) | |
1043 |
|
1046 | |||
1044 | Fingerprints of the certificates of known HTTPS servers. |
|
1047 | Fingerprints of the certificates of known HTTPS servers. | |
1045 |
|
1048 | |||
1046 | A HTTPS connection to a server with a fingerprint configured here will |
|
1049 | A HTTPS connection to a server with a fingerprint configured here will | |
1047 | only succeed if the servers certificate matches the fingerprint. |
|
1050 | only succeed if the servers certificate matches the fingerprint. | |
1048 | This is very similar to how ssh known hosts works. |
|
1051 | This is very similar to how ssh known hosts works. | |
1049 |
|
1052 | |||
1050 | The fingerprint is the SHA-1 hash value of the DER encoded certificate. |
|
1053 | The fingerprint is the SHA-1 hash value of the DER encoded certificate. | |
1051 | Multiple values can be specified (separated by spaces or commas). This can |
|
1054 | Multiple values can be specified (separated by spaces or commas). This can | |
1052 | be used to define both old and new fingerprints while a host transitions |
|
1055 | be used to define both old and new fingerprints while a host transitions | |
1053 | to a new certificate. |
|
1056 | to a new certificate. | |
1054 |
|
1057 | |||
1055 | The CA chain and web.cacerts is not used for servers with a fingerprint. |
|
1058 | The CA chain and web.cacerts is not used for servers with a fingerprint. | |
1056 |
|
1059 | |||
1057 | For example:: |
|
1060 | For example:: | |
1058 |
|
1061 | |||
1059 | [hostfingerprints] |
|
1062 | [hostfingerprints] | |
1060 | hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1063 | hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 | |
1061 | hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1064 | hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 | |
1062 |
|
1065 | |||
1063 | ``hostsecurity`` |
|
1066 | ``hostsecurity`` | |
1064 | ---------------- |
|
1067 | ---------------- | |
1065 |
|
1068 | |||
1066 | Used to specify global and per-host security settings for connecting to |
|
1069 | Used to specify global and per-host security settings for connecting to | |
1067 | other machines. |
|
1070 | other machines. | |
1068 |
|
1071 | |||
1069 | The following options control default behavior for all hosts. |
|
1072 | The following options control default behavior for all hosts. | |
1070 |
|
1073 | |||
1071 | ``ciphers`` |
|
1074 | ``ciphers`` | |
1072 | Defines the cryptographic ciphers to use for connections. |
|
1075 | Defines the cryptographic ciphers to use for connections. | |
1073 |
|
1076 | |||
1074 | Value must be a valid OpenSSL Cipher List Format as documented at |
|
1077 | Value must be a valid OpenSSL Cipher List Format as documented at | |
1075 | https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT. |
|
1078 | https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT. | |
1076 |
|
1079 | |||
1077 | This setting is for advanced users only. Setting to incorrect values |
|
1080 | This setting is for advanced users only. Setting to incorrect values | |
1078 | can significantly lower connection security or decrease performance. |
|
1081 | can significantly lower connection security or decrease performance. | |
1079 | You have been warned. |
|
1082 | You have been warned. | |
1080 |
|
1083 | |||
1081 | This option requires Python 2.7. |
|
1084 | This option requires Python 2.7. | |
1082 |
|
1085 | |||
1083 | ``minimumprotocol`` |
|
1086 | ``minimumprotocol`` | |
1084 | Defines the minimum channel encryption protocol to use. |
|
1087 | Defines the minimum channel encryption protocol to use. | |
1085 |
|
1088 | |||
1086 | By default, the highest version of TLS supported by both client and server |
|
1089 | By default, the highest version of TLS supported by both client and server | |
1087 | is used. |
|
1090 | is used. | |
1088 |
|
1091 | |||
1089 | Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``. |
|
1092 | Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``. | |
1090 |
|
1093 | |||
1091 | When running on an old Python version, only ``tls1.0`` is allowed since |
|
1094 | When running on an old Python version, only ``tls1.0`` is allowed since | |
1092 | old versions of Python only support up to TLS 1.0. |
|
1095 | old versions of Python only support up to TLS 1.0. | |
1093 |
|
1096 | |||
1094 | When running a Python that supports modern TLS versions, the default is |
|
1097 | When running a Python that supports modern TLS versions, the default is | |
1095 | ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this |
|
1098 | ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this | |
1096 | weakens security and should only be used as a feature of last resort if |
|
1099 | weakens security and should only be used as a feature of last resort if | |
1097 | a server does not support TLS 1.1+. |
|
1100 | a server does not support TLS 1.1+. | |
1098 |
|
1101 | |||
1099 | Options in the ``[hostsecurity]`` section can have the form |
|
1102 | Options in the ``[hostsecurity]`` section can have the form | |
1100 | ``hostname``:``setting``. This allows multiple settings to be defined on a |
|
1103 | ``hostname``:``setting``. This allows multiple settings to be defined on a | |
1101 | per-host basis. |
|
1104 | per-host basis. | |
1102 |
|
1105 | |||
1103 | The following per-host settings can be defined. |
|
1106 | The following per-host settings can be defined. | |
1104 |
|
1107 | |||
1105 | ``ciphers`` |
|
1108 | ``ciphers`` | |
1106 | This behaves like ``ciphers`` as described above except it only applies |
|
1109 | This behaves like ``ciphers`` as described above except it only applies | |
1107 | to the host on which it is defined. |
|
1110 | to the host on which it is defined. | |
1108 |
|
1111 | |||
1109 | ``fingerprints`` |
|
1112 | ``fingerprints`` | |
1110 | A list of hashes of the DER encoded peer/remote certificate. Values have |
|
1113 | A list of hashes of the DER encoded peer/remote certificate. Values have | |
1111 | the form ``algorithm``:``fingerprint``. e.g. |
|
1114 | the form ``algorithm``:``fingerprint``. e.g. | |
1112 | ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``. |
|
1115 | ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``. | |
1113 |
|
1116 | |||
1114 | The following algorithms/prefixes are supported: ``sha1``, ``sha256``, |
|
1117 | The following algorithms/prefixes are supported: ``sha1``, ``sha256``, | |
1115 | ``sha512``. |
|
1118 | ``sha512``. | |
1116 |
|
1119 | |||
1117 | Use of ``sha256`` or ``sha512`` is preferred. |
|
1120 | Use of ``sha256`` or ``sha512`` is preferred. | |
1118 |
|
1121 | |||
1119 | If a fingerprint is specified, the CA chain is not validated for this |
|
1122 | If a fingerprint is specified, the CA chain is not validated for this | |
1120 | host and Mercurial will require the remote certificate to match one |
|
1123 | host and Mercurial will require the remote certificate to match one | |
1121 | of the fingerprints specified. This means if the server updates its |
|
1124 | of the fingerprints specified. This means if the server updates its | |
1122 | certificate, Mercurial will abort until a new fingerprint is defined. |
|
1125 | certificate, Mercurial will abort until a new fingerprint is defined. | |
1123 | This can provide stronger security than traditional CA-based validation |
|
1126 | This can provide stronger security than traditional CA-based validation | |
1124 | at the expense of convenience. |
|
1127 | at the expense of convenience. | |
1125 |
|
1128 | |||
1126 | This option takes precedence over ``verifycertsfile``. |
|
1129 | This option takes precedence over ``verifycertsfile``. | |
1127 |
|
1130 | |||
1128 | ``minimumprotocol`` |
|
1131 | ``minimumprotocol`` | |
1129 | This behaves like ``minimumprotocol`` as described above except it |
|
1132 | This behaves like ``minimumprotocol`` as described above except it | |
1130 | only applies to the host on which it is defined. |
|
1133 | only applies to the host on which it is defined. | |
1131 |
|
1134 | |||
1132 | ``verifycertsfile`` |
|
1135 | ``verifycertsfile`` | |
1133 | Path to file a containing a list of PEM encoded certificates used to |
|
1136 | Path to file a containing a list of PEM encoded certificates used to | |
1134 | verify the server certificate. Environment variables and ``~user`` |
|
1137 | verify the server certificate. Environment variables and ``~user`` | |
1135 | constructs are expanded in the filename. |
|
1138 | constructs are expanded in the filename. | |
1136 |
|
1139 | |||
1137 | The server certificate or the certificate's certificate authority (CA) |
|
1140 | The server certificate or the certificate's certificate authority (CA) | |
1138 | must match a certificate from this file or certificate verification |
|
1141 | must match a certificate from this file or certificate verification | |
1139 | will fail and connections to the server will be refused. |
|
1142 | will fail and connections to the server will be refused. | |
1140 |
|
1143 | |||
1141 | If defined, only certificates provided by this file will be used: |
|
1144 | If defined, only certificates provided by this file will be used: | |
1142 | ``web.cacerts`` and any system/default certificates will not be |
|
1145 | ``web.cacerts`` and any system/default certificates will not be | |
1143 | used. |
|
1146 | used. | |
1144 |
|
1147 | |||
1145 | This option has no effect if the per-host ``fingerprints`` option |
|
1148 | This option has no effect if the per-host ``fingerprints`` option | |
1146 | is set. |
|
1149 | is set. | |
1147 |
|
1150 | |||
1148 | The format of the file is as follows:: |
|
1151 | The format of the file is as follows:: | |
1149 |
|
1152 | |||
1150 | -----BEGIN CERTIFICATE----- |
|
1153 | -----BEGIN CERTIFICATE----- | |
1151 | ... (certificate in base64 PEM encoding) ... |
|
1154 | ... (certificate in base64 PEM encoding) ... | |
1152 | -----END CERTIFICATE----- |
|
1155 | -----END CERTIFICATE----- | |
1153 | -----BEGIN CERTIFICATE----- |
|
1156 | -----BEGIN CERTIFICATE----- | |
1154 | ... (certificate in base64 PEM encoding) ... |
|
1157 | ... (certificate in base64 PEM encoding) ... | |
1155 | -----END CERTIFICATE----- |
|
1158 | -----END CERTIFICATE----- | |
1156 |
|
1159 | |||
1157 | For example:: |
|
1160 | For example:: | |
1158 |
|
1161 | |||
1159 | [hostsecurity] |
|
1162 | [hostsecurity] | |
1160 | hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 |
|
1163 | hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 | |
1161 | hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1164 | hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 | |
1162 | foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem |
|
1165 | foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem | |
1163 |
|
1166 | |||
1164 | To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1 |
|
1167 | To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1 | |
1165 | when connecting to ``hg.example.com``:: |
|
1168 | when connecting to ``hg.example.com``:: | |
1166 |
|
1169 | |||
1167 | [hostsecurity] |
|
1170 | [hostsecurity] | |
1168 | minimumprotocol = tls1.2 |
|
1171 | minimumprotocol = tls1.2 | |
1169 | hg.example.com:minimumprotocol = tls1.1 |
|
1172 | hg.example.com:minimumprotocol = tls1.1 | |
1170 |
|
1173 | |||
1171 | ``http_proxy`` |
|
1174 | ``http_proxy`` | |
1172 | -------------- |
|
1175 | -------------- | |
1173 |
|
1176 | |||
1174 | Used to access web-based Mercurial repositories through a HTTP |
|
1177 | Used to access web-based Mercurial repositories through a HTTP | |
1175 | proxy. |
|
1178 | proxy. | |
1176 |
|
1179 | |||
1177 | ``host`` |
|
1180 | ``host`` | |
1178 | Host name and (optional) port of the proxy server, for example |
|
1181 | Host name and (optional) port of the proxy server, for example | |
1179 | "myproxy:8000". |
|
1182 | "myproxy:8000". | |
1180 |
|
1183 | |||
1181 | ``no`` |
|
1184 | ``no`` | |
1182 | Optional. Comma-separated list of host names that should bypass |
|
1185 | Optional. Comma-separated list of host names that should bypass | |
1183 | the proxy. |
|
1186 | the proxy. | |
1184 |
|
1187 | |||
1185 | ``passwd`` |
|
1188 | ``passwd`` | |
1186 | Optional. Password to authenticate with at the proxy server. |
|
1189 | Optional. Password to authenticate with at the proxy server. | |
1187 |
|
1190 | |||
1188 | ``user`` |
|
1191 | ``user`` | |
1189 | Optional. User name to authenticate with at the proxy server. |
|
1192 | Optional. User name to authenticate with at the proxy server. | |
1190 |
|
1193 | |||
1191 | ``always`` |
|
1194 | ``always`` | |
1192 | Optional. Always use the proxy, even for localhost and any entries |
|
1195 | Optional. Always use the proxy, even for localhost and any entries | |
1193 | in ``http_proxy.no``. (default: False) |
|
1196 | in ``http_proxy.no``. (default: False) | |
1194 |
|
1197 | |||
1195 | ``merge`` |
|
1198 | ``merge`` | |
1196 | --------- |
|
1199 | --------- | |
1197 |
|
1200 | |||
1198 | This section specifies behavior during merges and updates. |
|
1201 | This section specifies behavior during merges and updates. | |
1199 |
|
1202 | |||
1200 | ``checkignored`` |
|
1203 | ``checkignored`` | |
1201 | Controls behavior when an ignored file on disk has the same name as a tracked |
|
1204 | Controls behavior when an ignored file on disk has the same name as a tracked | |
1202 | file in the changeset being merged or updated to, and has different |
|
1205 | file in the changeset being merged or updated to, and has different | |
1203 | contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``, |
|
1206 | contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``, | |
1204 | abort on such files. With ``warn``, warn on such files and back them up as |
|
1207 | abort on such files. With ``warn``, warn on such files and back them up as | |
1205 | ``.orig``. With ``ignore``, don't print a warning and back them up as |
|
1208 | ``.orig``. With ``ignore``, don't print a warning and back them up as | |
1206 | ``.orig``. (default: ``abort``) |
|
1209 | ``.orig``. (default: ``abort``) | |
1207 |
|
1210 | |||
1208 | ``checkunknown`` |
|
1211 | ``checkunknown`` | |
1209 | Controls behavior when an unknown file that isn't ignored has the same name |
|
1212 | Controls behavior when an unknown file that isn't ignored has the same name | |
1210 | as a tracked file in the changeset being merged or updated to, and has |
|
1213 | as a tracked file in the changeset being merged or updated to, and has | |
1211 | different contents. Similar to ``merge.checkignored``, except for files that |
|
1214 | different contents. Similar to ``merge.checkignored``, except for files that | |
1212 | are not ignored. (default: ``abort``) |
|
1215 | are not ignored. (default: ``abort``) | |
1213 |
|
1216 | |||
1214 | ``merge-patterns`` |
|
1217 | ``merge-patterns`` | |
1215 | ------------------ |
|
1218 | ------------------ | |
1216 |
|
1219 | |||
1217 | This section specifies merge tools to associate with particular file |
|
1220 | This section specifies merge tools to associate with particular file | |
1218 | patterns. Tools matched here will take precedence over the default |
|
1221 | patterns. Tools matched here will take precedence over the default | |
1219 | merge tool. Patterns are globs by default, rooted at the repository |
|
1222 | merge tool. Patterns are globs by default, rooted at the repository | |
1220 | root. |
|
1223 | root. | |
1221 |
|
1224 | |||
1222 | Example:: |
|
1225 | Example:: | |
1223 |
|
1226 | |||
1224 | [merge-patterns] |
|
1227 | [merge-patterns] | |
1225 | **.c = kdiff3 |
|
1228 | **.c = kdiff3 | |
1226 | **.jpg = myimgmerge |
|
1229 | **.jpg = myimgmerge | |
1227 |
|
1230 | |||
1228 | ``merge-tools`` |
|
1231 | ``merge-tools`` | |
1229 | --------------- |
|
1232 | --------------- | |
1230 |
|
1233 | |||
1231 | This section configures external merge tools to use for file-level |
|
1234 | This section configures external merge tools to use for file-level | |
1232 | merges. This section has likely been preconfigured at install time. |
|
1235 | merges. This section has likely been preconfigured at install time. | |
1233 | Use :hg:`config merge-tools` to check the existing configuration. |
|
1236 | Use :hg:`config merge-tools` to check the existing configuration. | |
1234 | Also see :hg:`help merge-tools` for more details. |
|
1237 | Also see :hg:`help merge-tools` for more details. | |
1235 |
|
1238 | |||
1236 | Example ``~/.hgrc``:: |
|
1239 | Example ``~/.hgrc``:: | |
1237 |
|
1240 | |||
1238 | [merge-tools] |
|
1241 | [merge-tools] | |
1239 | # Override stock tool location |
|
1242 | # Override stock tool location | |
1240 | kdiff3.executable = ~/bin/kdiff3 |
|
1243 | kdiff3.executable = ~/bin/kdiff3 | |
1241 | # Specify command line |
|
1244 | # Specify command line | |
1242 | kdiff3.args = $base $local $other -o $output |
|
1245 | kdiff3.args = $base $local $other -o $output | |
1243 | # Give higher priority |
|
1246 | # Give higher priority | |
1244 | kdiff3.priority = 1 |
|
1247 | kdiff3.priority = 1 | |
1245 |
|
1248 | |||
1246 | # Changing the priority of preconfigured tool |
|
1249 | # Changing the priority of preconfigured tool | |
1247 | meld.priority = 0 |
|
1250 | meld.priority = 0 | |
1248 |
|
1251 | |||
1249 | # Disable a preconfigured tool |
|
1252 | # Disable a preconfigured tool | |
1250 | vimdiff.disabled = yes |
|
1253 | vimdiff.disabled = yes | |
1251 |
|
1254 | |||
1252 | # Define new tool |
|
1255 | # Define new tool | |
1253 | myHtmlTool.args = -m $local $other $base $output |
|
1256 | myHtmlTool.args = -m $local $other $base $output | |
1254 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge |
|
1257 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge | |
1255 | myHtmlTool.priority = 1 |
|
1258 | myHtmlTool.priority = 1 | |
1256 |
|
1259 | |||
1257 | Supported arguments: |
|
1260 | Supported arguments: | |
1258 |
|
1261 | |||
1259 | ``priority`` |
|
1262 | ``priority`` | |
1260 | The priority in which to evaluate this tool. |
|
1263 | The priority in which to evaluate this tool. | |
1261 | (default: 0) |
|
1264 | (default: 0) | |
1262 |
|
1265 | |||
1263 | ``executable`` |
|
1266 | ``executable`` | |
1264 | Either just the name of the executable or its pathname. |
|
1267 | Either just the name of the executable or its pathname. | |
1265 |
|
1268 | |||
1266 | .. container:: windows |
|
1269 | .. container:: windows | |
1267 |
|
1270 | |||
1268 | On Windows, the path can use environment variables with ${ProgramFiles} |
|
1271 | On Windows, the path can use environment variables with ${ProgramFiles} | |
1269 | syntax. |
|
1272 | syntax. | |
1270 |
|
1273 | |||
1271 | (default: the tool name) |
|
1274 | (default: the tool name) | |
1272 |
|
1275 | |||
1273 | ``args`` |
|
1276 | ``args`` | |
1274 | The arguments to pass to the tool executable. You can refer to the |
|
1277 | The arguments to pass to the tool executable. You can refer to the | |
1275 | files being merged as well as the output file through these |
|
1278 | files being merged as well as the output file through these | |
1276 | variables: ``$base``, ``$local``, ``$other``, ``$output``. The meaning |
|
1279 | variables: ``$base``, ``$local``, ``$other``, ``$output``. The meaning | |
1277 | of ``$local`` and ``$other`` can vary depending on which action is being |
|
1280 | of ``$local`` and ``$other`` can vary depending on which action is being | |
1278 | performed. During and update or merge, ``$local`` represents the original |
|
1281 | performed. During and update or merge, ``$local`` represents the original | |
1279 | state of the file, while ``$other`` represents the commit you are updating |
|
1282 | state of the file, while ``$other`` represents the commit you are updating | |
1280 | to or the commit you are merging with. During a rebase ``$local`` |
|
1283 | to or the commit you are merging with. During a rebase ``$local`` | |
1281 | represents the destination of the rebase, and ``$other`` represents the |
|
1284 | represents the destination of the rebase, and ``$other`` represents the | |
1282 | commit being rebased. |
|
1285 | commit being rebased. | |
1283 | (default: ``$local $base $other``) |
|
1286 | (default: ``$local $base $other``) | |
1284 |
|
1287 | |||
1285 | ``premerge`` |
|
1288 | ``premerge`` | |
1286 | Attempt to run internal non-interactive 3-way merge tool before |
|
1289 | Attempt to run internal non-interactive 3-way merge tool before | |
1287 | launching external tool. Options are ``true``, ``false``, ``keep`` or |
|
1290 | launching external tool. Options are ``true``, ``false``, ``keep`` or | |
1288 | ``keep-merge3``. The ``keep`` option will leave markers in the file if the |
|
1291 | ``keep-merge3``. The ``keep`` option will leave markers in the file if the | |
1289 | premerge fails. The ``keep-merge3`` will do the same but include information |
|
1292 | premerge fails. The ``keep-merge3`` will do the same but include information | |
1290 | about the base of the merge in the marker (see internal :merge3 in |
|
1293 | about the base of the merge in the marker (see internal :merge3 in | |
1291 | :hg:`help merge-tools`). |
|
1294 | :hg:`help merge-tools`). | |
1292 | (default: True) |
|
1295 | (default: True) | |
1293 |
|
1296 | |||
1294 | ``binary`` |
|
1297 | ``binary`` | |
1295 | This tool can merge binary files. (default: False, unless tool |
|
1298 | This tool can merge binary files. (default: False, unless tool | |
1296 | was selected by file pattern match) |
|
1299 | was selected by file pattern match) | |
1297 |
|
1300 | |||
1298 | ``symlink`` |
|
1301 | ``symlink`` | |
1299 | This tool can merge symlinks. (default: False) |
|
1302 | This tool can merge symlinks. (default: False) | |
1300 |
|
1303 | |||
1301 | ``check`` |
|
1304 | ``check`` | |
1302 | A list of merge success-checking options: |
|
1305 | A list of merge success-checking options: | |
1303 |
|
1306 | |||
1304 | ``changed`` |
|
1307 | ``changed`` | |
1305 | Ask whether merge was successful when the merged file shows no changes. |
|
1308 | Ask whether merge was successful when the merged file shows no changes. | |
1306 | ``conflicts`` |
|
1309 | ``conflicts`` | |
1307 | Check whether there are conflicts even though the tool reported success. |
|
1310 | Check whether there are conflicts even though the tool reported success. | |
1308 | ``prompt`` |
|
1311 | ``prompt`` | |
1309 | Always prompt for merge success, regardless of success reported by tool. |
|
1312 | Always prompt for merge success, regardless of success reported by tool. | |
1310 |
|
1313 | |||
1311 | ``fixeol`` |
|
1314 | ``fixeol`` | |
1312 | Attempt to fix up EOL changes caused by the merge tool. |
|
1315 | Attempt to fix up EOL changes caused by the merge tool. | |
1313 | (default: False) |
|
1316 | (default: False) | |
1314 |
|
1317 | |||
1315 | ``gui`` |
|
1318 | ``gui`` | |
1316 | This tool requires a graphical interface to run. (default: False) |
|
1319 | This tool requires a graphical interface to run. (default: False) | |
1317 |
|
1320 | |||
1318 | .. container:: windows |
|
1321 | .. container:: windows | |
1319 |
|
1322 | |||
1320 | ``regkey`` |
|
1323 | ``regkey`` | |
1321 | Windows registry key which describes install location of this |
|
1324 | Windows registry key which describes install location of this | |
1322 | tool. Mercurial will search for this key first under |
|
1325 | tool. Mercurial will search for this key first under | |
1323 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. |
|
1326 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. | |
1324 | (default: None) |
|
1327 | (default: None) | |
1325 |
|
1328 | |||
1326 | ``regkeyalt`` |
|
1329 | ``regkeyalt`` | |
1327 | An alternate Windows registry key to try if the first key is not |
|
1330 | An alternate Windows registry key to try if the first key is not | |
1328 | found. The alternate key uses the same ``regname`` and ``regappend`` |
|
1331 | found. The alternate key uses the same ``regname`` and ``regappend`` | |
1329 | semantics of the primary key. The most common use for this key |
|
1332 | semantics of the primary key. The most common use for this key | |
1330 | is to search for 32bit applications on 64bit operating systems. |
|
1333 | is to search for 32bit applications on 64bit operating systems. | |
1331 | (default: None) |
|
1334 | (default: None) | |
1332 |
|
1335 | |||
1333 | ``regname`` |
|
1336 | ``regname`` | |
1334 | Name of value to read from specified registry key. |
|
1337 | Name of value to read from specified registry key. | |
1335 | (default: the unnamed (default) value) |
|
1338 | (default: the unnamed (default) value) | |
1336 |
|
1339 | |||
1337 | ``regappend`` |
|
1340 | ``regappend`` | |
1338 | String to append to the value read from the registry, typically |
|
1341 | String to append to the value read from the registry, typically | |
1339 | the executable name of the tool. |
|
1342 | the executable name of the tool. | |
1340 | (default: None) |
|
1343 | (default: None) | |
1341 |
|
1344 | |||
1342 |
|
1345 | |||
1343 | ``patch`` |
|
1346 | ``patch`` | |
1344 | --------- |
|
1347 | --------- | |
1345 |
|
1348 | |||
1346 | Settings used when applying patches, for instance through the 'import' |
|
1349 | Settings used when applying patches, for instance through the 'import' | |
1347 | command or with Mercurial Queues extension. |
|
1350 | command or with Mercurial Queues extension. | |
1348 |
|
1351 | |||
1349 | ``eol`` |
|
1352 | ``eol`` | |
1350 | When set to 'strict' patch content and patched files end of lines |
|
1353 | When set to 'strict' patch content and patched files end of lines | |
1351 | are preserved. When set to ``lf`` or ``crlf``, both files end of |
|
1354 | are preserved. When set to ``lf`` or ``crlf``, both files end of | |
1352 | lines are ignored when patching and the result line endings are |
|
1355 | lines are ignored when patching and the result line endings are | |
1353 | normalized to either LF (Unix) or CRLF (Windows). When set to |
|
1356 | normalized to either LF (Unix) or CRLF (Windows). When set to | |
1354 | ``auto``, end of lines are again ignored while patching but line |
|
1357 | ``auto``, end of lines are again ignored while patching but line | |
1355 | endings in patched files are normalized to their original setting |
|
1358 | endings in patched files are normalized to their original setting | |
1356 | on a per-file basis. If target file does not exist or has no end |
|
1359 | on a per-file basis. If target file does not exist or has no end | |
1357 | of line, patch line endings are preserved. |
|
1360 | of line, patch line endings are preserved. | |
1358 | (default: strict) |
|
1361 | (default: strict) | |
1359 |
|
1362 | |||
1360 | ``fuzz`` |
|
1363 | ``fuzz`` | |
1361 | The number of lines of 'fuzz' to allow when applying patches. This |
|
1364 | The number of lines of 'fuzz' to allow when applying patches. This | |
1362 | controls how much context the patcher is allowed to ignore when |
|
1365 | controls how much context the patcher is allowed to ignore when | |
1363 | trying to apply a patch. |
|
1366 | trying to apply a patch. | |
1364 | (default: 2) |
|
1367 | (default: 2) | |
1365 |
|
1368 | |||
1366 | ``paths`` |
|
1369 | ``paths`` | |
1367 | --------- |
|
1370 | --------- | |
1368 |
|
1371 | |||
1369 | Assigns symbolic names and behavior to repositories. |
|
1372 | Assigns symbolic names and behavior to repositories. | |
1370 |
|
1373 | |||
1371 | Options are symbolic names defining the URL or directory that is the |
|
1374 | Options are symbolic names defining the URL or directory that is the | |
1372 | location of the repository. Example:: |
|
1375 | location of the repository. Example:: | |
1373 |
|
1376 | |||
1374 | [paths] |
|
1377 | [paths] | |
1375 | my_server = https://example.com/my_repo |
|
1378 | my_server = https://example.com/my_repo | |
1376 | local_path = /home/me/repo |
|
1379 | local_path = /home/me/repo | |
1377 |
|
1380 | |||
1378 | These symbolic names can be used from the command line. To pull |
|
1381 | These symbolic names can be used from the command line. To pull | |
1379 | from ``my_server``: :hg:`pull my_server`. To push to ``local_path``: |
|
1382 | from ``my_server``: :hg:`pull my_server`. To push to ``local_path``: | |
1380 | :hg:`push local_path`. |
|
1383 | :hg:`push local_path`. | |
1381 |
|
1384 | |||
1382 | Options containing colons (``:``) denote sub-options that can influence |
|
1385 | Options containing colons (``:``) denote sub-options that can influence | |
1383 | behavior for that specific path. Example:: |
|
1386 | behavior for that specific path. Example:: | |
1384 |
|
1387 | |||
1385 | [paths] |
|
1388 | [paths] | |
1386 | my_server = https://example.com/my_path |
|
1389 | my_server = https://example.com/my_path | |
1387 | my_server:pushurl = ssh://example.com/my_path |
|
1390 | my_server:pushurl = ssh://example.com/my_path | |
1388 |
|
1391 | |||
1389 | The following sub-options can be defined: |
|
1392 | The following sub-options can be defined: | |
1390 |
|
1393 | |||
1391 | ``pushurl`` |
|
1394 | ``pushurl`` | |
1392 | The URL to use for push operations. If not defined, the location |
|
1395 | The URL to use for push operations. If not defined, the location | |
1393 | defined by the path's main entry is used. |
|
1396 | defined by the path's main entry is used. | |
1394 |
|
1397 | |||
1395 | ``pushrev`` |
|
1398 | ``pushrev`` | |
1396 | A revset defining which revisions to push by default. |
|
1399 | A revset defining which revisions to push by default. | |
1397 |
|
1400 | |||
1398 | When :hg:`push` is executed without a ``-r`` argument, the revset |
|
1401 | When :hg:`push` is executed without a ``-r`` argument, the revset | |
1399 | defined by this sub-option is evaluated to determine what to push. |
|
1402 | defined by this sub-option is evaluated to determine what to push. | |
1400 |
|
1403 | |||
1401 | For example, a value of ``.`` will push the working directory's |
|
1404 | For example, a value of ``.`` will push the working directory's | |
1402 | revision by default. |
|
1405 | revision by default. | |
1403 |
|
1406 | |||
1404 | Revsets specifying bookmarks will not result in the bookmark being |
|
1407 | Revsets specifying bookmarks will not result in the bookmark being | |
1405 | pushed. |
|
1408 | pushed. | |
1406 |
|
1409 | |||
1407 | The following special named paths exist: |
|
1410 | The following special named paths exist: | |
1408 |
|
1411 | |||
1409 | ``default`` |
|
1412 | ``default`` | |
1410 | The URL or directory to use when no source or remote is specified. |
|
1413 | The URL or directory to use when no source or remote is specified. | |
1411 |
|
1414 | |||
1412 | :hg:`clone` will automatically define this path to the location the |
|
1415 | :hg:`clone` will automatically define this path to the location the | |
1413 | repository was cloned from. |
|
1416 | repository was cloned from. | |
1414 |
|
1417 | |||
1415 | ``default-push`` |
|
1418 | ``default-push`` | |
1416 | (deprecated) The URL or directory for the default :hg:`push` location. |
|
1419 | (deprecated) The URL or directory for the default :hg:`push` location. | |
1417 | ``default:pushurl`` should be used instead. |
|
1420 | ``default:pushurl`` should be used instead. | |
1418 |
|
1421 | |||
1419 | ``phases`` |
|
1422 | ``phases`` | |
1420 | ---------- |
|
1423 | ---------- | |
1421 |
|
1424 | |||
1422 | Specifies default handling of phases. See :hg:`help phases` for more |
|
1425 | Specifies default handling of phases. See :hg:`help phases` for more | |
1423 | information about working with phases. |
|
1426 | information about working with phases. | |
1424 |
|
1427 | |||
1425 | ``publish`` |
|
1428 | ``publish`` | |
1426 | Controls draft phase behavior when working as a server. When true, |
|
1429 | Controls draft phase behavior when working as a server. When true, | |
1427 | pushed changesets are set to public in both client and server and |
|
1430 | pushed changesets are set to public in both client and server and | |
1428 | pulled or cloned changesets are set to public in the client. |
|
1431 | pulled or cloned changesets are set to public in the client. | |
1429 | (default: True) |
|
1432 | (default: True) | |
1430 |
|
1433 | |||
1431 | ``new-commit`` |
|
1434 | ``new-commit`` | |
1432 | Phase of newly-created commits. |
|
1435 | Phase of newly-created commits. | |
1433 | (default: draft) |
|
1436 | (default: draft) | |
1434 |
|
1437 | |||
1435 | ``checksubrepos`` |
|
1438 | ``checksubrepos`` | |
1436 | Check the phase of the current revision of each subrepository. Allowed |
|
1439 | Check the phase of the current revision of each subrepository. Allowed | |
1437 | values are "ignore", "follow" and "abort". For settings other than |
|
1440 | values are "ignore", "follow" and "abort". For settings other than | |
1438 | "ignore", the phase of the current revision of each subrepository is |
|
1441 | "ignore", the phase of the current revision of each subrepository is | |
1439 | checked before committing the parent repository. If any of those phases is |
|
1442 | checked before committing the parent repository. If any of those phases is | |
1440 | greater than the phase of the parent repository (e.g. if a subrepo is in a |
|
1443 | greater than the phase of the parent repository (e.g. if a subrepo is in a | |
1441 | "secret" phase while the parent repo is in "draft" phase), the commit is |
|
1444 | "secret" phase while the parent repo is in "draft" phase), the commit is | |
1442 | either aborted (if checksubrepos is set to "abort") or the higher phase is |
|
1445 | either aborted (if checksubrepos is set to "abort") or the higher phase is | |
1443 | used for the parent repository commit (if set to "follow"). |
|
1446 | used for the parent repository commit (if set to "follow"). | |
1444 | (default: follow) |
|
1447 | (default: follow) | |
1445 |
|
1448 | |||
1446 |
|
1449 | |||
1447 | ``profiling`` |
|
1450 | ``profiling`` | |
1448 | ------------- |
|
1451 | ------------- | |
1449 |
|
1452 | |||
1450 | Specifies profiling type, format, and file output. Two profilers are |
|
1453 | Specifies profiling type, format, and file output. Two profilers are | |
1451 | supported: an instrumenting profiler (named ``ls``), and a sampling |
|
1454 | supported: an instrumenting profiler (named ``ls``), and a sampling | |
1452 | profiler (named ``stat``). |
|
1455 | profiler (named ``stat``). | |
1453 |
|
1456 | |||
1454 | In this section description, 'profiling data' stands for the raw data |
|
1457 | In this section description, 'profiling data' stands for the raw data | |
1455 | collected during profiling, while 'profiling report' stands for a |
|
1458 | collected during profiling, while 'profiling report' stands for a | |
1456 | statistical text report generated from the profiling data. The |
|
1459 | statistical text report generated from the profiling data. The | |
1457 | profiling is done using lsprof. |
|
1460 | profiling is done using lsprof. | |
1458 |
|
1461 | |||
1459 | ``enabled`` |
|
1462 | ``enabled`` | |
1460 | Enable the profiler. |
|
1463 | Enable the profiler. | |
1461 | (default: false) |
|
1464 | (default: false) | |
1462 |
|
1465 | |||
1463 | This is equivalent to passing ``--profile`` on the command line. |
|
1466 | This is equivalent to passing ``--profile`` on the command line. | |
1464 |
|
1467 | |||
1465 | ``type`` |
|
1468 | ``type`` | |
1466 | The type of profiler to use. |
|
1469 | The type of profiler to use. | |
1467 | (default: stat) |
|
1470 | (default: stat) | |
1468 |
|
1471 | |||
1469 | ``ls`` |
|
1472 | ``ls`` | |
1470 | Use Python's built-in instrumenting profiler. This profiler |
|
1473 | Use Python's built-in instrumenting profiler. This profiler | |
1471 | works on all platforms, but each line number it reports is the |
|
1474 | works on all platforms, but each line number it reports is the | |
1472 | first line of a function. This restriction makes it difficult to |
|
1475 | first line of a function. This restriction makes it difficult to | |
1473 | identify the expensive parts of a non-trivial function. |
|
1476 | identify the expensive parts of a non-trivial function. | |
1474 | ``stat`` |
|
1477 | ``stat`` | |
1475 | Use a statistical profiler, statprof. This profiler is most |
|
1478 | Use a statistical profiler, statprof. This profiler is most | |
1476 | useful for profiling commands that run for longer than about 0.1 |
|
1479 | useful for profiling commands that run for longer than about 0.1 | |
1477 | seconds. |
|
1480 | seconds. | |
1478 |
|
1481 | |||
1479 | ``format`` |
|
1482 | ``format`` | |
1480 | Profiling format. Specific to the ``ls`` instrumenting profiler. |
|
1483 | Profiling format. Specific to the ``ls`` instrumenting profiler. | |
1481 | (default: text) |
|
1484 | (default: text) | |
1482 |
|
1485 | |||
1483 | ``text`` |
|
1486 | ``text`` | |
1484 | Generate a profiling report. When saving to a file, it should be |
|
1487 | Generate a profiling report. When saving to a file, it should be | |
1485 | noted that only the report is saved, and the profiling data is |
|
1488 | noted that only the report is saved, and the profiling data is | |
1486 | not kept. |
|
1489 | not kept. | |
1487 | ``kcachegrind`` |
|
1490 | ``kcachegrind`` | |
1488 | Format profiling data for kcachegrind use: when saving to a |
|
1491 | Format profiling data for kcachegrind use: when saving to a | |
1489 | file, the generated file can directly be loaded into |
|
1492 | file, the generated file can directly be loaded into | |
1490 | kcachegrind. |
|
1493 | kcachegrind. | |
1491 |
|
1494 | |||
1492 | ``statformat`` |
|
1495 | ``statformat`` | |
1493 | Profiling format for the ``stat`` profiler. |
|
1496 | Profiling format for the ``stat`` profiler. | |
1494 | (default: hotpath) |
|
1497 | (default: hotpath) | |
1495 |
|
1498 | |||
1496 | ``hotpath`` |
|
1499 | ``hotpath`` | |
1497 | Show a tree-based display containing the hot path of execution (where |
|
1500 | Show a tree-based display containing the hot path of execution (where | |
1498 | most time was spent). |
|
1501 | most time was spent). | |
1499 | ``bymethod`` |
|
1502 | ``bymethod`` | |
1500 | Show a table of methods ordered by how frequently they are active. |
|
1503 | Show a table of methods ordered by how frequently they are active. | |
1501 | ``byline`` |
|
1504 | ``byline`` | |
1502 | Show a table of lines in files ordered by how frequently they are active. |
|
1505 | Show a table of lines in files ordered by how frequently they are active. | |
1503 | ``json`` |
|
1506 | ``json`` | |
1504 | Render profiling data as JSON. |
|
1507 | Render profiling data as JSON. | |
1505 |
|
1508 | |||
1506 | ``frequency`` |
|
1509 | ``frequency`` | |
1507 | Sampling frequency. Specific to the ``stat`` sampling profiler. |
|
1510 | Sampling frequency. Specific to the ``stat`` sampling profiler. | |
1508 | (default: 1000) |
|
1511 | (default: 1000) | |
1509 |
|
1512 | |||
1510 | ``output`` |
|
1513 | ``output`` | |
1511 | File path where profiling data or report should be saved. If the |
|
1514 | File path where profiling data or report should be saved. If the | |
1512 | file exists, it is replaced. (default: None, data is printed on |
|
1515 | file exists, it is replaced. (default: None, data is printed on | |
1513 | stderr) |
|
1516 | stderr) | |
1514 |
|
1517 | |||
1515 | ``sort`` |
|
1518 | ``sort`` | |
1516 | Sort field. Specific to the ``ls`` instrumenting profiler. |
|
1519 | Sort field. Specific to the ``ls`` instrumenting profiler. | |
1517 | One of ``callcount``, ``reccallcount``, ``totaltime`` and |
|
1520 | One of ``callcount``, ``reccallcount``, ``totaltime`` and | |
1518 | ``inlinetime``. |
|
1521 | ``inlinetime``. | |
1519 | (default: inlinetime) |
|
1522 | (default: inlinetime) | |
1520 |
|
1523 | |||
1521 | ``limit`` |
|
1524 | ``limit`` | |
1522 | Number of lines to show. Specific to the ``ls`` instrumenting profiler. |
|
1525 | Number of lines to show. Specific to the ``ls`` instrumenting profiler. | |
1523 | (default: 30) |
|
1526 | (default: 30) | |
1524 |
|
1527 | |||
1525 | ``nested`` |
|
1528 | ``nested`` | |
1526 | Show at most this number of lines of drill-down info after each main entry. |
|
1529 | Show at most this number of lines of drill-down info after each main entry. | |
1527 | This can help explain the difference between Total and Inline. |
|
1530 | This can help explain the difference between Total and Inline. | |
1528 | Specific to the ``ls`` instrumenting profiler. |
|
1531 | Specific to the ``ls`` instrumenting profiler. | |
1529 | (default: 5) |
|
1532 | (default: 5) | |
1530 |
|
1533 | |||
1531 | ``progress`` |
|
1534 | ``progress`` | |
1532 | ------------ |
|
1535 | ------------ | |
1533 |
|
1536 | |||
1534 | Mercurial commands can draw progress bars that are as informative as |
|
1537 | Mercurial commands can draw progress bars that are as informative as | |
1535 | possible. Some progress bars only offer indeterminate information, while others |
|
1538 | possible. Some progress bars only offer indeterminate information, while others | |
1536 | have a definite end point. |
|
1539 | have a definite end point. | |
1537 |
|
1540 | |||
1538 | ``delay`` |
|
1541 | ``delay`` | |
1539 | Number of seconds (float) before showing the progress bar. (default: 3) |
|
1542 | Number of seconds (float) before showing the progress bar. (default: 3) | |
1540 |
|
1543 | |||
1541 | ``changedelay`` |
|
1544 | ``changedelay`` | |
1542 | Minimum delay before showing a new topic. When set to less than 3 * refresh, |
|
1545 | Minimum delay before showing a new topic. When set to less than 3 * refresh, | |
1543 | that value will be used instead. (default: 1) |
|
1546 | that value will be used instead. (default: 1) | |
1544 |
|
1547 | |||
1545 | ``refresh`` |
|
1548 | ``refresh`` | |
1546 | Time in seconds between refreshes of the progress bar. (default: 0.1) |
|
1549 | Time in seconds between refreshes of the progress bar. (default: 0.1) | |
1547 |
|
1550 | |||
1548 | ``format`` |
|
1551 | ``format`` | |
1549 | Format of the progress bar. |
|
1552 | Format of the progress bar. | |
1550 |
|
1553 | |||
1551 | Valid entries for the format field are ``topic``, ``bar``, ``number``, |
|
1554 | Valid entries for the format field are ``topic``, ``bar``, ``number``, | |
1552 | ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the |
|
1555 | ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the | |
1553 | last 20 characters of the item, but this can be changed by adding either |
|
1556 | last 20 characters of the item, but this can be changed by adding either | |
1554 | ``-<num>`` which would take the last num characters, or ``+<num>`` for the |
|
1557 | ``-<num>`` which would take the last num characters, or ``+<num>`` for the | |
1555 | first num characters. |
|
1558 | first num characters. | |
1556 |
|
1559 | |||
1557 | (default: topic bar number estimate) |
|
1560 | (default: topic bar number estimate) | |
1558 |
|
1561 | |||
1559 | ``width`` |
|
1562 | ``width`` | |
1560 | If set, the maximum width of the progress information (that is, min(width, |
|
1563 | If set, the maximum width of the progress information (that is, min(width, | |
1561 | term width) will be used). |
|
1564 | term width) will be used). | |
1562 |
|
1565 | |||
1563 | ``clear-complete`` |
|
1566 | ``clear-complete`` | |
1564 | Clear the progress bar after it's done. (default: True) |
|
1567 | Clear the progress bar after it's done. (default: True) | |
1565 |
|
1568 | |||
1566 | ``disable`` |
|
1569 | ``disable`` | |
1567 | If true, don't show a progress bar. |
|
1570 | If true, don't show a progress bar. | |
1568 |
|
1571 | |||
1569 | ``assume-tty`` |
|
1572 | ``assume-tty`` | |
1570 | If true, ALWAYS show a progress bar, unless disable is given. |
|
1573 | If true, ALWAYS show a progress bar, unless disable is given. | |
1571 |
|
1574 | |||
1572 | ``rebase`` |
|
1575 | ``rebase`` | |
1573 | ---------- |
|
1576 | ---------- | |
1574 |
|
1577 | |||
1575 | ``allowdivergence`` |
|
1578 | ``allowdivergence`` | |
1576 | Default to False, when True allow creating divergence when performing |
|
1579 | Default to False, when True allow creating divergence when performing | |
1577 | rebase of obsolete changesets. |
|
1580 | rebase of obsolete changesets. | |
1578 |
|
1581 | |||
1579 | ``revsetalias`` |
|
1582 | ``revsetalias`` | |
1580 | --------------- |
|
1583 | --------------- | |
1581 |
|
1584 | |||
1582 | Alias definitions for revsets. See :hg:`help revsets` for details. |
|
1585 | Alias definitions for revsets. See :hg:`help revsets` for details. | |
1583 |
|
1586 | |||
1584 | ``server`` |
|
1587 | ``server`` | |
1585 | ---------- |
|
1588 | ---------- | |
1586 |
|
1589 | |||
1587 | Controls generic server settings. |
|
1590 | Controls generic server settings. | |
1588 |
|
1591 | |||
1589 | ``compressionengines`` |
|
1592 | ``compressionengines`` | |
1590 | List of compression engines and their relative priority to advertise |
|
1593 | List of compression engines and their relative priority to advertise | |
1591 | to clients. |
|
1594 | to clients. | |
1592 |
|
1595 | |||
1593 | The order of compression engines determines their priority, the first |
|
1596 | The order of compression engines determines their priority, the first | |
1594 | having the highest priority. If a compression engine is not listed |
|
1597 | having the highest priority. If a compression engine is not listed | |
1595 | here, it won't be advertised to clients. |
|
1598 | here, it won't be advertised to clients. | |
1596 |
|
1599 | |||
1597 | If not set (the default), built-in defaults are used. Run |
|
1600 | If not set (the default), built-in defaults are used. Run | |
1598 | :hg:`debuginstall` to list available compression engines and their |
|
1601 | :hg:`debuginstall` to list available compression engines and their | |
1599 | default wire protocol priority. |
|
1602 | default wire protocol priority. | |
1600 |
|
1603 | |||
1601 | Older Mercurial clients only support zlib compression and this setting |
|
1604 | Older Mercurial clients only support zlib compression and this setting | |
1602 | has no effect for legacy clients. |
|
1605 | has no effect for legacy clients. | |
1603 |
|
1606 | |||
1604 | ``uncompressed`` |
|
1607 | ``uncompressed`` | |
1605 | Whether to allow clients to clone a repository using the |
|
1608 | Whether to allow clients to clone a repository using the | |
1606 | uncompressed streaming protocol. This transfers about 40% more |
|
1609 | uncompressed streaming protocol. This transfers about 40% more | |
1607 | data than a regular clone, but uses less memory and CPU on both |
|
1610 | data than a regular clone, but uses less memory and CPU on both | |
1608 | server and client. Over a LAN (100 Mbps or better) or a very fast |
|
1611 | server and client. Over a LAN (100 Mbps or better) or a very fast | |
1609 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a |
|
1612 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a | |
1610 | regular clone. Over most WAN connections (anything slower than |
|
1613 | regular clone. Over most WAN connections (anything slower than | |
1611 | about 6 Mbps), uncompressed streaming is slower, because of the |
|
1614 | about 6 Mbps), uncompressed streaming is slower, because of the | |
1612 | extra data transfer overhead. This mode will also temporarily hold |
|
1615 | extra data transfer overhead. This mode will also temporarily hold | |
1613 | the write lock while determining what data to transfer. |
|
1616 | the write lock while determining what data to transfer. | |
1614 | (default: True) |
|
1617 | (default: True) | |
1615 |
|
1618 | |||
1616 | ``preferuncompressed`` |
|
1619 | ``preferuncompressed`` | |
1617 | When set, clients will try to use the uncompressed streaming |
|
1620 | When set, clients will try to use the uncompressed streaming | |
1618 | protocol. (default: False) |
|
1621 | protocol. (default: False) | |
1619 |
|
1622 | |||
1620 | ``validate`` |
|
1623 | ``validate`` | |
1621 | Whether to validate the completeness of pushed changesets by |
|
1624 | Whether to validate the completeness of pushed changesets by | |
1622 | checking that all new file revisions specified in manifests are |
|
1625 | checking that all new file revisions specified in manifests are | |
1623 | present. (default: False) |
|
1626 | present. (default: False) | |
1624 |
|
1627 | |||
1625 | ``maxhttpheaderlen`` |
|
1628 | ``maxhttpheaderlen`` | |
1626 | Instruct HTTP clients not to send request headers longer than this |
|
1629 | Instruct HTTP clients not to send request headers longer than this | |
1627 | many bytes. (default: 1024) |
|
1630 | many bytes. (default: 1024) | |
1628 |
|
1631 | |||
1629 | ``bundle1`` |
|
1632 | ``bundle1`` | |
1630 | Whether to allow clients to push and pull using the legacy bundle1 |
|
1633 | Whether to allow clients to push and pull using the legacy bundle1 | |
1631 | exchange format. (default: True) |
|
1634 | exchange format. (default: True) | |
1632 |
|
1635 | |||
1633 | ``bundle1gd`` |
|
1636 | ``bundle1gd`` | |
1634 | Like ``bundle1`` but only used if the repository is using the |
|
1637 | Like ``bundle1`` but only used if the repository is using the | |
1635 | *generaldelta* storage format. (default: True) |
|
1638 | *generaldelta* storage format. (default: True) | |
1636 |
|
1639 | |||
1637 | ``bundle1.push`` |
|
1640 | ``bundle1.push`` | |
1638 | Whether to allow clients to push using the legacy bundle1 exchange |
|
1641 | Whether to allow clients to push using the legacy bundle1 exchange | |
1639 | format. (default: True) |
|
1642 | format. (default: True) | |
1640 |
|
1643 | |||
1641 | ``bundle1gd.push`` |
|
1644 | ``bundle1gd.push`` | |
1642 | Like ``bundle1.push`` but only used if the repository is using the |
|
1645 | Like ``bundle1.push`` but only used if the repository is using the | |
1643 | *generaldelta* storage format. (default: True) |
|
1646 | *generaldelta* storage format. (default: True) | |
1644 |
|
1647 | |||
1645 | ``bundle1.pull`` |
|
1648 | ``bundle1.pull`` | |
1646 | Whether to allow clients to pull using the legacy bundle1 exchange |
|
1649 | Whether to allow clients to pull using the legacy bundle1 exchange | |
1647 | format. (default: True) |
|
1650 | format. (default: True) | |
1648 |
|
1651 | |||
1649 | ``bundle1gd.pull`` |
|
1652 | ``bundle1gd.pull`` | |
1650 | Like ``bundle1.pull`` but only used if the repository is using the |
|
1653 | Like ``bundle1.pull`` but only used if the repository is using the | |
1651 | *generaldelta* storage format. (default: True) |
|
1654 | *generaldelta* storage format. (default: True) | |
1652 |
|
1655 | |||
1653 | Large repositories using the *generaldelta* storage format should |
|
1656 | Large repositories using the *generaldelta* storage format should | |
1654 | consider setting this option because converting *generaldelta* |
|
1657 | consider setting this option because converting *generaldelta* | |
1655 | repositories to the exchange format required by the bundle1 data |
|
1658 | repositories to the exchange format required by the bundle1 data | |
1656 | format can consume a lot of CPU. |
|
1659 | format can consume a lot of CPU. | |
1657 |
|
1660 | |||
1658 | ``zliblevel`` |
|
1661 | ``zliblevel`` | |
1659 | Integer between ``-1`` and ``9`` that controls the zlib compression level |
|
1662 | Integer between ``-1`` and ``9`` that controls the zlib compression level | |
1660 | for wire protocol commands that send zlib compressed output (notably the |
|
1663 | for wire protocol commands that send zlib compressed output (notably the | |
1661 | commands that send repository history data). |
|
1664 | commands that send repository history data). | |
1662 |
|
1665 | |||
1663 | The default (``-1``) uses the default zlib compression level, which is |
|
1666 | The default (``-1``) uses the default zlib compression level, which is | |
1664 | likely equivalent to ``6``. ``0`` means no compression. ``9`` means |
|
1667 | likely equivalent to ``6``. ``0`` means no compression. ``9`` means | |
1665 | maximum compression. |
|
1668 | maximum compression. | |
1666 |
|
1669 | |||
1667 | Setting this option allows server operators to make trade-offs between |
|
1670 | Setting this option allows server operators to make trade-offs between | |
1668 | bandwidth and CPU used. Lowering the compression lowers CPU utilization |
|
1671 | bandwidth and CPU used. Lowering the compression lowers CPU utilization | |
1669 | but sends more bytes to clients. |
|
1672 | but sends more bytes to clients. | |
1670 |
|
1673 | |||
1671 | This option only impacts the HTTP server. |
|
1674 | This option only impacts the HTTP server. | |
1672 |
|
1675 | |||
1673 | ``zstdlevel`` |
|
1676 | ``zstdlevel`` | |
1674 | Integer between ``1`` and ``22`` that controls the zstd compression level |
|
1677 | Integer between ``1`` and ``22`` that controls the zstd compression level | |
1675 | for wire protocol commands. ``1`` is the minimal amount of compression and |
|
1678 | for wire protocol commands. ``1`` is the minimal amount of compression and | |
1676 | ``22`` is the highest amount of compression. |
|
1679 | ``22`` is the highest amount of compression. | |
1677 |
|
1680 | |||
1678 | The default (``3``) should be significantly faster than zlib while likely |
|
1681 | The default (``3``) should be significantly faster than zlib while likely | |
1679 | delivering better compression ratios. |
|
1682 | delivering better compression ratios. | |
1680 |
|
1683 | |||
1681 | This option only impacts the HTTP server. |
|
1684 | This option only impacts the HTTP server. | |
1682 |
|
1685 | |||
1683 | See also ``server.zliblevel``. |
|
1686 | See also ``server.zliblevel``. | |
1684 |
|
1687 | |||
1685 | ``smtp`` |
|
1688 | ``smtp`` | |
1686 | -------- |
|
1689 | -------- | |
1687 |
|
1690 | |||
1688 | Configuration for extensions that need to send email messages. |
|
1691 | Configuration for extensions that need to send email messages. | |
1689 |
|
1692 | |||
1690 | ``host`` |
|
1693 | ``host`` | |
1691 | Host name of mail server, e.g. "mail.example.com". |
|
1694 | Host name of mail server, e.g. "mail.example.com". | |
1692 |
|
1695 | |||
1693 | ``port`` |
|
1696 | ``port`` | |
1694 | Optional. Port to connect to on mail server. (default: 465 if |
|
1697 | Optional. Port to connect to on mail server. (default: 465 if | |
1695 | ``tls`` is smtps; 25 otherwise) |
|
1698 | ``tls`` is smtps; 25 otherwise) | |
1696 |
|
1699 | |||
1697 | ``tls`` |
|
1700 | ``tls`` | |
1698 | Optional. Method to enable TLS when connecting to mail server: starttls, |
|
1701 | Optional. Method to enable TLS when connecting to mail server: starttls, | |
1699 | smtps or none. (default: none) |
|
1702 | smtps or none. (default: none) | |
1700 |
|
1703 | |||
1701 | ``username`` |
|
1704 | ``username`` | |
1702 | Optional. User name for authenticating with the SMTP server. |
|
1705 | Optional. User name for authenticating with the SMTP server. | |
1703 | (default: None) |
|
1706 | (default: None) | |
1704 |
|
1707 | |||
1705 | ``password`` |
|
1708 | ``password`` | |
1706 | Optional. Password for authenticating with the SMTP server. If not |
|
1709 | Optional. Password for authenticating with the SMTP server. If not | |
1707 | specified, interactive sessions will prompt the user for a |
|
1710 | specified, interactive sessions will prompt the user for a | |
1708 | password; non-interactive sessions will fail. (default: None) |
|
1711 | password; non-interactive sessions will fail. (default: None) | |
1709 |
|
1712 | |||
1710 | ``local_hostname`` |
|
1713 | ``local_hostname`` | |
1711 | Optional. The hostname that the sender can use to identify |
|
1714 | Optional. The hostname that the sender can use to identify | |
1712 | itself to the MTA. |
|
1715 | itself to the MTA. | |
1713 |
|
1716 | |||
1714 |
|
1717 | |||
1715 | ``subpaths`` |
|
1718 | ``subpaths`` | |
1716 | ------------ |
|
1719 | ------------ | |
1717 |
|
1720 | |||
1718 | Subrepository source URLs can go stale if a remote server changes name |
|
1721 | Subrepository source URLs can go stale if a remote server changes name | |
1719 | or becomes temporarily unavailable. This section lets you define |
|
1722 | or becomes temporarily unavailable. This section lets you define | |
1720 | rewrite rules of the form:: |
|
1723 | rewrite rules of the form:: | |
1721 |
|
1724 | |||
1722 | <pattern> = <replacement> |
|
1725 | <pattern> = <replacement> | |
1723 |
|
1726 | |||
1724 | where ``pattern`` is a regular expression matching a subrepository |
|
1727 | where ``pattern`` is a regular expression matching a subrepository | |
1725 | source URL and ``replacement`` is the replacement string used to |
|
1728 | source URL and ``replacement`` is the replacement string used to | |
1726 | rewrite it. Groups can be matched in ``pattern`` and referenced in |
|
1729 | rewrite it. Groups can be matched in ``pattern`` and referenced in | |
1727 | ``replacements``. For instance:: |
|
1730 | ``replacements``. For instance:: | |
1728 |
|
1731 | |||
1729 | http://server/(.*)-hg/ = http://hg.server/\1/ |
|
1732 | http://server/(.*)-hg/ = http://hg.server/\1/ | |
1730 |
|
1733 | |||
1731 | rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``. |
|
1734 | rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``. | |
1732 |
|
1735 | |||
1733 | Relative subrepository paths are first made absolute, and the |
|
1736 | Relative subrepository paths are first made absolute, and the | |
1734 | rewrite rules are then applied on the full (absolute) path. If ``pattern`` |
|
1737 | rewrite rules are then applied on the full (absolute) path. If ``pattern`` | |
1735 | doesn't match the full path, an attempt is made to apply it on the |
|
1738 | doesn't match the full path, an attempt is made to apply it on the | |
1736 | relative path alone. The rules are applied in definition order. |
|
1739 | relative path alone. The rules are applied in definition order. | |
1737 |
|
1740 | |||
1738 | ``templatealias`` |
|
1741 | ``templatealias`` | |
1739 | ----------------- |
|
1742 | ----------------- | |
1740 |
|
1743 | |||
1741 | Alias definitions for templates. See :hg:`help templates` for details. |
|
1744 | Alias definitions for templates. See :hg:`help templates` for details. | |
1742 |
|
1745 | |||
1743 | ``templates`` |
|
1746 | ``templates`` | |
1744 | ------------- |
|
1747 | ------------- | |
1745 |
|
1748 | |||
1746 | Use the ``[templates]`` section to define template strings. |
|
1749 | Use the ``[templates]`` section to define template strings. | |
1747 | See :hg:`help templates` for details. |
|
1750 | See :hg:`help templates` for details. | |
1748 |
|
1751 | |||
1749 | ``trusted`` |
|
1752 | ``trusted`` | |
1750 | ----------- |
|
1753 | ----------- | |
1751 |
|
1754 | |||
1752 | Mercurial will not use the settings in the |
|
1755 | Mercurial will not use the settings in the | |
1753 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted |
|
1756 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted | |
1754 | user or to a trusted group, as various hgrc features allow arbitrary |
|
1757 | user or to a trusted group, as various hgrc features allow arbitrary | |
1755 | commands to be run. This issue is often encountered when configuring |
|
1758 | commands to be run. This issue is often encountered when configuring | |
1756 | hooks or extensions for shared repositories or servers. However, |
|
1759 | hooks or extensions for shared repositories or servers. However, | |
1757 | the web interface will use some safe settings from the ``[web]`` |
|
1760 | the web interface will use some safe settings from the ``[web]`` | |
1758 | section. |
|
1761 | section. | |
1759 |
|
1762 | |||
1760 | This section specifies what users and groups are trusted. The |
|
1763 | This section specifies what users and groups are trusted. The | |
1761 | current user is always trusted. To trust everybody, list a user or a |
|
1764 | current user is always trusted. To trust everybody, list a user or a | |
1762 | group with name ``*``. These settings must be placed in an |
|
1765 | group with name ``*``. These settings must be placed in an | |
1763 | *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the |
|
1766 | *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the | |
1764 | user or service running Mercurial. |
|
1767 | user or service running Mercurial. | |
1765 |
|
1768 | |||
1766 | ``users`` |
|
1769 | ``users`` | |
1767 | Comma-separated list of trusted users. |
|
1770 | Comma-separated list of trusted users. | |
1768 |
|
1771 | |||
1769 | ``groups`` |
|
1772 | ``groups`` | |
1770 | Comma-separated list of trusted groups. |
|
1773 | Comma-separated list of trusted groups. | |
1771 |
|
1774 | |||
1772 |
|
1775 | |||
1773 | ``ui`` |
|
1776 | ``ui`` | |
1774 | ------ |
|
1777 | ------ | |
1775 |
|
1778 | |||
1776 | User interface controls. |
|
1779 | User interface controls. | |
1777 |
|
1780 | |||
1778 | ``archivemeta`` |
|
1781 | ``archivemeta`` | |
1779 | Whether to include the .hg_archival.txt file containing meta data |
|
1782 | Whether to include the .hg_archival.txt file containing meta data | |
1780 | (hashes for the repository base and for tip) in archives created |
|
1783 | (hashes for the repository base and for tip) in archives created | |
1781 | by the :hg:`archive` command or downloaded via hgweb. |
|
1784 | by the :hg:`archive` command or downloaded via hgweb. | |
1782 | (default: True) |
|
1785 | (default: True) | |
1783 |
|
1786 | |||
1784 | ``askusername`` |
|
1787 | ``askusername`` | |
1785 | Whether to prompt for a username when committing. If True, and |
|
1788 | Whether to prompt for a username when committing. If True, and | |
1786 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will |
|
1789 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will | |
1787 | be prompted to enter a username. If no username is entered, the |
|
1790 | be prompted to enter a username. If no username is entered, the | |
1788 | default ``USER@HOST`` is used instead. |
|
1791 | default ``USER@HOST`` is used instead. | |
1789 | (default: False) |
|
1792 | (default: False) | |
1790 |
|
1793 | |||
1791 | ``clonebundles`` |
|
1794 | ``clonebundles`` | |
1792 | Whether the "clone bundles" feature is enabled. |
|
1795 | Whether the "clone bundles" feature is enabled. | |
1793 |
|
1796 | |||
1794 | When enabled, :hg:`clone` may download and apply a server-advertised |
|
1797 | When enabled, :hg:`clone` may download and apply a server-advertised | |
1795 | bundle file from a URL instead of using the normal exchange mechanism. |
|
1798 | bundle file from a URL instead of using the normal exchange mechanism. | |
1796 |
|
1799 | |||
1797 | This can likely result in faster and more reliable clones. |
|
1800 | This can likely result in faster and more reliable clones. | |
1798 |
|
1801 | |||
1799 | (default: True) |
|
1802 | (default: True) | |
1800 |
|
1803 | |||
1801 | ``clonebundlefallback`` |
|
1804 | ``clonebundlefallback`` | |
1802 | Whether failure to apply an advertised "clone bundle" from a server |
|
1805 | Whether failure to apply an advertised "clone bundle" from a server | |
1803 | should result in fallback to a regular clone. |
|
1806 | should result in fallback to a regular clone. | |
1804 |
|
1807 | |||
1805 | This is disabled by default because servers advertising "clone |
|
1808 | This is disabled by default because servers advertising "clone | |
1806 | bundles" often do so to reduce server load. If advertised bundles |
|
1809 | bundles" often do so to reduce server load. If advertised bundles | |
1807 | start mass failing and clients automatically fall back to a regular |
|
1810 | start mass failing and clients automatically fall back to a regular | |
1808 | clone, this would add significant and unexpected load to the server |
|
1811 | clone, this would add significant and unexpected load to the server | |
1809 | since the server is expecting clone operations to be offloaded to |
|
1812 | since the server is expecting clone operations to be offloaded to | |
1810 | pre-generated bundles. Failing fast (the default behavior) ensures |
|
1813 | pre-generated bundles. Failing fast (the default behavior) ensures | |
1811 | clients don't overwhelm the server when "clone bundle" application |
|
1814 | clients don't overwhelm the server when "clone bundle" application | |
1812 | fails. |
|
1815 | fails. | |
1813 |
|
1816 | |||
1814 | (default: False) |
|
1817 | (default: False) | |
1815 |
|
1818 | |||
1816 | ``clonebundleprefers`` |
|
1819 | ``clonebundleprefers`` | |
1817 | Defines preferences for which "clone bundles" to use. |
|
1820 | Defines preferences for which "clone bundles" to use. | |
1818 |
|
1821 | |||
1819 | Servers advertising "clone bundles" may advertise multiple available |
|
1822 | Servers advertising "clone bundles" may advertise multiple available | |
1820 | bundles. Each bundle may have different attributes, such as the bundle |
|
1823 | bundles. Each bundle may have different attributes, such as the bundle | |
1821 | type and compression format. This option is used to prefer a particular |
|
1824 | type and compression format. This option is used to prefer a particular | |
1822 | bundle over another. |
|
1825 | bundle over another. | |
1823 |
|
1826 | |||
1824 | The following keys are defined by Mercurial: |
|
1827 | The following keys are defined by Mercurial: | |
1825 |
|
1828 | |||
1826 | BUNDLESPEC |
|
1829 | BUNDLESPEC | |
1827 | A bundle type specifier. These are strings passed to :hg:`bundle -t`. |
|
1830 | A bundle type specifier. These are strings passed to :hg:`bundle -t`. | |
1828 | e.g. ``gzip-v2`` or ``bzip2-v1``. |
|
1831 | e.g. ``gzip-v2`` or ``bzip2-v1``. | |
1829 |
|
1832 | |||
1830 | COMPRESSION |
|
1833 | COMPRESSION | |
1831 | The compression format of the bundle. e.g. ``gzip`` and ``bzip2``. |
|
1834 | The compression format of the bundle. e.g. ``gzip`` and ``bzip2``. | |
1832 |
|
1835 | |||
1833 | Server operators may define custom keys. |
|
1836 | Server operators may define custom keys. | |
1834 |
|
1837 | |||
1835 | Example values: ``COMPRESSION=bzip2``, |
|
1838 | Example values: ``COMPRESSION=bzip2``, | |
1836 | ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``. |
|
1839 | ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``. | |
1837 |
|
1840 | |||
1838 | By default, the first bundle advertised by the server is used. |
|
1841 | By default, the first bundle advertised by the server is used. | |
1839 |
|
1842 | |||
1840 | ``color`` |
|
1843 | ``color`` | |
1841 | String: when to use to colorize output. possible value are auto, always, |
|
1844 | String: when to use to colorize output. possible value are auto, always, | |
1842 | never, or debug (default: never). 'auto' will use color whenever it seems |
|
1845 | never, or debug (default: never). 'auto' will use color whenever it seems | |
1843 | possible. See :hg:`help color` for details. |
|
1846 | possible. See :hg:`help color` for details. | |
1844 |
|
1847 | |||
1845 | (in addition a boolean can be used in place always/never) |
|
1848 | (in addition a boolean can be used in place always/never) | |
1846 |
|
1849 | |||
1847 | ``commitsubrepos`` |
|
1850 | ``commitsubrepos`` | |
1848 | Whether to commit modified subrepositories when committing the |
|
1851 | Whether to commit modified subrepositories when committing the | |
1849 | parent repository. If False and one subrepository has uncommitted |
|
1852 | parent repository. If False and one subrepository has uncommitted | |
1850 | changes, abort the commit. |
|
1853 | changes, abort the commit. | |
1851 | (default: False) |
|
1854 | (default: False) | |
1852 |
|
1855 | |||
1853 | ``debug`` |
|
1856 | ``debug`` | |
1854 | Print debugging information. (default: False) |
|
1857 | Print debugging information. (default: False) | |
1855 |
|
1858 | |||
1856 | ``editor`` |
|
1859 | ``editor`` | |
1857 | The editor to use during a commit. (default: ``$EDITOR`` or ``vi``) |
|
1860 | The editor to use during a commit. (default: ``$EDITOR`` or ``vi``) | |
1858 |
|
1861 | |||
1859 | ``fallbackencoding`` |
|
1862 | ``fallbackencoding`` | |
1860 | Encoding to try if it's not possible to decode the changelog using |
|
1863 | Encoding to try if it's not possible to decode the changelog using | |
1861 | UTF-8. (default: ISO-8859-1) |
|
1864 | UTF-8. (default: ISO-8859-1) | |
1862 |
|
1865 | |||
1863 | ``graphnodetemplate`` |
|
1866 | ``graphnodetemplate`` | |
1864 | The template used to print changeset nodes in an ASCII revision graph. |
|
1867 | The template used to print changeset nodes in an ASCII revision graph. | |
1865 | (default: ``{graphnode}``) |
|
1868 | (default: ``{graphnode}``) | |
1866 |
|
1869 | |||
1867 | ``ignore`` |
|
1870 | ``ignore`` | |
1868 | A file to read per-user ignore patterns from. This file should be |
|
1871 | A file to read per-user ignore patterns from. This file should be | |
1869 | in the same format as a repository-wide .hgignore file. Filenames |
|
1872 | in the same format as a repository-wide .hgignore file. Filenames | |
1870 | are relative to the repository root. This option supports hook syntax, |
|
1873 | are relative to the repository root. This option supports hook syntax, | |
1871 | so if you want to specify multiple ignore files, you can do so by |
|
1874 | so if you want to specify multiple ignore files, you can do so by | |
1872 | setting something like ``ignore.other = ~/.hgignore2``. For details |
|
1875 | setting something like ``ignore.other = ~/.hgignore2``. For details | |
1873 | of the ignore file format, see the ``hgignore(5)`` man page. |
|
1876 | of the ignore file format, see the ``hgignore(5)`` man page. | |
1874 |
|
1877 | |||
1875 | ``interactive`` |
|
1878 | ``interactive`` | |
1876 | Allow to prompt the user. (default: True) |
|
1879 | Allow to prompt the user. (default: True) | |
1877 |
|
1880 | |||
1878 | ``interface`` |
|
1881 | ``interface`` | |
1879 | Select the default interface for interactive features (default: text). |
|
1882 | Select the default interface for interactive features (default: text). | |
1880 | Possible values are 'text' and 'curses'. |
|
1883 | Possible values are 'text' and 'curses'. | |
1881 |
|
1884 | |||
1882 | ``interface.chunkselector`` |
|
1885 | ``interface.chunkselector`` | |
1883 | Select the interface for change recording (e.g. :hg:`commit -i`). |
|
1886 | Select the interface for change recording (e.g. :hg:`commit -i`). | |
1884 | Possible values are 'text' and 'curses'. |
|
1887 | Possible values are 'text' and 'curses'. | |
1885 | This config overrides the interface specified by ui.interface. |
|
1888 | This config overrides the interface specified by ui.interface. | |
1886 |
|
1889 | |||
1887 | ``logtemplate`` |
|
1890 | ``logtemplate`` | |
1888 | Template string for commands that print changesets. |
|
1891 | Template string for commands that print changesets. | |
1889 |
|
1892 | |||
1890 | ``merge`` |
|
1893 | ``merge`` | |
1891 | The conflict resolution program to use during a manual merge. |
|
1894 | The conflict resolution program to use during a manual merge. | |
1892 | For more information on merge tools see :hg:`help merge-tools`. |
|
1895 | For more information on merge tools see :hg:`help merge-tools`. | |
1893 | For configuring merge tools see the ``[merge-tools]`` section. |
|
1896 | For configuring merge tools see the ``[merge-tools]`` section. | |
1894 |
|
1897 | |||
1895 | ``mergemarkers`` |
|
1898 | ``mergemarkers`` | |
1896 | Sets the merge conflict marker label styling. The ``detailed`` |
|
1899 | Sets the merge conflict marker label styling. The ``detailed`` | |
1897 | style uses the ``mergemarkertemplate`` setting to style the labels. |
|
1900 | style uses the ``mergemarkertemplate`` setting to style the labels. | |
1898 | The ``basic`` style just uses 'local' and 'other' as the marker label. |
|
1901 | The ``basic`` style just uses 'local' and 'other' as the marker label. | |
1899 | One of ``basic`` or ``detailed``. |
|
1902 | One of ``basic`` or ``detailed``. | |
1900 | (default: ``basic``) |
|
1903 | (default: ``basic``) | |
1901 |
|
1904 | |||
1902 | ``mergemarkertemplate`` |
|
1905 | ``mergemarkertemplate`` | |
1903 | The template used to print the commit description next to each conflict |
|
1906 | The template used to print the commit description next to each conflict | |
1904 | marker during merge conflicts. See :hg:`help templates` for the template |
|
1907 | marker during merge conflicts. See :hg:`help templates` for the template | |
1905 | format. |
|
1908 | format. | |
1906 |
|
1909 | |||
1907 | Defaults to showing the hash, tags, branches, bookmarks, author, and |
|
1910 | Defaults to showing the hash, tags, branches, bookmarks, author, and | |
1908 | the first line of the commit description. |
|
1911 | the first line of the commit description. | |
1909 |
|
1912 | |||
1910 | If you use non-ASCII characters in names for tags, branches, bookmarks, |
|
1913 | If you use non-ASCII characters in names for tags, branches, bookmarks, | |
1911 | authors, and/or commit descriptions, you must pay attention to encodings of |
|
1914 | authors, and/or commit descriptions, you must pay attention to encodings of | |
1912 | managed files. At template expansion, non-ASCII characters use the encoding |
|
1915 | managed files. At template expansion, non-ASCII characters use the encoding | |
1913 | specified by the ``--encoding`` global option, ``HGENCODING`` or other |
|
1916 | specified by the ``--encoding`` global option, ``HGENCODING`` or other | |
1914 | environment variables that govern your locale. If the encoding of the merge |
|
1917 | environment variables that govern your locale. If the encoding of the merge | |
1915 | markers is different from the encoding of the merged files, |
|
1918 | markers is different from the encoding of the merged files, | |
1916 | serious problems may occur. |
|
1919 | serious problems may occur. | |
1917 |
|
1920 | |||
1918 | ``origbackuppath`` |
|
1921 | ``origbackuppath`` | |
1919 | The path to a directory used to store generated .orig files. If the path is |
|
1922 | The path to a directory used to store generated .orig files. If the path is | |
1920 | not a directory, one will be created. |
|
1923 | not a directory, one will be created. | |
1921 |
|
1924 | |||
1922 | ``patch`` |
|
1925 | ``patch`` | |
1923 | An optional external tool that ``hg import`` and some extensions |
|
1926 | An optional external tool that ``hg import`` and some extensions | |
1924 | will use for applying patches. By default Mercurial uses an |
|
1927 | will use for applying patches. By default Mercurial uses an | |
1925 | internal patch utility. The external tool must work as the common |
|
1928 | internal patch utility. The external tool must work as the common | |
1926 | Unix ``patch`` program. In particular, it must accept a ``-p`` |
|
1929 | Unix ``patch`` program. In particular, it must accept a ``-p`` | |
1927 | argument to strip patch headers, a ``-d`` argument to specify the |
|
1930 | argument to strip patch headers, a ``-d`` argument to specify the | |
1928 | current directory, a file name to patch, and a patch file to take |
|
1931 | current directory, a file name to patch, and a patch file to take | |
1929 | from stdin. |
|
1932 | from stdin. | |
1930 |
|
1933 | |||
1931 | It is possible to specify a patch tool together with extra |
|
1934 | It is possible to specify a patch tool together with extra | |
1932 | arguments. For example, setting this option to ``patch --merge`` |
|
1935 | arguments. For example, setting this option to ``patch --merge`` | |
1933 | will use the ``patch`` program with its 2-way merge option. |
|
1936 | will use the ``patch`` program with its 2-way merge option. | |
1934 |
|
1937 | |||
1935 | ``portablefilenames`` |
|
1938 | ``portablefilenames`` | |
1936 | Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``. |
|
1939 | Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``. | |
1937 | (default: ``warn``) |
|
1940 | (default: ``warn``) | |
1938 |
|
1941 | |||
1939 | ``warn`` |
|
1942 | ``warn`` | |
1940 | Print a warning message on POSIX platforms, if a file with a non-portable |
|
1943 | Print a warning message on POSIX platforms, if a file with a non-portable | |
1941 | filename is added (e.g. a file with a name that can't be created on |
|
1944 | filename is added (e.g. a file with a name that can't be created on | |
1942 | Windows because it contains reserved parts like ``AUX``, reserved |
|
1945 | Windows because it contains reserved parts like ``AUX``, reserved | |
1943 | characters like ``:``, or would cause a case collision with an existing |
|
1946 | characters like ``:``, or would cause a case collision with an existing | |
1944 | file). |
|
1947 | file). | |
1945 |
|
1948 | |||
1946 | ``ignore`` |
|
1949 | ``ignore`` | |
1947 | Don't print a warning. |
|
1950 | Don't print a warning. | |
1948 |
|
1951 | |||
1949 | ``abort`` |
|
1952 | ``abort`` | |
1950 | The command is aborted. |
|
1953 | The command is aborted. | |
1951 |
|
1954 | |||
1952 | ``true`` |
|
1955 | ``true`` | |
1953 | Alias for ``warn``. |
|
1956 | Alias for ``warn``. | |
1954 |
|
1957 | |||
1955 | ``false`` |
|
1958 | ``false`` | |
1956 | Alias for ``ignore``. |
|
1959 | Alias for ``ignore``. | |
1957 |
|
1960 | |||
1958 | .. container:: windows |
|
1961 | .. container:: windows | |
1959 |
|
1962 | |||
1960 | On Windows, this configuration option is ignored and the command aborted. |
|
1963 | On Windows, this configuration option is ignored and the command aborted. | |
1961 |
|
1964 | |||
1962 | ``quiet`` |
|
1965 | ``quiet`` | |
1963 | Reduce the amount of output printed. |
|
1966 | Reduce the amount of output printed. | |
1964 | (default: False) |
|
1967 | (default: False) | |
1965 |
|
1968 | |||
1966 | ``remotecmd`` |
|
1969 | ``remotecmd`` | |
1967 | Remote command to use for clone/push/pull operations. |
|
1970 | Remote command to use for clone/push/pull operations. | |
1968 | (default: ``hg``) |
|
1971 | (default: ``hg``) | |
1969 |
|
1972 | |||
1970 | ``report_untrusted`` |
|
1973 | ``report_untrusted`` | |
1971 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a |
|
1974 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a | |
1972 | trusted user or group. |
|
1975 | trusted user or group. | |
1973 | (default: True) |
|
1976 | (default: True) | |
1974 |
|
1977 | |||
1975 | ``slash`` |
|
1978 | ``slash`` | |
1976 | Display paths using a slash (``/``) as the path separator. This |
|
1979 | Display paths using a slash (``/``) as the path separator. This | |
1977 | only makes a difference on systems where the default path |
|
1980 | only makes a difference on systems where the default path | |
1978 | separator is not the slash character (e.g. Windows uses the |
|
1981 | separator is not the slash character (e.g. Windows uses the | |
1979 | backslash character (``\``)). |
|
1982 | backslash character (``\``)). | |
1980 | (default: False) |
|
1983 | (default: False) | |
1981 |
|
1984 | |||
1982 | ``statuscopies`` |
|
1985 | ``statuscopies`` | |
1983 | Display copies in the status command. |
|
1986 | Display copies in the status command. | |
1984 |
|
1987 | |||
1985 | ``ssh`` |
|
1988 | ``ssh`` | |
1986 | Command to use for SSH connections. (default: ``ssh``) |
|
1989 | Command to use for SSH connections. (default: ``ssh``) | |
1987 |
|
1990 | |||
1988 | ``strict`` |
|
1991 | ``strict`` | |
1989 | Require exact command names, instead of allowing unambiguous |
|
1992 | Require exact command names, instead of allowing unambiguous | |
1990 | abbreviations. (default: False) |
|
1993 | abbreviations. (default: False) | |
1991 |
|
1994 | |||
1992 | ``style`` |
|
1995 | ``style`` | |
1993 | Name of style to use for command output. |
|
1996 | Name of style to use for command output. | |
1994 |
|
1997 | |||
1995 | ``supportcontact`` |
|
1998 | ``supportcontact`` | |
1996 | A URL where users should report a Mercurial traceback. Use this if you are a |
|
1999 | A URL where users should report a Mercurial traceback. Use this if you are a | |
1997 | large organisation with its own Mercurial deployment process and crash |
|
2000 | large organisation with its own Mercurial deployment process and crash | |
1998 | reports should be addressed to your internal support. |
|
2001 | reports should be addressed to your internal support. | |
1999 |
|
2002 | |||
2000 | ``textwidth`` |
|
2003 | ``textwidth`` | |
2001 | Maximum width of help text. A longer line generated by ``hg help`` or |
|
2004 | Maximum width of help text. A longer line generated by ``hg help`` or | |
2002 | ``hg subcommand --help`` will be broken after white space to get this |
|
2005 | ``hg subcommand --help`` will be broken after white space to get this | |
2003 | width or the terminal width, whichever comes first. |
|
2006 | width or the terminal width, whichever comes first. | |
2004 | A non-positive value will disable this and the terminal width will be |
|
2007 | A non-positive value will disable this and the terminal width will be | |
2005 | used. (default: 78) |
|
2008 | used. (default: 78) | |
2006 |
|
2009 | |||
2007 | ``timeout`` |
|
2010 | ``timeout`` | |
2008 | The timeout used when a lock is held (in seconds), a negative value |
|
2011 | The timeout used when a lock is held (in seconds), a negative value | |
2009 | means no timeout. (default: 600) |
|
2012 | means no timeout. (default: 600) | |
2010 |
|
2013 | |||
2011 | ``traceback`` |
|
2014 | ``traceback`` | |
2012 | Mercurial always prints a traceback when an unknown exception |
|
2015 | Mercurial always prints a traceback when an unknown exception | |
2013 | occurs. Setting this to True will make Mercurial print a traceback |
|
2016 | occurs. Setting this to True will make Mercurial print a traceback | |
2014 | on all exceptions, even those recognized by Mercurial (such as |
|
2017 | on all exceptions, even those recognized by Mercurial (such as | |
2015 | IOError or MemoryError). (default: False) |
|
2018 | IOError or MemoryError). (default: False) | |
2016 |
|
2019 | |||
2017 | ``username`` |
|
2020 | ``username`` | |
2018 | The committer of a changeset created when running "commit". |
|
2021 | The committer of a changeset created when running "commit". | |
2019 | Typically a person's name and email address, e.g. ``Fred Widget |
|
2022 | Typically a person's name and email address, e.g. ``Fred Widget | |
2020 | <fred@example.com>``. Environment variables in the |
|
2023 | <fred@example.com>``. Environment variables in the | |
2021 | username are expanded. |
|
2024 | username are expanded. | |
2022 |
|
2025 | |||
2023 | (default: ``$EMAIL`` or ``username@hostname``. If the username in |
|
2026 | (default: ``$EMAIL`` or ``username@hostname``. If the username in | |
2024 | hgrc is empty, e.g. if the system admin set ``username =`` in the |
|
2027 | hgrc is empty, e.g. if the system admin set ``username =`` in the | |
2025 | system hgrc, it has to be specified manually or in a different |
|
2028 | system hgrc, it has to be specified manually or in a different | |
2026 | hgrc file) |
|
2029 | hgrc file) | |
2027 |
|
2030 | |||
2028 | ``verbose`` |
|
2031 | ``verbose`` | |
2029 | Increase the amount of output printed. (default: False) |
|
2032 | Increase the amount of output printed. (default: False) | |
2030 |
|
2033 | |||
2031 |
|
2034 | |||
2032 | ``web`` |
|
2035 | ``web`` | |
2033 | ------- |
|
2036 | ------- | |
2034 |
|
2037 | |||
2035 | Web interface configuration. The settings in this section apply to |
|
2038 | Web interface configuration. The settings in this section apply to | |
2036 | both the builtin webserver (started by :hg:`serve`) and the script you |
|
2039 | both the builtin webserver (started by :hg:`serve`) and the script you | |
2037 | run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI |
|
2040 | run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI | |
2038 | and WSGI). |
|
2041 | and WSGI). | |
2039 |
|
2042 | |||
2040 | The Mercurial webserver does no authentication (it does not prompt for |
|
2043 | The Mercurial webserver does no authentication (it does not prompt for | |
2041 | usernames and passwords to validate *who* users are), but it does do |
|
2044 | usernames and passwords to validate *who* users are), but it does do | |
2042 | authorization (it grants or denies access for *authenticated users* |
|
2045 | authorization (it grants or denies access for *authenticated users* | |
2043 | based on settings in this section). You must either configure your |
|
2046 | based on settings in this section). You must either configure your | |
2044 | webserver to do authentication for you, or disable the authorization |
|
2047 | webserver to do authentication for you, or disable the authorization | |
2045 | checks. |
|
2048 | checks. | |
2046 |
|
2049 | |||
2047 | For a quick setup in a trusted environment, e.g., a private LAN, where |
|
2050 | For a quick setup in a trusted environment, e.g., a private LAN, where | |
2048 | you want it to accept pushes from anybody, you can use the following |
|
2051 | you want it to accept pushes from anybody, you can use the following | |
2049 | command line:: |
|
2052 | command line:: | |
2050 |
|
2053 | |||
2051 | $ hg --config web.allow_push=* --config web.push_ssl=False serve |
|
2054 | $ hg --config web.allow_push=* --config web.push_ssl=False serve | |
2052 |
|
2055 | |||
2053 | Note that this will allow anybody to push anything to the server and |
|
2056 | Note that this will allow anybody to push anything to the server and | |
2054 | that this should not be used for public servers. |
|
2057 | that this should not be used for public servers. | |
2055 |
|
2058 | |||
2056 | The full set of options is: |
|
2059 | The full set of options is: | |
2057 |
|
2060 | |||
2058 | ``accesslog`` |
|
2061 | ``accesslog`` | |
2059 | Where to output the access log. (default: stdout) |
|
2062 | Where to output the access log. (default: stdout) | |
2060 |
|
2063 | |||
2061 | ``address`` |
|
2064 | ``address`` | |
2062 | Interface address to bind to. (default: all) |
|
2065 | Interface address to bind to. (default: all) | |
2063 |
|
2066 | |||
2064 | ``allow_archive`` |
|
2067 | ``allow_archive`` | |
2065 | List of archive format (bz2, gz, zip) allowed for downloading. |
|
2068 | List of archive format (bz2, gz, zip) allowed for downloading. | |
2066 | (default: empty) |
|
2069 | (default: empty) | |
2067 |
|
2070 | |||
2068 | ``allowbz2`` |
|
2071 | ``allowbz2`` | |
2069 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository |
|
2072 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository | |
2070 | revisions. |
|
2073 | revisions. | |
2071 | (default: False) |
|
2074 | (default: False) | |
2072 |
|
2075 | |||
2073 | ``allowgz`` |
|
2076 | ``allowgz`` | |
2074 | (DEPRECATED) Whether to allow .tar.gz downloading of repository |
|
2077 | (DEPRECATED) Whether to allow .tar.gz downloading of repository | |
2075 | revisions. |
|
2078 | revisions. | |
2076 | (default: False) |
|
2079 | (default: False) | |
2077 |
|
2080 | |||
2078 | ``allowpull`` |
|
2081 | ``allowpull`` | |
2079 | Whether to allow pulling from the repository. (default: True) |
|
2082 | Whether to allow pulling from the repository. (default: True) | |
2080 |
|
2083 | |||
2081 | ``allow_push`` |
|
2084 | ``allow_push`` | |
2082 | Whether to allow pushing to the repository. If empty or not set, |
|
2085 | Whether to allow pushing to the repository. If empty or not set, | |
2083 | pushing is not allowed. If the special value ``*``, any remote |
|
2086 | pushing is not allowed. If the special value ``*``, any remote | |
2084 | user can push, including unauthenticated users. Otherwise, the |
|
2087 | user can push, including unauthenticated users. Otherwise, the | |
2085 | remote user must have been authenticated, and the authenticated |
|
2088 | remote user must have been authenticated, and the authenticated | |
2086 | user name must be present in this list. The contents of the |
|
2089 | user name must be present in this list. The contents of the | |
2087 | allow_push list are examined after the deny_push list. |
|
2090 | allow_push list are examined after the deny_push list. | |
2088 |
|
2091 | |||
2089 | ``allow_read`` |
|
2092 | ``allow_read`` | |
2090 | If the user has not already been denied repository access due to |
|
2093 | If the user has not already been denied repository access due to | |
2091 | the contents of deny_read, this list determines whether to grant |
|
2094 | the contents of deny_read, this list determines whether to grant | |
2092 | repository access to the user. If this list is not empty, and the |
|
2095 | repository access to the user. If this list is not empty, and the | |
2093 | user is unauthenticated or not present in the list, then access is |
|
2096 | user is unauthenticated or not present in the list, then access is | |
2094 | denied for the user. If the list is empty or not set, then access |
|
2097 | denied for the user. If the list is empty or not set, then access | |
2095 | is permitted to all users by default. Setting allow_read to the |
|
2098 | is permitted to all users by default. Setting allow_read to the | |
2096 | special value ``*`` is equivalent to it not being set (i.e. access |
|
2099 | special value ``*`` is equivalent to it not being set (i.e. access | |
2097 | is permitted to all users). The contents of the allow_read list are |
|
2100 | is permitted to all users). The contents of the allow_read list are | |
2098 | examined after the deny_read list. |
|
2101 | examined after the deny_read list. | |
2099 |
|
2102 | |||
2100 | ``allowzip`` |
|
2103 | ``allowzip`` | |
2101 | (DEPRECATED) Whether to allow .zip downloading of repository |
|
2104 | (DEPRECATED) Whether to allow .zip downloading of repository | |
2102 | revisions. This feature creates temporary files. |
|
2105 | revisions. This feature creates temporary files. | |
2103 | (default: False) |
|
2106 | (default: False) | |
2104 |
|
2107 | |||
2105 | ``archivesubrepos`` |
|
2108 | ``archivesubrepos`` | |
2106 | Whether to recurse into subrepositories when archiving. |
|
2109 | Whether to recurse into subrepositories when archiving. | |
2107 | (default: False) |
|
2110 | (default: False) | |
2108 |
|
2111 | |||
2109 | ``baseurl`` |
|
2112 | ``baseurl`` | |
2110 | Base URL to use when publishing URLs in other locations, so |
|
2113 | Base URL to use when publishing URLs in other locations, so | |
2111 | third-party tools like email notification hooks can construct |
|
2114 | third-party tools like email notification hooks can construct | |
2112 | URLs. Example: ``http://hgserver/repos/``. |
|
2115 | URLs. Example: ``http://hgserver/repos/``. | |
2113 |
|
2116 | |||
2114 | ``cacerts`` |
|
2117 | ``cacerts`` | |
2115 | Path to file containing a list of PEM encoded certificate |
|
2118 | Path to file containing a list of PEM encoded certificate | |
2116 | authority certificates. Environment variables and ``~user`` |
|
2119 | authority certificates. Environment variables and ``~user`` | |
2117 | constructs are expanded in the filename. If specified on the |
|
2120 | constructs are expanded in the filename. If specified on the | |
2118 | client, then it will verify the identity of remote HTTPS servers |
|
2121 | client, then it will verify the identity of remote HTTPS servers | |
2119 | with these certificates. |
|
2122 | with these certificates. | |
2120 |
|
2123 | |||
2121 | To disable SSL verification temporarily, specify ``--insecure`` from |
|
2124 | To disable SSL verification temporarily, specify ``--insecure`` from | |
2122 | command line. |
|
2125 | command line. | |
2123 |
|
2126 | |||
2124 | You can use OpenSSL's CA certificate file if your platform has |
|
2127 | You can use OpenSSL's CA certificate file if your platform has | |
2125 | one. On most Linux systems this will be |
|
2128 | one. On most Linux systems this will be | |
2126 | ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to |
|
2129 | ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to | |
2127 | generate this file manually. The form must be as follows:: |
|
2130 | generate this file manually. The form must be as follows:: | |
2128 |
|
2131 | |||
2129 | -----BEGIN CERTIFICATE----- |
|
2132 | -----BEGIN CERTIFICATE----- | |
2130 | ... (certificate in base64 PEM encoding) ... |
|
2133 | ... (certificate in base64 PEM encoding) ... | |
2131 | -----END CERTIFICATE----- |
|
2134 | -----END CERTIFICATE----- | |
2132 | -----BEGIN CERTIFICATE----- |
|
2135 | -----BEGIN CERTIFICATE----- | |
2133 | ... (certificate in base64 PEM encoding) ... |
|
2136 | ... (certificate in base64 PEM encoding) ... | |
2134 | -----END CERTIFICATE----- |
|
2137 | -----END CERTIFICATE----- | |
2135 |
|
2138 | |||
2136 | ``cache`` |
|
2139 | ``cache`` | |
2137 | Whether to support caching in hgweb. (default: True) |
|
2140 | Whether to support caching in hgweb. (default: True) | |
2138 |
|
2141 | |||
2139 | ``certificate`` |
|
2142 | ``certificate`` | |
2140 | Certificate to use when running :hg:`serve`. |
|
2143 | Certificate to use when running :hg:`serve`. | |
2141 |
|
2144 | |||
2142 | ``collapse`` |
|
2145 | ``collapse`` | |
2143 | With ``descend`` enabled, repositories in subdirectories are shown at |
|
2146 | With ``descend`` enabled, repositories in subdirectories are shown at | |
2144 | a single level alongside repositories in the current path. With |
|
2147 | a single level alongside repositories in the current path. With | |
2145 | ``collapse`` also enabled, repositories residing at a deeper level than |
|
2148 | ``collapse`` also enabled, repositories residing at a deeper level than | |
2146 | the current path are grouped behind navigable directory entries that |
|
2149 | the current path are grouped behind navigable directory entries that | |
2147 | lead to the locations of these repositories. In effect, this setting |
|
2150 | lead to the locations of these repositories. In effect, this setting | |
2148 | collapses each collection of repositories found within a subdirectory |
|
2151 | collapses each collection of repositories found within a subdirectory | |
2149 | into a single entry for that subdirectory. (default: False) |
|
2152 | into a single entry for that subdirectory. (default: False) | |
2150 |
|
2153 | |||
2151 | ``comparisoncontext`` |
|
2154 | ``comparisoncontext`` | |
2152 | Number of lines of context to show in side-by-side file comparison. If |
|
2155 | Number of lines of context to show in side-by-side file comparison. If | |
2153 | negative or the value ``full``, whole files are shown. (default: 5) |
|
2156 | negative or the value ``full``, whole files are shown. (default: 5) | |
2154 |
|
2157 | |||
2155 | This setting can be overridden by a ``context`` request parameter to the |
|
2158 | This setting can be overridden by a ``context`` request parameter to the | |
2156 | ``comparison`` command, taking the same values. |
|
2159 | ``comparison`` command, taking the same values. | |
2157 |
|
2160 | |||
2158 | ``contact`` |
|
2161 | ``contact`` | |
2159 | Name or email address of the person in charge of the repository. |
|
2162 | Name or email address of the person in charge of the repository. | |
2160 | (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty) |
|
2163 | (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty) | |
2161 |
|
2164 | |||
2162 | ``csp`` |
|
2165 | ``csp`` | |
2163 | Send a ``Content-Security-Policy`` HTTP header with this value. |
|
2166 | Send a ``Content-Security-Policy`` HTTP header with this value. | |
2164 |
|
2167 | |||
2165 | The value may contain a special string ``%nonce%``, which will be replaced |
|
2168 | The value may contain a special string ``%nonce%``, which will be replaced | |
2166 | by a randomly-generated one-time use value. If the value contains |
|
2169 | by a randomly-generated one-time use value. If the value contains | |
2167 | ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the |
|
2170 | ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the | |
2168 | one-time property of the nonce. This nonce will also be inserted into |
|
2171 | one-time property of the nonce. This nonce will also be inserted into | |
2169 | ``<script>`` elements containing inline JavaScript. |
|
2172 | ``<script>`` elements containing inline JavaScript. | |
2170 |
|
2173 | |||
2171 | Note: lots of HTML content sent by the server is derived from repository |
|
2174 | Note: lots of HTML content sent by the server is derived from repository | |
2172 | data. Please consider the potential for malicious repository data to |
|
2175 | data. Please consider the potential for malicious repository data to | |
2173 | "inject" itself into generated HTML content as part of your security |
|
2176 | "inject" itself into generated HTML content as part of your security | |
2174 | threat model. |
|
2177 | threat model. | |
2175 |
|
2178 | |||
2176 | ``deny_push`` |
|
2179 | ``deny_push`` | |
2177 | Whether to deny pushing to the repository. If empty or not set, |
|
2180 | Whether to deny pushing to the repository. If empty or not set, | |
2178 | push is not denied. If the special value ``*``, all remote users are |
|
2181 | push is not denied. If the special value ``*``, all remote users are | |
2179 | denied push. Otherwise, unauthenticated users are all denied, and |
|
2182 | denied push. Otherwise, unauthenticated users are all denied, and | |
2180 | any authenticated user name present in this list is also denied. The |
|
2183 | any authenticated user name present in this list is also denied. The | |
2181 | contents of the deny_push list are examined before the allow_push list. |
|
2184 | contents of the deny_push list are examined before the allow_push list. | |
2182 |
|
2185 | |||
2183 | ``deny_read`` |
|
2186 | ``deny_read`` | |
2184 | Whether to deny reading/viewing of the repository. If this list is |
|
2187 | Whether to deny reading/viewing of the repository. If this list is | |
2185 | not empty, unauthenticated users are all denied, and any |
|
2188 | not empty, unauthenticated users are all denied, and any | |
2186 | authenticated user name present in this list is also denied access to |
|
2189 | authenticated user name present in this list is also denied access to | |
2187 | the repository. If set to the special value ``*``, all remote users |
|
2190 | the repository. If set to the special value ``*``, all remote users | |
2188 | are denied access (rarely needed ;). If deny_read is empty or not set, |
|
2191 | are denied access (rarely needed ;). If deny_read is empty or not set, | |
2189 | the determination of repository access depends on the presence and |
|
2192 | the determination of repository access depends on the presence and | |
2190 | content of the allow_read list (see description). If both |
|
2193 | content of the allow_read list (see description). If both | |
2191 | deny_read and allow_read are empty or not set, then access is |
|
2194 | deny_read and allow_read are empty or not set, then access is | |
2192 | permitted to all users by default. If the repository is being |
|
2195 | permitted to all users by default. If the repository is being | |
2193 | served via hgwebdir, denied users will not be able to see it in |
|
2196 | served via hgwebdir, denied users will not be able to see it in | |
2194 | the list of repositories. The contents of the deny_read list have |
|
2197 | the list of repositories. The contents of the deny_read list have | |
2195 | priority over (are examined before) the contents of the allow_read |
|
2198 | priority over (are examined before) the contents of the allow_read | |
2196 | list. |
|
2199 | list. | |
2197 |
|
2200 | |||
2198 | ``descend`` |
|
2201 | ``descend`` | |
2199 | hgwebdir indexes will not descend into subdirectories. Only repositories |
|
2202 | hgwebdir indexes will not descend into subdirectories. Only repositories | |
2200 | directly in the current path will be shown (other repositories are still |
|
2203 | directly in the current path will be shown (other repositories are still | |
2201 | available from the index corresponding to their containing path). |
|
2204 | available from the index corresponding to their containing path). | |
2202 |
|
2205 | |||
2203 | ``description`` |
|
2206 | ``description`` | |
2204 | Textual description of the repository's purpose or contents. |
|
2207 | Textual description of the repository's purpose or contents. | |
2205 | (default: "unknown") |
|
2208 | (default: "unknown") | |
2206 |
|
2209 | |||
2207 | ``encoding`` |
|
2210 | ``encoding`` | |
2208 | Character encoding name. (default: the current locale charset) |
|
2211 | Character encoding name. (default: the current locale charset) | |
2209 | Example: "UTF-8". |
|
2212 | Example: "UTF-8". | |
2210 |
|
2213 | |||
2211 | ``errorlog`` |
|
2214 | ``errorlog`` | |
2212 | Where to output the error log. (default: stderr) |
|
2215 | Where to output the error log. (default: stderr) | |
2213 |
|
2216 | |||
2214 | ``guessmime`` |
|
2217 | ``guessmime`` | |
2215 | Control MIME types for raw download of file content. |
|
2218 | Control MIME types for raw download of file content. | |
2216 | Set to True to let hgweb guess the content type from the file |
|
2219 | Set to True to let hgweb guess the content type from the file | |
2217 | extension. This will serve HTML files as ``text/html`` and might |
|
2220 | extension. This will serve HTML files as ``text/html`` and might | |
2218 | allow cross-site scripting attacks when serving untrusted |
|
2221 | allow cross-site scripting attacks when serving untrusted | |
2219 | repositories. (default: False) |
|
2222 | repositories. (default: False) | |
2220 |
|
2223 | |||
2221 | ``hidden`` |
|
2224 | ``hidden`` | |
2222 | Whether to hide the repository in the hgwebdir index. |
|
2225 | Whether to hide the repository in the hgwebdir index. | |
2223 | (default: False) |
|
2226 | (default: False) | |
2224 |
|
2227 | |||
2225 | ``ipv6`` |
|
2228 | ``ipv6`` | |
2226 | Whether to use IPv6. (default: False) |
|
2229 | Whether to use IPv6. (default: False) | |
2227 |
|
2230 | |||
2228 | ``labels`` |
|
2231 | ``labels`` | |
2229 | List of string *labels* associated with the repository. |
|
2232 | List of string *labels* associated with the repository. | |
2230 |
|
2233 | |||
2231 | Labels are exposed as a template keyword and can be used to customize |
|
2234 | Labels are exposed as a template keyword and can be used to customize | |
2232 | output. e.g. the ``index`` template can group or filter repositories |
|
2235 | output. e.g. the ``index`` template can group or filter repositories | |
2233 | by labels and the ``summary`` template can display additional content |
|
2236 | by labels and the ``summary`` template can display additional content | |
2234 | if a specific label is present. |
|
2237 | if a specific label is present. | |
2235 |
|
2238 | |||
2236 | ``logoimg`` |
|
2239 | ``logoimg`` | |
2237 | File name of the logo image that some templates display on each page. |
|
2240 | File name of the logo image that some templates display on each page. | |
2238 | The file name is relative to ``staticurl``. That is, the full path to |
|
2241 | The file name is relative to ``staticurl``. That is, the full path to | |
2239 | the logo image is "staticurl/logoimg". |
|
2242 | the logo image is "staticurl/logoimg". | |
2240 | If unset, ``hglogo.png`` will be used. |
|
2243 | If unset, ``hglogo.png`` will be used. | |
2241 |
|
2244 | |||
2242 | ``logourl`` |
|
2245 | ``logourl`` | |
2243 | Base URL to use for logos. If unset, ``https://mercurial-scm.org/`` |
|
2246 | Base URL to use for logos. If unset, ``https://mercurial-scm.org/`` | |
2244 | will be used. |
|
2247 | will be used. | |
2245 |
|
2248 | |||
2246 | ``maxchanges`` |
|
2249 | ``maxchanges`` | |
2247 | Maximum number of changes to list on the changelog. (default: 10) |
|
2250 | Maximum number of changes to list on the changelog. (default: 10) | |
2248 |
|
2251 | |||
2249 | ``maxfiles`` |
|
2252 | ``maxfiles`` | |
2250 | Maximum number of files to list per changeset. (default: 10) |
|
2253 | Maximum number of files to list per changeset. (default: 10) | |
2251 |
|
2254 | |||
2252 | ``maxshortchanges`` |
|
2255 | ``maxshortchanges`` | |
2253 | Maximum number of changes to list on the shortlog, graph or filelog |
|
2256 | Maximum number of changes to list on the shortlog, graph or filelog | |
2254 | pages. (default: 60) |
|
2257 | pages. (default: 60) | |
2255 |
|
2258 | |||
2256 | ``name`` |
|
2259 | ``name`` | |
2257 | Repository name to use in the web interface. |
|
2260 | Repository name to use in the web interface. | |
2258 | (default: current working directory) |
|
2261 | (default: current working directory) | |
2259 |
|
2262 | |||
2260 | ``port`` |
|
2263 | ``port`` | |
2261 | Port to listen on. (default: 8000) |
|
2264 | Port to listen on. (default: 8000) | |
2262 |
|
2265 | |||
2263 | ``prefix`` |
|
2266 | ``prefix`` | |
2264 | Prefix path to serve from. (default: '' (server root)) |
|
2267 | Prefix path to serve from. (default: '' (server root)) | |
2265 |
|
2268 | |||
2266 | ``push_ssl`` |
|
2269 | ``push_ssl`` | |
2267 | Whether to require that inbound pushes be transported over SSL to |
|
2270 | Whether to require that inbound pushes be transported over SSL to | |
2268 | prevent password sniffing. (default: True) |
|
2271 | prevent password sniffing. (default: True) | |
2269 |
|
2272 | |||
2270 | ``refreshinterval`` |
|
2273 | ``refreshinterval`` | |
2271 | How frequently directory listings re-scan the filesystem for new |
|
2274 | How frequently directory listings re-scan the filesystem for new | |
2272 | repositories, in seconds. This is relevant when wildcards are used |
|
2275 | repositories, in seconds. This is relevant when wildcards are used | |
2273 | to define paths. Depending on how much filesystem traversal is |
|
2276 | to define paths. Depending on how much filesystem traversal is | |
2274 | required, refreshing may negatively impact performance. |
|
2277 | required, refreshing may negatively impact performance. | |
2275 |
|
2278 | |||
2276 | Values less than or equal to 0 always refresh. |
|
2279 | Values less than or equal to 0 always refresh. | |
2277 | (default: 20) |
|
2280 | (default: 20) | |
2278 |
|
2281 | |||
2279 | ``staticurl`` |
|
2282 | ``staticurl`` | |
2280 | Base URL to use for static files. If unset, static files (e.g. the |
|
2283 | Base URL to use for static files. If unset, static files (e.g. the | |
2281 | hgicon.png favicon) will be served by the CGI script itself. Use |
|
2284 | hgicon.png favicon) will be served by the CGI script itself. Use | |
2282 | this setting to serve them directly with the HTTP server. |
|
2285 | this setting to serve them directly with the HTTP server. | |
2283 | Example: ``http://hgserver/static/``. |
|
2286 | Example: ``http://hgserver/static/``. | |
2284 |
|
2287 | |||
2285 | ``stripes`` |
|
2288 | ``stripes`` | |
2286 | How many lines a "zebra stripe" should span in multi-line output. |
|
2289 | How many lines a "zebra stripe" should span in multi-line output. | |
2287 | Set to 0 to disable. (default: 1) |
|
2290 | Set to 0 to disable. (default: 1) | |
2288 |
|
2291 | |||
2289 | ``style`` |
|
2292 | ``style`` | |
2290 | Which template map style to use. The available options are the names of |
|
2293 | Which template map style to use. The available options are the names of | |
2291 | subdirectories in the HTML templates path. (default: ``paper``) |
|
2294 | subdirectories in the HTML templates path. (default: ``paper``) | |
2292 | Example: ``monoblue``. |
|
2295 | Example: ``monoblue``. | |
2293 |
|
2296 | |||
2294 | ``templates`` |
|
2297 | ``templates`` | |
2295 | Where to find the HTML templates. The default path to the HTML templates |
|
2298 | Where to find the HTML templates. The default path to the HTML templates | |
2296 | can be obtained from ``hg debuginstall``. |
|
2299 | can be obtained from ``hg debuginstall``. | |
2297 |
|
2300 | |||
2298 | ``websub`` |
|
2301 | ``websub`` | |
2299 | ---------- |
|
2302 | ---------- | |
2300 |
|
2303 | |||
2301 | Web substitution filter definition. You can use this section to |
|
2304 | Web substitution filter definition. You can use this section to | |
2302 | define a set of regular expression substitution patterns which |
|
2305 | define a set of regular expression substitution patterns which | |
2303 | let you automatically modify the hgweb server output. |
|
2306 | let you automatically modify the hgweb server output. | |
2304 |
|
2307 | |||
2305 | The default hgweb templates only apply these substitution patterns |
|
2308 | The default hgweb templates only apply these substitution patterns | |
2306 | on the revision description fields. You can apply them anywhere |
|
2309 | on the revision description fields. You can apply them anywhere | |
2307 | you want when you create your own templates by adding calls to the |
|
2310 | you want when you create your own templates by adding calls to the | |
2308 | "websub" filter (usually after calling the "escape" filter). |
|
2311 | "websub" filter (usually after calling the "escape" filter). | |
2309 |
|
2312 | |||
2310 | This can be used, for example, to convert issue references to links |
|
2313 | This can be used, for example, to convert issue references to links | |
2311 | to your issue tracker, or to convert "markdown-like" syntax into |
|
2314 | to your issue tracker, or to convert "markdown-like" syntax into | |
2312 | HTML (see the examples below). |
|
2315 | HTML (see the examples below). | |
2313 |
|
2316 | |||
2314 | Each entry in this section names a substitution filter. |
|
2317 | Each entry in this section names a substitution filter. | |
2315 | The value of each entry defines the substitution expression itself. |
|
2318 | The value of each entry defines the substitution expression itself. | |
2316 | The websub expressions follow the old interhg extension syntax, |
|
2319 | The websub expressions follow the old interhg extension syntax, | |
2317 | which in turn imitates the Unix sed replacement syntax:: |
|
2320 | which in turn imitates the Unix sed replacement syntax:: | |
2318 |
|
2321 | |||
2319 | patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i] |
|
2322 | patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i] | |
2320 |
|
2323 | |||
2321 | You can use any separator other than "/". The final "i" is optional |
|
2324 | You can use any separator other than "/". The final "i" is optional | |
2322 | and indicates that the search must be case insensitive. |
|
2325 | and indicates that the search must be case insensitive. | |
2323 |
|
2326 | |||
2324 | Examples:: |
|
2327 | Examples:: | |
2325 |
|
2328 | |||
2326 | [websub] |
|
2329 | [websub] | |
2327 | issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i |
|
2330 | issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i | |
2328 | italic = s/\b_(\S+)_\b/<i>\1<\/i>/ |
|
2331 | italic = s/\b_(\S+)_\b/<i>\1<\/i>/ | |
2329 | bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/ |
|
2332 | bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/ | |
2330 |
|
2333 | |||
2331 | ``worker`` |
|
2334 | ``worker`` | |
2332 | ---------- |
|
2335 | ---------- | |
2333 |
|
2336 | |||
2334 | Parallel master/worker configuration. We currently perform working |
|
2337 | Parallel master/worker configuration. We currently perform working | |
2335 | directory updates in parallel on Unix-like systems, which greatly |
|
2338 | directory updates in parallel on Unix-like systems, which greatly | |
2336 | helps performance. |
|
2339 | helps performance. | |
2337 |
|
2340 | |||
2338 | ``numcpus`` |
|
2341 | ``numcpus`` | |
2339 | Number of CPUs to use for parallel operations. A zero or |
|
2342 | Number of CPUs to use for parallel operations. A zero or | |
2340 | negative value is treated as ``use the default``. |
|
2343 | negative value is treated as ``use the default``. | |
2341 | (default: 4 or the number of CPUs on the system, whichever is larger) |
|
2344 | (default: 4 or the number of CPUs on the system, whichever is larger) | |
2342 |
|
2345 | |||
2343 | ``backgroundclose`` |
|
2346 | ``backgroundclose`` | |
2344 | Whether to enable closing file handles on background threads during certain |
|
2347 | Whether to enable closing file handles on background threads during certain | |
2345 | operations. Some platforms aren't very efficient at closing file |
|
2348 | operations. Some platforms aren't very efficient at closing file | |
2346 | handles that have been written or appended to. By performing file closing |
|
2349 | handles that have been written or appended to. By performing file closing | |
2347 | on background threads, file write rate can increase substantially. |
|
2350 | on background threads, file write rate can increase substantially. | |
2348 | (default: true on Windows, false elsewhere) |
|
2351 | (default: true on Windows, false elsewhere) | |
2349 |
|
2352 | |||
2350 | ``backgroundcloseminfilecount`` |
|
2353 | ``backgroundcloseminfilecount`` | |
2351 | Minimum number of files required to trigger background file closing. |
|
2354 | Minimum number of files required to trigger background file closing. | |
2352 | Operations not writing this many files won't start background close |
|
2355 | Operations not writing this many files won't start background close | |
2353 | threads. |
|
2356 | threads. | |
2354 | (default: 2048) |
|
2357 | (default: 2048) | |
2355 |
|
2358 | |||
2356 | ``backgroundclosemaxqueue`` |
|
2359 | ``backgroundclosemaxqueue`` | |
2357 | The maximum number of opened file handles waiting to be closed in the |
|
2360 | The maximum number of opened file handles waiting to be closed in the | |
2358 | background. This option only has an effect if ``backgroundclose`` is |
|
2361 | background. This option only has an effect if ``backgroundclose`` is | |
2359 | enabled. |
|
2362 | enabled. | |
2360 | (default: 384) |
|
2363 | (default: 384) | |
2361 |
|
2364 | |||
2362 | ``backgroundclosethreadcount`` |
|
2365 | ``backgroundclosethreadcount`` | |
2363 | Number of threads to process background file closes. Only relevant if |
|
2366 | Number of threads to process background file closes. Only relevant if | |
2364 | ``backgroundclose`` is enabled. |
|
2367 | ``backgroundclose`` is enabled. | |
2365 | (default: 4) |
|
2368 | (default: 4) |
@@ -1,266 +1,267 | |||||
1 | # hook.py - hook support for mercurial |
|
1 | # hook.py - hook support for mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2007 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2007 Matt Mackall <mpm@selenic.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | from __future__ import absolute_import |
|
8 | from __future__ import absolute_import | |
9 |
|
9 | |||
10 | import os |
|
10 | import os | |
11 | import sys |
|
11 | import sys | |
12 |
|
12 | |||
13 | from .i18n import _ |
|
13 | from .i18n import _ | |
14 | from . import ( |
|
14 | from . import ( | |
15 | demandimport, |
|
15 | demandimport, | |
16 | error, |
|
16 | error, | |
17 | extensions, |
|
17 | extensions, | |
18 | pycompat, |
|
18 | pycompat, | |
19 | util, |
|
19 | util, | |
20 | ) |
|
20 | ) | |
21 |
|
21 | |||
22 | def _pythonhook(ui, repo, htype, hname, funcname, args, throw): |
|
22 | def _pythonhook(ui, repo, htype, hname, funcname, args, throw): | |
23 | '''call python hook. hook is callable object, looked up as |
|
23 | '''call python hook. hook is callable object, looked up as | |
24 | name in python module. if callable returns "true", hook |
|
24 | name in python module. if callable returns "true", hook | |
25 | fails, else passes. if hook raises exception, treated as |
|
25 | fails, else passes. if hook raises exception, treated as | |
26 | hook failure. exception propagates if throw is "true". |
|
26 | hook failure. exception propagates if throw is "true". | |
27 |
|
27 | |||
28 | reason for "true" meaning "hook failed" is so that |
|
28 | reason for "true" meaning "hook failed" is so that | |
29 | unmodified commands (e.g. mercurial.commands.update) can |
|
29 | unmodified commands (e.g. mercurial.commands.update) can | |
30 | be run as hooks without wrappers to convert return values.''' |
|
30 | be run as hooks without wrappers to convert return values.''' | |
31 |
|
31 | |||
32 | if callable(funcname): |
|
32 | if callable(funcname): | |
33 | obj = funcname |
|
33 | obj = funcname | |
34 | funcname = obj.__module__ + "." + obj.__name__ |
|
34 | funcname = obj.__module__ + "." + obj.__name__ | |
35 | else: |
|
35 | else: | |
36 | d = funcname.rfind('.') |
|
36 | d = funcname.rfind('.') | |
37 | if d == -1: |
|
37 | if d == -1: | |
38 | raise error.HookLoadError( |
|
38 | raise error.HookLoadError( | |
39 | _('%s hook is invalid: "%s" not in a module') |
|
39 | _('%s hook is invalid: "%s" not in a module') | |
40 | % (hname, funcname)) |
|
40 | % (hname, funcname)) | |
41 | modname = funcname[:d] |
|
41 | modname = funcname[:d] | |
42 | oldpaths = sys.path |
|
42 | oldpaths = sys.path | |
43 | if util.mainfrozen(): |
|
43 | if util.mainfrozen(): | |
44 | # binary installs require sys.path manipulation |
|
44 | # binary installs require sys.path manipulation | |
45 | modpath, modfile = os.path.split(modname) |
|
45 | modpath, modfile = os.path.split(modname) | |
46 | if modpath and modfile: |
|
46 | if modpath and modfile: | |
47 | sys.path = sys.path[:] + [modpath] |
|
47 | sys.path = sys.path[:] + [modpath] | |
48 | modname = modfile |
|
48 | modname = modfile | |
49 | with demandimport.deactivated(): |
|
49 | with demandimport.deactivated(): | |
50 | try: |
|
50 | try: | |
51 | obj = __import__(modname) |
|
51 | obj = __import__(modname) | |
52 | except (ImportError, SyntaxError): |
|
52 | except (ImportError, SyntaxError): | |
53 | e1 = sys.exc_info() |
|
53 | e1 = sys.exc_info() | |
54 | try: |
|
54 | try: | |
55 | # extensions are loaded with hgext_ prefix |
|
55 | # extensions are loaded with hgext_ prefix | |
56 | obj = __import__("hgext_%s" % modname) |
|
56 | obj = __import__("hgext_%s" % modname) | |
57 | except (ImportError, SyntaxError): |
|
57 | except (ImportError, SyntaxError): | |
58 | e2 = sys.exc_info() |
|
58 | e2 = sys.exc_info() | |
59 | if ui.tracebackflag: |
|
59 | if ui.tracebackflag: | |
60 | ui.warn(_('exception from first failed import ' |
|
60 | ui.warn(_('exception from first failed import ' | |
61 | 'attempt:\n')) |
|
61 | 'attempt:\n')) | |
62 | ui.traceback(e1) |
|
62 | ui.traceback(e1) | |
63 | if ui.tracebackflag: |
|
63 | if ui.tracebackflag: | |
64 | ui.warn(_('exception from second failed import ' |
|
64 | ui.warn(_('exception from second failed import ' | |
65 | 'attempt:\n')) |
|
65 | 'attempt:\n')) | |
66 | ui.traceback(e2) |
|
66 | ui.traceback(e2) | |
67 |
|
67 | |||
68 | if not ui.tracebackflag: |
|
68 | if not ui.tracebackflag: | |
69 | tracebackhint = _( |
|
69 | tracebackhint = _( | |
70 | 'run with --traceback for stack trace') |
|
70 | 'run with --traceback for stack trace') | |
71 | else: |
|
71 | else: | |
72 | tracebackhint = None |
|
72 | tracebackhint = None | |
73 | raise error.HookLoadError( |
|
73 | raise error.HookLoadError( | |
74 | _('%s hook is invalid: import of "%s" failed') % |
|
74 | _('%s hook is invalid: import of "%s" failed') % | |
75 | (hname, modname), hint=tracebackhint) |
|
75 | (hname, modname), hint=tracebackhint) | |
76 | sys.path = oldpaths |
|
76 | sys.path = oldpaths | |
77 | try: |
|
77 | try: | |
78 | for p in funcname.split('.')[1:]: |
|
78 | for p in funcname.split('.')[1:]: | |
79 | obj = getattr(obj, p) |
|
79 | obj = getattr(obj, p) | |
80 | except AttributeError: |
|
80 | except AttributeError: | |
81 | raise error.HookLoadError( |
|
81 | raise error.HookLoadError( | |
82 | _('%s hook is invalid: "%s" is not defined') |
|
82 | _('%s hook is invalid: "%s" is not defined') | |
83 | % (hname, funcname)) |
|
83 | % (hname, funcname)) | |
84 | if not callable(obj): |
|
84 | if not callable(obj): | |
85 | raise error.HookLoadError( |
|
85 | raise error.HookLoadError( | |
86 | _('%s hook is invalid: "%s" is not callable') |
|
86 | _('%s hook is invalid: "%s" is not callable') | |
87 | % (hname, funcname)) |
|
87 | % (hname, funcname)) | |
88 |
|
88 | |||
89 | ui.note(_("calling hook %s: %s\n") % (hname, funcname)) |
|
89 | ui.note(_("calling hook %s: %s\n") % (hname, funcname)) | |
90 | starttime = util.timer() |
|
90 | starttime = util.timer() | |
91 |
|
91 | |||
92 | try: |
|
92 | try: | |
93 | r = obj(ui=ui, repo=repo, hooktype=htype, **args) |
|
93 | r = obj(ui=ui, repo=repo, hooktype=htype, **args) | |
94 | except Exception as exc: |
|
94 | except Exception as exc: | |
95 | if isinstance(exc, error.Abort): |
|
95 | if isinstance(exc, error.Abort): | |
96 | ui.warn(_('error: %s hook failed: %s\n') % |
|
96 | ui.warn(_('error: %s hook failed: %s\n') % | |
97 | (hname, exc.args[0])) |
|
97 | (hname, exc.args[0])) | |
98 | else: |
|
98 | else: | |
99 | ui.warn(_('error: %s hook raised an exception: ' |
|
99 | ui.warn(_('error: %s hook raised an exception: ' | |
100 | '%s\n') % (hname, exc)) |
|
100 | '%s\n') % (hname, exc)) | |
101 | if throw: |
|
101 | if throw: | |
102 | raise |
|
102 | raise | |
103 | if not ui.tracebackflag: |
|
103 | if not ui.tracebackflag: | |
104 | ui.warn(_('(run with --traceback for stack trace)\n')) |
|
104 | ui.warn(_('(run with --traceback for stack trace)\n')) | |
105 | ui.traceback() |
|
105 | ui.traceback() | |
106 | return True, True |
|
106 | return True, True | |
107 | finally: |
|
107 | finally: | |
108 | duration = util.timer() - starttime |
|
108 | duration = util.timer() - starttime | |
109 | ui.log('pythonhook', 'pythonhook-%s: %s finished in %0.2f seconds\n', |
|
109 | ui.log('pythonhook', 'pythonhook-%s: %s finished in %0.2f seconds\n', | |
110 | htype, funcname, duration) |
|
110 | htype, funcname, duration) | |
111 | if r: |
|
111 | if r: | |
112 | if throw: |
|
112 | if throw: | |
113 | raise error.HookAbort(_('%s hook failed') % hname) |
|
113 | raise error.HookAbort(_('%s hook failed') % hname) | |
114 | ui.warn(_('warning: %s hook failed\n') % hname) |
|
114 | ui.warn(_('warning: %s hook failed\n') % hname) | |
115 | return r, False |
|
115 | return r, False | |
116 |
|
116 | |||
117 | def _exthook(ui, repo, name, cmd, args, throw): |
|
117 | def _exthook(ui, repo, htype, name, cmd, args, throw): | |
118 | ui.note(_("running hook %s: %s\n") % (name, cmd)) |
|
118 | ui.note(_("running hook %s: %s\n") % (name, cmd)) | |
119 |
|
119 | |||
120 | starttime = util.timer() |
|
120 | starttime = util.timer() | |
121 | env = {} |
|
121 | env = {} | |
122 |
|
122 | |||
123 | # make in-memory changes visible to external process |
|
123 | # make in-memory changes visible to external process | |
124 | if repo is not None: |
|
124 | if repo is not None: | |
125 | tr = repo.currenttransaction() |
|
125 | tr = repo.currenttransaction() | |
126 | repo.dirstate.write(tr) |
|
126 | repo.dirstate.write(tr) | |
127 | if tr and tr.writepending(): |
|
127 | if tr and tr.writepending(): | |
128 | env['HG_PENDING'] = repo.root |
|
128 | env['HG_PENDING'] = repo.root | |
|
129 | env['HG_HOOKTYPE'] = htype | |||
129 |
|
130 | |||
130 | for k, v in args.iteritems(): |
|
131 | for k, v in args.iteritems(): | |
131 | if callable(v): |
|
132 | if callable(v): | |
132 | v = v() |
|
133 | v = v() | |
133 | if isinstance(v, dict): |
|
134 | if isinstance(v, dict): | |
134 | # make the dictionary element order stable across Python |
|
135 | # make the dictionary element order stable across Python | |
135 | # implementations |
|
136 | # implementations | |
136 | v = ('{' + |
|
137 | v = ('{' + | |
137 | ', '.join('%r: %r' % i for i in sorted(v.iteritems())) + |
|
138 | ', '.join('%r: %r' % i for i in sorted(v.iteritems())) + | |
138 | '}') |
|
139 | '}') | |
139 | env['HG_' + k.upper()] = v |
|
140 | env['HG_' + k.upper()] = v | |
140 |
|
141 | |||
141 | if repo: |
|
142 | if repo: | |
142 | cwd = repo.root |
|
143 | cwd = repo.root | |
143 | else: |
|
144 | else: | |
144 | cwd = pycompat.getcwd() |
|
145 | cwd = pycompat.getcwd() | |
145 | r = ui.system(cmd, environ=env, cwd=cwd, blockedtag='exthook-%s' % (name,)) |
|
146 | r = ui.system(cmd, environ=env, cwd=cwd, blockedtag='exthook-%s' % (name,)) | |
146 |
|
147 | |||
147 | duration = util.timer() - starttime |
|
148 | duration = util.timer() - starttime | |
148 | ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n', |
|
149 | ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n', | |
149 | name, cmd, duration) |
|
150 | name, cmd, duration) | |
150 | if r: |
|
151 | if r: | |
151 | desc, r = util.explainexit(r) |
|
152 | desc, r = util.explainexit(r) | |
152 | if throw: |
|
153 | if throw: | |
153 | raise error.HookAbort(_('%s hook %s') % (name, desc)) |
|
154 | raise error.HookAbort(_('%s hook %s') % (name, desc)) | |
154 | ui.warn(_('warning: %s hook %s\n') % (name, desc)) |
|
155 | ui.warn(_('warning: %s hook %s\n') % (name, desc)) | |
155 | return r |
|
156 | return r | |
156 |
|
157 | |||
157 | # represent an untrusted hook command |
|
158 | # represent an untrusted hook command | |
158 | _fromuntrusted = object() |
|
159 | _fromuntrusted = object() | |
159 |
|
160 | |||
160 | def _allhooks(ui): |
|
161 | def _allhooks(ui): | |
161 | """return a list of (hook-id, cmd) pairs sorted by priority""" |
|
162 | """return a list of (hook-id, cmd) pairs sorted by priority""" | |
162 | hooks = _hookitems(ui) |
|
163 | hooks = _hookitems(ui) | |
163 | # Be careful in this section, propagating the real commands from untrusted |
|
164 | # Be careful in this section, propagating the real commands from untrusted | |
164 | # sources would create a security vulnerability, make sure anything altered |
|
165 | # sources would create a security vulnerability, make sure anything altered | |
165 | # in that section uses "_fromuntrusted" as its command. |
|
166 | # in that section uses "_fromuntrusted" as its command. | |
166 | untrustedhooks = _hookitems(ui, _untrusted=True) |
|
167 | untrustedhooks = _hookitems(ui, _untrusted=True) | |
167 | for name, value in untrustedhooks.items(): |
|
168 | for name, value in untrustedhooks.items(): | |
168 | trustedvalue = hooks.get(name, (None, None, name, _fromuntrusted)) |
|
169 | trustedvalue = hooks.get(name, (None, None, name, _fromuntrusted)) | |
169 | if value != trustedvalue: |
|
170 | if value != trustedvalue: | |
170 | (lp, lo, lk, lv) = trustedvalue |
|
171 | (lp, lo, lk, lv) = trustedvalue | |
171 | hooks[name] = (lp, lo, lk, _fromuntrusted) |
|
172 | hooks[name] = (lp, lo, lk, _fromuntrusted) | |
172 | # (end of the security sensitive section) |
|
173 | # (end of the security sensitive section) | |
173 | return [(k, v) for p, o, k, v in sorted(hooks.values())] |
|
174 | return [(k, v) for p, o, k, v in sorted(hooks.values())] | |
174 |
|
175 | |||
175 | def _hookitems(ui, _untrusted=False): |
|
176 | def _hookitems(ui, _untrusted=False): | |
176 | """return all hooks items ready to be sorted""" |
|
177 | """return all hooks items ready to be sorted""" | |
177 | hooks = {} |
|
178 | hooks = {} | |
178 | for name, cmd in ui.configitems('hooks', untrusted=_untrusted): |
|
179 | for name, cmd in ui.configitems('hooks', untrusted=_untrusted): | |
179 | if not name.startswith('priority'): |
|
180 | if not name.startswith('priority'): | |
180 | priority = ui.configint('hooks', 'priority.%s' % name, 0) |
|
181 | priority = ui.configint('hooks', 'priority.%s' % name, 0) | |
181 | hooks[name] = (-priority, len(hooks), name, cmd) |
|
182 | hooks[name] = (-priority, len(hooks), name, cmd) | |
182 | return hooks |
|
183 | return hooks | |
183 |
|
184 | |||
184 | _redirect = False |
|
185 | _redirect = False | |
185 | def redirect(state): |
|
186 | def redirect(state): | |
186 | global _redirect |
|
187 | global _redirect | |
187 | _redirect = state |
|
188 | _redirect = state | |
188 |
|
189 | |||
189 | def hook(ui, repo, htype, throw=False, **args): |
|
190 | def hook(ui, repo, htype, throw=False, **args): | |
190 | if not ui.callhooks: |
|
191 | if not ui.callhooks: | |
191 | return False |
|
192 | return False | |
192 |
|
193 | |||
193 | hooks = [] |
|
194 | hooks = [] | |
194 | for hname, cmd in _allhooks(ui): |
|
195 | for hname, cmd in _allhooks(ui): | |
195 | if hname.split('.')[0] == htype and cmd: |
|
196 | if hname.split('.')[0] == htype and cmd: | |
196 | hooks.append((hname, cmd)) |
|
197 | hooks.append((hname, cmd)) | |
197 |
|
198 | |||
198 | res = runhooks(ui, repo, htype, hooks, throw=throw, **args) |
|
199 | res = runhooks(ui, repo, htype, hooks, throw=throw, **args) | |
199 | r = False |
|
200 | r = False | |
200 | for hname, cmd in hooks: |
|
201 | for hname, cmd in hooks: | |
201 | r = res[hname][0] or r |
|
202 | r = res[hname][0] or r | |
202 | return r |
|
203 | return r | |
203 |
|
204 | |||
204 | def runhooks(ui, repo, htype, hooks, throw=False, **args): |
|
205 | def runhooks(ui, repo, htype, hooks, throw=False, **args): | |
205 | res = {} |
|
206 | res = {} | |
206 | oldstdout = -1 |
|
207 | oldstdout = -1 | |
207 |
|
208 | |||
208 | try: |
|
209 | try: | |
209 | for hname, cmd in hooks: |
|
210 | for hname, cmd in hooks: | |
210 | if oldstdout == -1 and _redirect: |
|
211 | if oldstdout == -1 and _redirect: | |
211 | try: |
|
212 | try: | |
212 | stdoutno = util.stdout.fileno() |
|
213 | stdoutno = util.stdout.fileno() | |
213 | stderrno = util.stderr.fileno() |
|
214 | stderrno = util.stderr.fileno() | |
214 | # temporarily redirect stdout to stderr, if possible |
|
215 | # temporarily redirect stdout to stderr, if possible | |
215 | if stdoutno >= 0 and stderrno >= 0: |
|
216 | if stdoutno >= 0 and stderrno >= 0: | |
216 | util.stdout.flush() |
|
217 | util.stdout.flush() | |
217 | oldstdout = os.dup(stdoutno) |
|
218 | oldstdout = os.dup(stdoutno) | |
218 | os.dup2(stderrno, stdoutno) |
|
219 | os.dup2(stderrno, stdoutno) | |
219 | except (OSError, AttributeError): |
|
220 | except (OSError, AttributeError): | |
220 | # files seem to be bogus, give up on redirecting (WSGI, etc) |
|
221 | # files seem to be bogus, give up on redirecting (WSGI, etc) | |
221 | pass |
|
222 | pass | |
222 |
|
223 | |||
223 | if cmd is _fromuntrusted: |
|
224 | if cmd is _fromuntrusted: | |
224 | if throw: |
|
225 | if throw: | |
225 | raise error.HookAbort( |
|
226 | raise error.HookAbort( | |
226 | _('untrusted hook %s not executed') % hname, |
|
227 | _('untrusted hook %s not executed') % hname, | |
227 | hint = _("see 'hg help config.trusted'")) |
|
228 | hint = _("see 'hg help config.trusted'")) | |
228 | ui.warn(_('warning: untrusted hook %s not executed\n') % hname) |
|
229 | ui.warn(_('warning: untrusted hook %s not executed\n') % hname) | |
229 | r = 1 |
|
230 | r = 1 | |
230 | raised = False |
|
231 | raised = False | |
231 | elif callable(cmd): |
|
232 | elif callable(cmd): | |
232 | r, raised = _pythonhook(ui, repo, htype, hname, cmd, args, |
|
233 | r, raised = _pythonhook(ui, repo, htype, hname, cmd, args, | |
233 | throw) |
|
234 | throw) | |
234 | elif cmd.startswith('python:'): |
|
235 | elif cmd.startswith('python:'): | |
235 | if cmd.count(':') >= 2: |
|
236 | if cmd.count(':') >= 2: | |
236 | path, cmd = cmd[7:].rsplit(':', 1) |
|
237 | path, cmd = cmd[7:].rsplit(':', 1) | |
237 | path = util.expandpath(path) |
|
238 | path = util.expandpath(path) | |
238 | if repo: |
|
239 | if repo: | |
239 | path = os.path.join(repo.root, path) |
|
240 | path = os.path.join(repo.root, path) | |
240 | try: |
|
241 | try: | |
241 | mod = extensions.loadpath(path, 'hghook.%s' % hname) |
|
242 | mod = extensions.loadpath(path, 'hghook.%s' % hname) | |
242 | except Exception: |
|
243 | except Exception: | |
243 | ui.write(_("loading %s hook failed:\n") % hname) |
|
244 | ui.write(_("loading %s hook failed:\n") % hname) | |
244 | raise |
|
245 | raise | |
245 | hookfn = getattr(mod, cmd) |
|
246 | hookfn = getattr(mod, cmd) | |
246 | else: |
|
247 | else: | |
247 | hookfn = cmd[7:].strip() |
|
248 | hookfn = cmd[7:].strip() | |
248 | r, raised = _pythonhook(ui, repo, htype, hname, hookfn, args, |
|
249 | r, raised = _pythonhook(ui, repo, htype, hname, hookfn, args, | |
249 | throw) |
|
250 | throw) | |
250 | else: |
|
251 | else: | |
251 | r = _exthook(ui, repo, hname, cmd, args, throw) |
|
252 | r = _exthook(ui, repo, htype, hname, cmd, args, throw) | |
252 | raised = False |
|
253 | raised = False | |
253 |
|
254 | |||
254 | res[hname] = r, raised |
|
255 | res[hname] = r, raised | |
255 |
|
256 | |||
256 | # The stderr is fully buffered on Windows when connected to a pipe. |
|
257 | # The stderr is fully buffered on Windows when connected to a pipe. | |
257 | # A forcible flush is required to make small stderr data in the |
|
258 | # A forcible flush is required to make small stderr data in the | |
258 | # remote side available to the client immediately. |
|
259 | # remote side available to the client immediately. | |
259 | util.stderr.flush() |
|
260 | util.stderr.flush() | |
260 | finally: |
|
261 | finally: | |
261 | if _redirect and oldstdout >= 0: |
|
262 | if _redirect and oldstdout >= 0: | |
262 | util.stdout.flush() # write hook output to stderr fd |
|
263 | util.stdout.flush() # write hook output to stderr fd | |
263 | os.dup2(oldstdout, stdoutno) |
|
264 | os.dup2(oldstdout, stdoutno) | |
264 | os.close(oldstdout) |
|
265 | os.close(oldstdout) | |
265 |
|
266 | |||
266 | return res |
|
267 | return res |
@@ -1,853 +1,853 | |||||
1 |
|
1 | |||
2 | $ cat << EOF >> $HGRCPATH |
|
2 | $ cat << EOF >> $HGRCPATH | |
3 | > [format] |
|
3 | > [format] | |
4 | > usegeneraldelta=yes |
|
4 | > usegeneraldelta=yes | |
5 | > EOF |
|
5 | > EOF | |
6 |
|
6 | |||
7 | Setting up test |
|
7 | Setting up test | |
8 |
|
8 | |||
9 | $ hg init test |
|
9 | $ hg init test | |
10 | $ cd test |
|
10 | $ cd test | |
11 | $ echo 0 > afile |
|
11 | $ echo 0 > afile | |
12 | $ hg add afile |
|
12 | $ hg add afile | |
13 | $ hg commit -m "0.0" |
|
13 | $ hg commit -m "0.0" | |
14 | $ echo 1 >> afile |
|
14 | $ echo 1 >> afile | |
15 | $ hg commit -m "0.1" |
|
15 | $ hg commit -m "0.1" | |
16 | $ echo 2 >> afile |
|
16 | $ echo 2 >> afile | |
17 | $ hg commit -m "0.2" |
|
17 | $ hg commit -m "0.2" | |
18 | $ echo 3 >> afile |
|
18 | $ echo 3 >> afile | |
19 | $ hg commit -m "0.3" |
|
19 | $ hg commit -m "0.3" | |
20 | $ hg update -C 0 |
|
20 | $ hg update -C 0 | |
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | $ echo 1 >> afile |
|
22 | $ echo 1 >> afile | |
23 | $ hg commit -m "1.1" |
|
23 | $ hg commit -m "1.1" | |
24 | created new head |
|
24 | created new head | |
25 | $ echo 2 >> afile |
|
25 | $ echo 2 >> afile | |
26 | $ hg commit -m "1.2" |
|
26 | $ hg commit -m "1.2" | |
27 | $ echo "a line" > fred |
|
27 | $ echo "a line" > fred | |
28 | $ echo 3 >> afile |
|
28 | $ echo 3 >> afile | |
29 | $ hg add fred |
|
29 | $ hg add fred | |
30 | $ hg commit -m "1.3" |
|
30 | $ hg commit -m "1.3" | |
31 | $ hg mv afile adifferentfile |
|
31 | $ hg mv afile adifferentfile | |
32 | $ hg commit -m "1.3m" |
|
32 | $ hg commit -m "1.3m" | |
33 | $ hg update -C 3 |
|
33 | $ hg update -C 3 | |
34 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
34 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
35 | $ hg mv afile anotherfile |
|
35 | $ hg mv afile anotherfile | |
36 | $ hg commit -m "0.3m" |
|
36 | $ hg commit -m "0.3m" | |
37 | $ hg verify |
|
37 | $ hg verify | |
38 | checking changesets |
|
38 | checking changesets | |
39 | checking manifests |
|
39 | checking manifests | |
40 | crosschecking files in changesets and manifests |
|
40 | crosschecking files in changesets and manifests | |
41 | checking files |
|
41 | checking files | |
42 | 4 files, 9 changesets, 7 total revisions |
|
42 | 4 files, 9 changesets, 7 total revisions | |
43 | $ cd .. |
|
43 | $ cd .. | |
44 | $ hg init empty |
|
44 | $ hg init empty | |
45 |
|
45 | |||
46 | Bundle and phase |
|
46 | Bundle and phase | |
47 |
|
47 | |||
48 | $ hg -R test phase --force --secret 0 |
|
48 | $ hg -R test phase --force --secret 0 | |
49 | $ hg -R test bundle phase.hg empty |
|
49 | $ hg -R test bundle phase.hg empty | |
50 | searching for changes |
|
50 | searching for changes | |
51 | no changes found (ignored 9 secret changesets) |
|
51 | no changes found (ignored 9 secret changesets) | |
52 | [1] |
|
52 | [1] | |
53 | $ hg -R test phase --draft -r 'head()' |
|
53 | $ hg -R test phase --draft -r 'head()' | |
54 |
|
54 | |||
55 | Bundle --all |
|
55 | Bundle --all | |
56 |
|
56 | |||
57 | $ hg -R test bundle --all all.hg |
|
57 | $ hg -R test bundle --all all.hg | |
58 | 9 changesets found |
|
58 | 9 changesets found | |
59 |
|
59 | |||
60 | Bundle test to full.hg |
|
60 | Bundle test to full.hg | |
61 |
|
61 | |||
62 | $ hg -R test bundle full.hg empty |
|
62 | $ hg -R test bundle full.hg empty | |
63 | searching for changes |
|
63 | searching for changes | |
64 | 9 changesets found |
|
64 | 9 changesets found | |
65 |
|
65 | |||
66 | Unbundle full.hg in test |
|
66 | Unbundle full.hg in test | |
67 |
|
67 | |||
68 | $ hg -R test unbundle full.hg |
|
68 | $ hg -R test unbundle full.hg | |
69 | adding changesets |
|
69 | adding changesets | |
70 | adding manifests |
|
70 | adding manifests | |
71 | adding file changes |
|
71 | adding file changes | |
72 | added 0 changesets with 0 changes to 4 files |
|
72 | added 0 changesets with 0 changes to 4 files | |
73 | (run 'hg update' to get a working copy) |
|
73 | (run 'hg update' to get a working copy) | |
74 |
|
74 | |||
75 | Verify empty |
|
75 | Verify empty | |
76 |
|
76 | |||
77 | $ hg -R empty heads |
|
77 | $ hg -R empty heads | |
78 | [1] |
|
78 | [1] | |
79 | $ hg -R empty verify |
|
79 | $ hg -R empty verify | |
80 | checking changesets |
|
80 | checking changesets | |
81 | checking manifests |
|
81 | checking manifests | |
82 | crosschecking files in changesets and manifests |
|
82 | crosschecking files in changesets and manifests | |
83 | checking files |
|
83 | checking files | |
84 | 0 files, 0 changesets, 0 total revisions |
|
84 | 0 files, 0 changesets, 0 total revisions | |
85 |
|
85 | |||
86 | Pull full.hg into test (using --cwd) |
|
86 | Pull full.hg into test (using --cwd) | |
87 |
|
87 | |||
88 | $ hg --cwd test pull ../full.hg |
|
88 | $ hg --cwd test pull ../full.hg | |
89 | pulling from ../full.hg |
|
89 | pulling from ../full.hg | |
90 | searching for changes |
|
90 | searching for changes | |
91 | no changes found |
|
91 | no changes found | |
92 |
|
92 | |||
93 | Verify that there are no leaked temporary files after pull (issue2797) |
|
93 | Verify that there are no leaked temporary files after pull (issue2797) | |
94 |
|
94 | |||
95 | $ ls test/.hg | grep .hg10un |
|
95 | $ ls test/.hg | grep .hg10un | |
96 | [1] |
|
96 | [1] | |
97 |
|
97 | |||
98 | Pull full.hg into empty (using --cwd) |
|
98 | Pull full.hg into empty (using --cwd) | |
99 |
|
99 | |||
100 | $ hg --cwd empty pull ../full.hg |
|
100 | $ hg --cwd empty pull ../full.hg | |
101 | pulling from ../full.hg |
|
101 | pulling from ../full.hg | |
102 | requesting all changes |
|
102 | requesting all changes | |
103 | adding changesets |
|
103 | adding changesets | |
104 | adding manifests |
|
104 | adding manifests | |
105 | adding file changes |
|
105 | adding file changes | |
106 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
106 | added 9 changesets with 7 changes to 4 files (+1 heads) | |
107 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
107 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
108 |
|
108 | |||
109 | Rollback empty |
|
109 | Rollback empty | |
110 |
|
110 | |||
111 | $ hg -R empty rollback |
|
111 | $ hg -R empty rollback | |
112 | repository tip rolled back to revision -1 (undo pull) |
|
112 | repository tip rolled back to revision -1 (undo pull) | |
113 |
|
113 | |||
114 | Pull full.hg into empty again (using --cwd) |
|
114 | Pull full.hg into empty again (using --cwd) | |
115 |
|
115 | |||
116 | $ hg --cwd empty pull ../full.hg |
|
116 | $ hg --cwd empty pull ../full.hg | |
117 | pulling from ../full.hg |
|
117 | pulling from ../full.hg | |
118 | requesting all changes |
|
118 | requesting all changes | |
119 | adding changesets |
|
119 | adding changesets | |
120 | adding manifests |
|
120 | adding manifests | |
121 | adding file changes |
|
121 | adding file changes | |
122 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
122 | added 9 changesets with 7 changes to 4 files (+1 heads) | |
123 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
123 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
124 |
|
124 | |||
125 | Pull full.hg into test (using -R) |
|
125 | Pull full.hg into test (using -R) | |
126 |
|
126 | |||
127 | $ hg -R test pull full.hg |
|
127 | $ hg -R test pull full.hg | |
128 | pulling from full.hg |
|
128 | pulling from full.hg | |
129 | searching for changes |
|
129 | searching for changes | |
130 | no changes found |
|
130 | no changes found | |
131 |
|
131 | |||
132 | Pull full.hg into empty (using -R) |
|
132 | Pull full.hg into empty (using -R) | |
133 |
|
133 | |||
134 | $ hg -R empty pull full.hg |
|
134 | $ hg -R empty pull full.hg | |
135 | pulling from full.hg |
|
135 | pulling from full.hg | |
136 | searching for changes |
|
136 | searching for changes | |
137 | no changes found |
|
137 | no changes found | |
138 |
|
138 | |||
139 | Rollback empty |
|
139 | Rollback empty | |
140 |
|
140 | |||
141 | $ hg -R empty rollback |
|
141 | $ hg -R empty rollback | |
142 | repository tip rolled back to revision -1 (undo pull) |
|
142 | repository tip rolled back to revision -1 (undo pull) | |
143 |
|
143 | |||
144 | Pull full.hg into empty again (using -R) |
|
144 | Pull full.hg into empty again (using -R) | |
145 |
|
145 | |||
146 | $ hg -R empty pull full.hg |
|
146 | $ hg -R empty pull full.hg | |
147 | pulling from full.hg |
|
147 | pulling from full.hg | |
148 | requesting all changes |
|
148 | requesting all changes | |
149 | adding changesets |
|
149 | adding changesets | |
150 | adding manifests |
|
150 | adding manifests | |
151 | adding file changes |
|
151 | adding file changes | |
152 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
152 | added 9 changesets with 7 changes to 4 files (+1 heads) | |
153 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
153 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
154 |
|
154 | |||
155 | Log -R full.hg in fresh empty |
|
155 | Log -R full.hg in fresh empty | |
156 |
|
156 | |||
157 | $ rm -r empty |
|
157 | $ rm -r empty | |
158 | $ hg init empty |
|
158 | $ hg init empty | |
159 | $ cd empty |
|
159 | $ cd empty | |
160 | $ hg -R bundle://../full.hg log |
|
160 | $ hg -R bundle://../full.hg log | |
161 | changeset: 8:aa35859c02ea |
|
161 | changeset: 8:aa35859c02ea | |
162 | tag: tip |
|
162 | tag: tip | |
163 | parent: 3:eebf5a27f8ca |
|
163 | parent: 3:eebf5a27f8ca | |
164 | user: test |
|
164 | user: test | |
165 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
165 | date: Thu Jan 01 00:00:00 1970 +0000 | |
166 | summary: 0.3m |
|
166 | summary: 0.3m | |
167 |
|
167 | |||
168 | changeset: 7:a6a34bfa0076 |
|
168 | changeset: 7:a6a34bfa0076 | |
169 | user: test |
|
169 | user: test | |
170 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | date: Thu Jan 01 00:00:00 1970 +0000 | |
171 | summary: 1.3m |
|
171 | summary: 1.3m | |
172 |
|
172 | |||
173 | changeset: 6:7373c1169842 |
|
173 | changeset: 6:7373c1169842 | |
174 | user: test |
|
174 | user: test | |
175 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
175 | date: Thu Jan 01 00:00:00 1970 +0000 | |
176 | summary: 1.3 |
|
176 | summary: 1.3 | |
177 |
|
177 | |||
178 | changeset: 5:1bb50a9436a7 |
|
178 | changeset: 5:1bb50a9436a7 | |
179 | user: test |
|
179 | user: test | |
180 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
180 | date: Thu Jan 01 00:00:00 1970 +0000 | |
181 | summary: 1.2 |
|
181 | summary: 1.2 | |
182 |
|
182 | |||
183 | changeset: 4:095197eb4973 |
|
183 | changeset: 4:095197eb4973 | |
184 | parent: 0:f9ee2f85a263 |
|
184 | parent: 0:f9ee2f85a263 | |
185 | user: test |
|
185 | user: test | |
186 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
186 | date: Thu Jan 01 00:00:00 1970 +0000 | |
187 | summary: 1.1 |
|
187 | summary: 1.1 | |
188 |
|
188 | |||
189 | changeset: 3:eebf5a27f8ca |
|
189 | changeset: 3:eebf5a27f8ca | |
190 | user: test |
|
190 | user: test | |
191 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
191 | date: Thu Jan 01 00:00:00 1970 +0000 | |
192 | summary: 0.3 |
|
192 | summary: 0.3 | |
193 |
|
193 | |||
194 | changeset: 2:e38ba6f5b7e0 |
|
194 | changeset: 2:e38ba6f5b7e0 | |
195 | user: test |
|
195 | user: test | |
196 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
196 | date: Thu Jan 01 00:00:00 1970 +0000 | |
197 | summary: 0.2 |
|
197 | summary: 0.2 | |
198 |
|
198 | |||
199 | changeset: 1:34c2bf6b0626 |
|
199 | changeset: 1:34c2bf6b0626 | |
200 | user: test |
|
200 | user: test | |
201 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
201 | date: Thu Jan 01 00:00:00 1970 +0000 | |
202 | summary: 0.1 |
|
202 | summary: 0.1 | |
203 |
|
203 | |||
204 | changeset: 0:f9ee2f85a263 |
|
204 | changeset: 0:f9ee2f85a263 | |
205 | user: test |
|
205 | user: test | |
206 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
206 | date: Thu Jan 01 00:00:00 1970 +0000 | |
207 | summary: 0.0 |
|
207 | summary: 0.0 | |
208 |
|
208 | |||
209 | Make sure bundlerepo doesn't leak tempfiles (issue2491) |
|
209 | Make sure bundlerepo doesn't leak tempfiles (issue2491) | |
210 |
|
210 | |||
211 | $ ls .hg |
|
211 | $ ls .hg | |
212 | 00changelog.i |
|
212 | 00changelog.i | |
213 | cache |
|
213 | cache | |
214 | requires |
|
214 | requires | |
215 | store |
|
215 | store | |
216 |
|
216 | |||
217 | Pull ../full.hg into empty (with hook) |
|
217 | Pull ../full.hg into empty (with hook) | |
218 |
|
218 | |||
219 | $ cat >> .hg/hgrc <<EOF |
|
219 | $ cat >> .hg/hgrc <<EOF | |
220 | > [hooks] |
|
220 | > [hooks] | |
221 | > changegroup = sh -c "printenv.py changegroup" |
|
221 | > changegroup = sh -c "printenv.py changegroup" | |
222 | > EOF |
|
222 | > EOF | |
223 |
|
223 | |||
224 | doesn't work (yet ?) |
|
224 | doesn't work (yet ?) | |
225 |
|
225 | |||
226 | hg -R bundle://../full.hg verify |
|
226 | hg -R bundle://../full.hg verify | |
227 |
|
227 | |||
228 | $ hg pull bundle://../full.hg |
|
228 | $ hg pull bundle://../full.hg | |
229 | pulling from bundle:../full.hg |
|
229 | pulling from bundle:../full.hg | |
230 | requesting all changes |
|
230 | requesting all changes | |
231 | adding changesets |
|
231 | adding changesets | |
232 | adding manifests |
|
232 | adding manifests | |
233 | adding file changes |
|
233 | adding file changes | |
234 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
234 | added 9 changesets with 7 changes to 4 files (+1 heads) | |
235 | changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:../full.hg |
|
235 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:../full.hg | |
236 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
236 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
237 |
|
237 | |||
238 | Rollback empty |
|
238 | Rollback empty | |
239 |
|
239 | |||
240 | $ hg rollback |
|
240 | $ hg rollback | |
241 | repository tip rolled back to revision -1 (undo pull) |
|
241 | repository tip rolled back to revision -1 (undo pull) | |
242 | $ cd .. |
|
242 | $ cd .. | |
243 |
|
243 | |||
244 | Log -R bundle:empty+full.hg |
|
244 | Log -R bundle:empty+full.hg | |
245 |
|
245 | |||
246 | $ hg -R bundle:empty+full.hg log --template="{rev} "; echo "" |
|
246 | $ hg -R bundle:empty+full.hg log --template="{rev} "; echo "" | |
247 | 8 7 6 5 4 3 2 1 0 |
|
247 | 8 7 6 5 4 3 2 1 0 | |
248 |
|
248 | |||
249 | Pull full.hg into empty again (using -R; with hook) |
|
249 | Pull full.hg into empty again (using -R; with hook) | |
250 |
|
250 | |||
251 | $ hg -R empty pull full.hg |
|
251 | $ hg -R empty pull full.hg | |
252 | pulling from full.hg |
|
252 | pulling from full.hg | |
253 | requesting all changes |
|
253 | requesting all changes | |
254 | adding changesets |
|
254 | adding changesets | |
255 | adding manifests |
|
255 | adding manifests | |
256 | adding file changes |
|
256 | adding file changes | |
257 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
257 | added 9 changesets with 7 changes to 4 files (+1 heads) | |
258 | changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:empty+full.hg |
|
258 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:empty+full.hg | |
259 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
259 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
260 |
|
260 | |||
261 | Cannot produce streaming clone bundles with "hg bundle" |
|
261 | Cannot produce streaming clone bundles with "hg bundle" | |
262 |
|
262 | |||
263 | $ hg -R test bundle -t packed1 packed.hg |
|
263 | $ hg -R test bundle -t packed1 packed.hg | |
264 | abort: packed bundles cannot be produced by "hg bundle" |
|
264 | abort: packed bundles cannot be produced by "hg bundle" | |
265 | (use 'hg debugcreatestreamclonebundle') |
|
265 | (use 'hg debugcreatestreamclonebundle') | |
266 | [255] |
|
266 | [255] | |
267 |
|
267 | |||
268 | packed1 is produced properly |
|
268 | packed1 is produced properly | |
269 |
|
269 | |||
270 | $ hg -R test debugcreatestreamclonebundle packed.hg |
|
270 | $ hg -R test debugcreatestreamclonebundle packed.hg | |
271 | writing 2664 bytes for 6 files |
|
271 | writing 2664 bytes for 6 files | |
272 | bundle requirements: generaldelta, revlogv1 |
|
272 | bundle requirements: generaldelta, revlogv1 | |
273 |
|
273 | |||
274 | $ f -B 64 --size --sha1 --hexdump packed.hg |
|
274 | $ f -B 64 --size --sha1 --hexdump packed.hg | |
275 | packed.hg: size=2827, sha1=9d14cb90c66a21462d915ab33656f38b9deed686 |
|
275 | packed.hg: size=2827, sha1=9d14cb90c66a21462d915ab33656f38b9deed686 | |
276 | 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........| |
|
276 | 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........| | |
277 | 0010: 00 00 00 00 0a 68 00 16 67 65 6e 65 72 61 6c 64 |.....h..generald| |
|
277 | 0010: 00 00 00 00 0a 68 00 16 67 65 6e 65 72 61 6c 64 |.....h..generald| | |
278 | 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da| |
|
278 | 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da| | |
279 | 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil| |
|
279 | 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil| | |
280 |
|
280 | |||
281 | $ hg debugbundle --spec packed.hg |
|
281 | $ hg debugbundle --spec packed.hg | |
282 | none-packed1;requirements%3Dgeneraldelta%2Crevlogv1 |
|
282 | none-packed1;requirements%3Dgeneraldelta%2Crevlogv1 | |
283 |
|
283 | |||
284 | generaldelta requirement is not listed in stream clone bundles unless used |
|
284 | generaldelta requirement is not listed in stream clone bundles unless used | |
285 |
|
285 | |||
286 | $ hg --config format.usegeneraldelta=false init testnongd |
|
286 | $ hg --config format.usegeneraldelta=false init testnongd | |
287 | $ cd testnongd |
|
287 | $ cd testnongd | |
288 | $ touch foo |
|
288 | $ touch foo | |
289 | $ hg -q commit -A -m initial |
|
289 | $ hg -q commit -A -m initial | |
290 | $ cd .. |
|
290 | $ cd .. | |
291 | $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg |
|
291 | $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg | |
292 | writing 301 bytes for 3 files |
|
292 | writing 301 bytes for 3 files | |
293 | bundle requirements: revlogv1 |
|
293 | bundle requirements: revlogv1 | |
294 |
|
294 | |||
295 | $ f -B 64 --size --sha1 --hexdump packednongd.hg |
|
295 | $ f -B 64 --size --sha1 --hexdump packednongd.hg | |
296 | packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f |
|
296 | packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f | |
297 | 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........| |
|
297 | 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........| | |
298 | 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1| |
|
298 | 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1| | |
299 | 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..| |
|
299 | 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..| | |
300 | 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
300 | 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |
301 |
|
301 | |||
302 | $ hg debugbundle --spec packednongd.hg |
|
302 | $ hg debugbundle --spec packednongd.hg | |
303 | none-packed1;requirements%3Drevlogv1 |
|
303 | none-packed1;requirements%3Drevlogv1 | |
304 |
|
304 | |||
305 | Unpacking packed1 bundles with "hg unbundle" isn't allowed |
|
305 | Unpacking packed1 bundles with "hg unbundle" isn't allowed | |
306 |
|
306 | |||
307 | $ hg init packed |
|
307 | $ hg init packed | |
308 | $ hg -R packed unbundle packed.hg |
|
308 | $ hg -R packed unbundle packed.hg | |
309 | abort: packed bundles cannot be applied with "hg unbundle" |
|
309 | abort: packed bundles cannot be applied with "hg unbundle" | |
310 | (use "hg debugapplystreamclonebundle") |
|
310 | (use "hg debugapplystreamclonebundle") | |
311 | [255] |
|
311 | [255] | |
312 |
|
312 | |||
313 | packed1 can be consumed from debug command |
|
313 | packed1 can be consumed from debug command | |
314 |
|
314 | |||
315 | (this also confirms that streamclone-ed changes are visible via |
|
315 | (this also confirms that streamclone-ed changes are visible via | |
316 | @filecache properties to in-process procedures before closing |
|
316 | @filecache properties to in-process procedures before closing | |
317 | transaction) |
|
317 | transaction) | |
318 |
|
318 | |||
319 | $ cat > $TESTTMP/showtip.py <<EOF |
|
319 | $ cat > $TESTTMP/showtip.py <<EOF | |
320 | > from __future__ import absolute_import |
|
320 | > from __future__ import absolute_import | |
321 | > |
|
321 | > | |
322 | > def showtip(ui, repo, hooktype, **kwargs): |
|
322 | > def showtip(ui, repo, hooktype, **kwargs): | |
323 | > ui.warn('%s: %s\n' % (hooktype, repo['tip'].hex()[:12])) |
|
323 | > ui.warn('%s: %s\n' % (hooktype, repo['tip'].hex()[:12])) | |
324 | > |
|
324 | > | |
325 | > def reposetup(ui, repo): |
|
325 | > def reposetup(ui, repo): | |
326 | > # this confirms (and ensures) that (empty) 00changelog.i |
|
326 | > # this confirms (and ensures) that (empty) 00changelog.i | |
327 | > # before streamclone is already cached as repo.changelog |
|
327 | > # before streamclone is already cached as repo.changelog | |
328 | > ui.setconfig('hooks', 'pretxnopen.showtip', showtip) |
|
328 | > ui.setconfig('hooks', 'pretxnopen.showtip', showtip) | |
329 | > |
|
329 | > | |
330 | > # this confirms that streamclone-ed changes are visible to |
|
330 | > # this confirms that streamclone-ed changes are visible to | |
331 | > # in-process procedures before closing transaction |
|
331 | > # in-process procedures before closing transaction | |
332 | > ui.setconfig('hooks', 'pretxnclose.showtip', showtip) |
|
332 | > ui.setconfig('hooks', 'pretxnclose.showtip', showtip) | |
333 | > |
|
333 | > | |
334 | > # this confirms that streamclone-ed changes are still visible |
|
334 | > # this confirms that streamclone-ed changes are still visible | |
335 | > # after closing transaction |
|
335 | > # after closing transaction | |
336 | > ui.setconfig('hooks', 'txnclose.showtip', showtip) |
|
336 | > ui.setconfig('hooks', 'txnclose.showtip', showtip) | |
337 | > EOF |
|
337 | > EOF | |
338 | $ cat >> $HGRCPATH <<EOF |
|
338 | $ cat >> $HGRCPATH <<EOF | |
339 | > [extensions] |
|
339 | > [extensions] | |
340 | > showtip = $TESTTMP/showtip.py |
|
340 | > showtip = $TESTTMP/showtip.py | |
341 | > EOF |
|
341 | > EOF | |
342 |
|
342 | |||
343 | $ hg -R packed debugapplystreamclonebundle packed.hg |
|
343 | $ hg -R packed debugapplystreamclonebundle packed.hg | |
344 | 6 files to transfer, 2.60 KB of data |
|
344 | 6 files to transfer, 2.60 KB of data | |
345 | pretxnopen: 000000000000 |
|
345 | pretxnopen: 000000000000 | |
346 | pretxnclose: aa35859c02ea |
|
346 | pretxnclose: aa35859c02ea | |
347 | transferred 2.60 KB in *.* seconds (* */sec) (glob) |
|
347 | transferred 2.60 KB in *.* seconds (* */sec) (glob) | |
348 | txnclose: aa35859c02ea |
|
348 | txnclose: aa35859c02ea | |
349 |
|
349 | |||
350 | (for safety, confirm visibility of streamclone-ed changes by another |
|
350 | (for safety, confirm visibility of streamclone-ed changes by another | |
351 | process, too) |
|
351 | process, too) | |
352 |
|
352 | |||
353 | $ hg -R packed tip -T "{node|short}\n" |
|
353 | $ hg -R packed tip -T "{node|short}\n" | |
354 | aa35859c02ea |
|
354 | aa35859c02ea | |
355 |
|
355 | |||
356 | $ cat >> $HGRCPATH <<EOF |
|
356 | $ cat >> $HGRCPATH <<EOF | |
357 | > [extensions] |
|
357 | > [extensions] | |
358 | > showtip = ! |
|
358 | > showtip = ! | |
359 | > EOF |
|
359 | > EOF | |
360 |
|
360 | |||
361 | Does not work on non-empty repo |
|
361 | Does not work on non-empty repo | |
362 |
|
362 | |||
363 | $ hg -R packed debugapplystreamclonebundle packed.hg |
|
363 | $ hg -R packed debugapplystreamclonebundle packed.hg | |
364 | abort: cannot apply stream clone bundle on non-empty repo |
|
364 | abort: cannot apply stream clone bundle on non-empty repo | |
365 | [255] |
|
365 | [255] | |
366 |
|
366 | |||
367 | Create partial clones |
|
367 | Create partial clones | |
368 |
|
368 | |||
369 | $ rm -r empty |
|
369 | $ rm -r empty | |
370 | $ hg init empty |
|
370 | $ hg init empty | |
371 | $ hg clone -r 3 test partial |
|
371 | $ hg clone -r 3 test partial | |
372 | adding changesets |
|
372 | adding changesets | |
373 | adding manifests |
|
373 | adding manifests | |
374 | adding file changes |
|
374 | adding file changes | |
375 | added 4 changesets with 4 changes to 1 files |
|
375 | added 4 changesets with 4 changes to 1 files | |
376 | updating to branch default |
|
376 | updating to branch default | |
377 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
377 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
378 | $ hg clone partial partial2 |
|
378 | $ hg clone partial partial2 | |
379 | updating to branch default |
|
379 | updating to branch default | |
380 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
380 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
381 | $ cd partial |
|
381 | $ cd partial | |
382 |
|
382 | |||
383 | Log -R full.hg in partial |
|
383 | Log -R full.hg in partial | |
384 |
|
384 | |||
385 | $ hg -R bundle://../full.hg log -T phases |
|
385 | $ hg -R bundle://../full.hg log -T phases | |
386 | changeset: 8:aa35859c02ea |
|
386 | changeset: 8:aa35859c02ea | |
387 | tag: tip |
|
387 | tag: tip | |
388 | phase: draft |
|
388 | phase: draft | |
389 | parent: 3:eebf5a27f8ca |
|
389 | parent: 3:eebf5a27f8ca | |
390 | user: test |
|
390 | user: test | |
391 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
391 | date: Thu Jan 01 00:00:00 1970 +0000 | |
392 | summary: 0.3m |
|
392 | summary: 0.3m | |
393 |
|
393 | |||
394 | changeset: 7:a6a34bfa0076 |
|
394 | changeset: 7:a6a34bfa0076 | |
395 | phase: draft |
|
395 | phase: draft | |
396 | user: test |
|
396 | user: test | |
397 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
397 | date: Thu Jan 01 00:00:00 1970 +0000 | |
398 | summary: 1.3m |
|
398 | summary: 1.3m | |
399 |
|
399 | |||
400 | changeset: 6:7373c1169842 |
|
400 | changeset: 6:7373c1169842 | |
401 | phase: draft |
|
401 | phase: draft | |
402 | user: test |
|
402 | user: test | |
403 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
403 | date: Thu Jan 01 00:00:00 1970 +0000 | |
404 | summary: 1.3 |
|
404 | summary: 1.3 | |
405 |
|
405 | |||
406 | changeset: 5:1bb50a9436a7 |
|
406 | changeset: 5:1bb50a9436a7 | |
407 | phase: draft |
|
407 | phase: draft | |
408 | user: test |
|
408 | user: test | |
409 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 | date: Thu Jan 01 00:00:00 1970 +0000 | |
410 | summary: 1.2 |
|
410 | summary: 1.2 | |
411 |
|
411 | |||
412 | changeset: 4:095197eb4973 |
|
412 | changeset: 4:095197eb4973 | |
413 | phase: draft |
|
413 | phase: draft | |
414 | parent: 0:f9ee2f85a263 |
|
414 | parent: 0:f9ee2f85a263 | |
415 | user: test |
|
415 | user: test | |
416 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
416 | date: Thu Jan 01 00:00:00 1970 +0000 | |
417 | summary: 1.1 |
|
417 | summary: 1.1 | |
418 |
|
418 | |||
419 | changeset: 3:eebf5a27f8ca |
|
419 | changeset: 3:eebf5a27f8ca | |
420 | phase: public |
|
420 | phase: public | |
421 | user: test |
|
421 | user: test | |
422 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
422 | date: Thu Jan 01 00:00:00 1970 +0000 | |
423 | summary: 0.3 |
|
423 | summary: 0.3 | |
424 |
|
424 | |||
425 | changeset: 2:e38ba6f5b7e0 |
|
425 | changeset: 2:e38ba6f5b7e0 | |
426 | phase: public |
|
426 | phase: public | |
427 | user: test |
|
427 | user: test | |
428 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
428 | date: Thu Jan 01 00:00:00 1970 +0000 | |
429 | summary: 0.2 |
|
429 | summary: 0.2 | |
430 |
|
430 | |||
431 | changeset: 1:34c2bf6b0626 |
|
431 | changeset: 1:34c2bf6b0626 | |
432 | phase: public |
|
432 | phase: public | |
433 | user: test |
|
433 | user: test | |
434 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
434 | date: Thu Jan 01 00:00:00 1970 +0000 | |
435 | summary: 0.1 |
|
435 | summary: 0.1 | |
436 |
|
436 | |||
437 | changeset: 0:f9ee2f85a263 |
|
437 | changeset: 0:f9ee2f85a263 | |
438 | phase: public |
|
438 | phase: public | |
439 | user: test |
|
439 | user: test | |
440 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
440 | date: Thu Jan 01 00:00:00 1970 +0000 | |
441 | summary: 0.0 |
|
441 | summary: 0.0 | |
442 |
|
442 | |||
443 |
|
443 | |||
444 | Incoming full.hg in partial |
|
444 | Incoming full.hg in partial | |
445 |
|
445 | |||
446 | $ hg incoming bundle://../full.hg |
|
446 | $ hg incoming bundle://../full.hg | |
447 | comparing with bundle:../full.hg |
|
447 | comparing with bundle:../full.hg | |
448 | searching for changes |
|
448 | searching for changes | |
449 | changeset: 4:095197eb4973 |
|
449 | changeset: 4:095197eb4973 | |
450 | parent: 0:f9ee2f85a263 |
|
450 | parent: 0:f9ee2f85a263 | |
451 | user: test |
|
451 | user: test | |
452 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
452 | date: Thu Jan 01 00:00:00 1970 +0000 | |
453 | summary: 1.1 |
|
453 | summary: 1.1 | |
454 |
|
454 | |||
455 | changeset: 5:1bb50a9436a7 |
|
455 | changeset: 5:1bb50a9436a7 | |
456 | user: test |
|
456 | user: test | |
457 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
457 | date: Thu Jan 01 00:00:00 1970 +0000 | |
458 | summary: 1.2 |
|
458 | summary: 1.2 | |
459 |
|
459 | |||
460 | changeset: 6:7373c1169842 |
|
460 | changeset: 6:7373c1169842 | |
461 | user: test |
|
461 | user: test | |
462 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
462 | date: Thu Jan 01 00:00:00 1970 +0000 | |
463 | summary: 1.3 |
|
463 | summary: 1.3 | |
464 |
|
464 | |||
465 | changeset: 7:a6a34bfa0076 |
|
465 | changeset: 7:a6a34bfa0076 | |
466 | user: test |
|
466 | user: test | |
467 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
467 | date: Thu Jan 01 00:00:00 1970 +0000 | |
468 | summary: 1.3m |
|
468 | summary: 1.3m | |
469 |
|
469 | |||
470 | changeset: 8:aa35859c02ea |
|
470 | changeset: 8:aa35859c02ea | |
471 | tag: tip |
|
471 | tag: tip | |
472 | parent: 3:eebf5a27f8ca |
|
472 | parent: 3:eebf5a27f8ca | |
473 | user: test |
|
473 | user: test | |
474 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
474 | date: Thu Jan 01 00:00:00 1970 +0000 | |
475 | summary: 0.3m |
|
475 | summary: 0.3m | |
476 |
|
476 | |||
477 |
|
477 | |||
478 | Outgoing -R full.hg vs partial2 in partial |
|
478 | Outgoing -R full.hg vs partial2 in partial | |
479 |
|
479 | |||
480 | $ hg -R bundle://../full.hg outgoing ../partial2 |
|
480 | $ hg -R bundle://../full.hg outgoing ../partial2 | |
481 | comparing with ../partial2 |
|
481 | comparing with ../partial2 | |
482 | searching for changes |
|
482 | searching for changes | |
483 | changeset: 4:095197eb4973 |
|
483 | changeset: 4:095197eb4973 | |
484 | parent: 0:f9ee2f85a263 |
|
484 | parent: 0:f9ee2f85a263 | |
485 | user: test |
|
485 | user: test | |
486 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
486 | date: Thu Jan 01 00:00:00 1970 +0000 | |
487 | summary: 1.1 |
|
487 | summary: 1.1 | |
488 |
|
488 | |||
489 | changeset: 5:1bb50a9436a7 |
|
489 | changeset: 5:1bb50a9436a7 | |
490 | user: test |
|
490 | user: test | |
491 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
491 | date: Thu Jan 01 00:00:00 1970 +0000 | |
492 | summary: 1.2 |
|
492 | summary: 1.2 | |
493 |
|
493 | |||
494 | changeset: 6:7373c1169842 |
|
494 | changeset: 6:7373c1169842 | |
495 | user: test |
|
495 | user: test | |
496 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
496 | date: Thu Jan 01 00:00:00 1970 +0000 | |
497 | summary: 1.3 |
|
497 | summary: 1.3 | |
498 |
|
498 | |||
499 | changeset: 7:a6a34bfa0076 |
|
499 | changeset: 7:a6a34bfa0076 | |
500 | user: test |
|
500 | user: test | |
501 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
501 | date: Thu Jan 01 00:00:00 1970 +0000 | |
502 | summary: 1.3m |
|
502 | summary: 1.3m | |
503 |
|
503 | |||
504 | changeset: 8:aa35859c02ea |
|
504 | changeset: 8:aa35859c02ea | |
505 | tag: tip |
|
505 | tag: tip | |
506 | parent: 3:eebf5a27f8ca |
|
506 | parent: 3:eebf5a27f8ca | |
507 | user: test |
|
507 | user: test | |
508 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
508 | date: Thu Jan 01 00:00:00 1970 +0000 | |
509 | summary: 0.3m |
|
509 | summary: 0.3m | |
510 |
|
510 | |||
511 |
|
511 | |||
512 | Outgoing -R does-not-exist.hg vs partial2 in partial |
|
512 | Outgoing -R does-not-exist.hg vs partial2 in partial | |
513 |
|
513 | |||
514 | $ hg -R bundle://../does-not-exist.hg outgoing ../partial2 |
|
514 | $ hg -R bundle://../does-not-exist.hg outgoing ../partial2 | |
515 | abort: *../does-not-exist.hg* (glob) |
|
515 | abort: *../does-not-exist.hg* (glob) | |
516 | [255] |
|
516 | [255] | |
517 | $ cd .. |
|
517 | $ cd .. | |
518 |
|
518 | |||
519 | hide outer repo |
|
519 | hide outer repo | |
520 | $ hg init |
|
520 | $ hg init | |
521 |
|
521 | |||
522 | Direct clone from bundle (all-history) |
|
522 | Direct clone from bundle (all-history) | |
523 |
|
523 | |||
524 | $ hg clone full.hg full-clone |
|
524 | $ hg clone full.hg full-clone | |
525 | requesting all changes |
|
525 | requesting all changes | |
526 | adding changesets |
|
526 | adding changesets | |
527 | adding manifests |
|
527 | adding manifests | |
528 | adding file changes |
|
528 | adding file changes | |
529 | added 9 changesets with 7 changes to 4 files (+1 heads) |
|
529 | added 9 changesets with 7 changes to 4 files (+1 heads) | |
530 | updating to branch default |
|
530 | updating to branch default | |
531 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
531 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
532 | $ hg -R full-clone heads |
|
532 | $ hg -R full-clone heads | |
533 | changeset: 8:aa35859c02ea |
|
533 | changeset: 8:aa35859c02ea | |
534 | tag: tip |
|
534 | tag: tip | |
535 | parent: 3:eebf5a27f8ca |
|
535 | parent: 3:eebf5a27f8ca | |
536 | user: test |
|
536 | user: test | |
537 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
537 | date: Thu Jan 01 00:00:00 1970 +0000 | |
538 | summary: 0.3m |
|
538 | summary: 0.3m | |
539 |
|
539 | |||
540 | changeset: 7:a6a34bfa0076 |
|
540 | changeset: 7:a6a34bfa0076 | |
541 | user: test |
|
541 | user: test | |
542 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
542 | date: Thu Jan 01 00:00:00 1970 +0000 | |
543 | summary: 1.3m |
|
543 | summary: 1.3m | |
544 |
|
544 | |||
545 | $ rm -r full-clone |
|
545 | $ rm -r full-clone | |
546 |
|
546 | |||
547 | When cloning from a non-copiable repository into '', do not |
|
547 | When cloning from a non-copiable repository into '', do not | |
548 | recurse infinitely (issue2528) |
|
548 | recurse infinitely (issue2528) | |
549 |
|
549 | |||
550 | $ hg clone full.hg '' |
|
550 | $ hg clone full.hg '' | |
551 | abort: empty destination path is not valid |
|
551 | abort: empty destination path is not valid | |
552 | [255] |
|
552 | [255] | |
553 |
|
553 | |||
554 | test for https://bz.mercurial-scm.org/216 |
|
554 | test for https://bz.mercurial-scm.org/216 | |
555 |
|
555 | |||
556 | Unbundle incremental bundles into fresh empty in one go |
|
556 | Unbundle incremental bundles into fresh empty in one go | |
557 |
|
557 | |||
558 | $ rm -r empty |
|
558 | $ rm -r empty | |
559 | $ hg init empty |
|
559 | $ hg init empty | |
560 | $ hg -R test bundle --base null -r 0 ../0.hg |
|
560 | $ hg -R test bundle --base null -r 0 ../0.hg | |
561 | 1 changesets found |
|
561 | 1 changesets found | |
562 | $ hg -R test bundle --base 0 -r 1 ../1.hg |
|
562 | $ hg -R test bundle --base 0 -r 1 ../1.hg | |
563 | 1 changesets found |
|
563 | 1 changesets found | |
564 | $ hg -R empty unbundle -u ../0.hg ../1.hg |
|
564 | $ hg -R empty unbundle -u ../0.hg ../1.hg | |
565 | adding changesets |
|
565 | adding changesets | |
566 | adding manifests |
|
566 | adding manifests | |
567 | adding file changes |
|
567 | adding file changes | |
568 | added 1 changesets with 1 changes to 1 files |
|
568 | added 1 changesets with 1 changes to 1 files | |
569 | adding changesets |
|
569 | adding changesets | |
570 | adding manifests |
|
570 | adding manifests | |
571 | adding file changes |
|
571 | adding file changes | |
572 | added 1 changesets with 1 changes to 1 files |
|
572 | added 1 changesets with 1 changes to 1 files | |
573 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
573 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
574 |
|
574 | |||
575 | View full contents of the bundle |
|
575 | View full contents of the bundle | |
576 | $ hg -R test bundle --base null -r 3 ../partial.hg |
|
576 | $ hg -R test bundle --base null -r 3 ../partial.hg | |
577 | 4 changesets found |
|
577 | 4 changesets found | |
578 | $ cd test |
|
578 | $ cd test | |
579 | $ hg -R ../../partial.hg log -r "bundle()" |
|
579 | $ hg -R ../../partial.hg log -r "bundle()" | |
580 | changeset: 0:f9ee2f85a263 |
|
580 | changeset: 0:f9ee2f85a263 | |
581 | user: test |
|
581 | user: test | |
582 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
582 | date: Thu Jan 01 00:00:00 1970 +0000 | |
583 | summary: 0.0 |
|
583 | summary: 0.0 | |
584 |
|
584 | |||
585 | changeset: 1:34c2bf6b0626 |
|
585 | changeset: 1:34c2bf6b0626 | |
586 | user: test |
|
586 | user: test | |
587 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
587 | date: Thu Jan 01 00:00:00 1970 +0000 | |
588 | summary: 0.1 |
|
588 | summary: 0.1 | |
589 |
|
589 | |||
590 | changeset: 2:e38ba6f5b7e0 |
|
590 | changeset: 2:e38ba6f5b7e0 | |
591 | user: test |
|
591 | user: test | |
592 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
592 | date: Thu Jan 01 00:00:00 1970 +0000 | |
593 | summary: 0.2 |
|
593 | summary: 0.2 | |
594 |
|
594 | |||
595 | changeset: 3:eebf5a27f8ca |
|
595 | changeset: 3:eebf5a27f8ca | |
596 | user: test |
|
596 | user: test | |
597 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
597 | date: Thu Jan 01 00:00:00 1970 +0000 | |
598 | summary: 0.3 |
|
598 | summary: 0.3 | |
599 |
|
599 | |||
600 | $ cd .. |
|
600 | $ cd .. | |
601 |
|
601 | |||
602 | test for 540d1059c802 |
|
602 | test for 540d1059c802 | |
603 |
|
603 | |||
604 | test for 540d1059c802 |
|
604 | test for 540d1059c802 | |
605 |
|
605 | |||
606 | $ hg init orig |
|
606 | $ hg init orig | |
607 | $ cd orig |
|
607 | $ cd orig | |
608 | $ echo foo > foo |
|
608 | $ echo foo > foo | |
609 | $ hg add foo |
|
609 | $ hg add foo | |
610 | $ hg ci -m 'add foo' |
|
610 | $ hg ci -m 'add foo' | |
611 |
|
611 | |||
612 | $ hg clone . ../copy |
|
612 | $ hg clone . ../copy | |
613 | updating to branch default |
|
613 | updating to branch default | |
614 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
614 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
615 | $ hg tag foo |
|
615 | $ hg tag foo | |
616 |
|
616 | |||
617 | $ cd ../copy |
|
617 | $ cd ../copy | |
618 | $ echo >> foo |
|
618 | $ echo >> foo | |
619 | $ hg ci -m 'change foo' |
|
619 | $ hg ci -m 'change foo' | |
620 | $ hg bundle ../bundle.hg ../orig |
|
620 | $ hg bundle ../bundle.hg ../orig | |
621 | searching for changes |
|
621 | searching for changes | |
622 | 1 changesets found |
|
622 | 1 changesets found | |
623 |
|
623 | |||
624 | $ cd ../orig |
|
624 | $ cd ../orig | |
625 | $ hg incoming ../bundle.hg |
|
625 | $ hg incoming ../bundle.hg | |
626 | comparing with ../bundle.hg |
|
626 | comparing with ../bundle.hg | |
627 | searching for changes |
|
627 | searching for changes | |
628 | changeset: 2:ed1b79f46b9a |
|
628 | changeset: 2:ed1b79f46b9a | |
629 | tag: tip |
|
629 | tag: tip | |
630 | parent: 0:bbd179dfa0a7 |
|
630 | parent: 0:bbd179dfa0a7 | |
631 | user: test |
|
631 | user: test | |
632 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
632 | date: Thu Jan 01 00:00:00 1970 +0000 | |
633 | summary: change foo |
|
633 | summary: change foo | |
634 |
|
634 | |||
635 | $ cd .. |
|
635 | $ cd .. | |
636 |
|
636 | |||
637 | test bundle with # in the filename (issue2154): |
|
637 | test bundle with # in the filename (issue2154): | |
638 |
|
638 | |||
639 | $ cp bundle.hg 'test#bundle.hg' |
|
639 | $ cp bundle.hg 'test#bundle.hg' | |
640 | $ cd orig |
|
640 | $ cd orig | |
641 | $ hg incoming '../test#bundle.hg' |
|
641 | $ hg incoming '../test#bundle.hg' | |
642 | comparing with ../test |
|
642 | comparing with ../test | |
643 | abort: unknown revision 'bundle.hg'! |
|
643 | abort: unknown revision 'bundle.hg'! | |
644 | [255] |
|
644 | [255] | |
645 |
|
645 | |||
646 | note that percent encoding is not handled: |
|
646 | note that percent encoding is not handled: | |
647 |
|
647 | |||
648 | $ hg incoming ../test%23bundle.hg |
|
648 | $ hg incoming ../test%23bundle.hg | |
649 | abort: repository ../test%23bundle.hg not found! |
|
649 | abort: repository ../test%23bundle.hg not found! | |
650 | [255] |
|
650 | [255] | |
651 | $ cd .. |
|
651 | $ cd .. | |
652 |
|
652 | |||
653 | test to bundle revisions on the newly created branch (issue3828): |
|
653 | test to bundle revisions on the newly created branch (issue3828): | |
654 |
|
654 | |||
655 | $ hg -q clone -U test test-clone |
|
655 | $ hg -q clone -U test test-clone | |
656 | $ cd test |
|
656 | $ cd test | |
657 |
|
657 | |||
658 | $ hg -q branch foo |
|
658 | $ hg -q branch foo | |
659 | $ hg commit -m "create foo branch" |
|
659 | $ hg commit -m "create foo branch" | |
660 | $ hg -q outgoing ../test-clone |
|
660 | $ hg -q outgoing ../test-clone | |
661 | 9:b4f5acb1ee27 |
|
661 | 9:b4f5acb1ee27 | |
662 | $ hg -q bundle --branch foo foo.hg ../test-clone |
|
662 | $ hg -q bundle --branch foo foo.hg ../test-clone | |
663 | $ hg -R foo.hg -q log -r "bundle()" |
|
663 | $ hg -R foo.hg -q log -r "bundle()" | |
664 | 9:b4f5acb1ee27 |
|
664 | 9:b4f5acb1ee27 | |
665 |
|
665 | |||
666 | $ cd .. |
|
666 | $ cd .. | |
667 |
|
667 | |||
668 | test for https://bz.mercurial-scm.org/1144 |
|
668 | test for https://bz.mercurial-scm.org/1144 | |
669 |
|
669 | |||
670 | test that verify bundle does not traceback |
|
670 | test that verify bundle does not traceback | |
671 |
|
671 | |||
672 | partial history bundle, fails w/ unknown parent |
|
672 | partial history bundle, fails w/ unknown parent | |
673 |
|
673 | |||
674 | $ hg -R bundle.hg verify |
|
674 | $ hg -R bundle.hg verify | |
675 | abort: 00changelog.i@bbd179dfa0a7: unknown parent! |
|
675 | abort: 00changelog.i@bbd179dfa0a7: unknown parent! | |
676 | [255] |
|
676 | [255] | |
677 |
|
677 | |||
678 | full history bundle, refuses to verify non-local repo |
|
678 | full history bundle, refuses to verify non-local repo | |
679 |
|
679 | |||
680 | $ hg -R all.hg verify |
|
680 | $ hg -R all.hg verify | |
681 | abort: cannot verify bundle or remote repos |
|
681 | abort: cannot verify bundle or remote repos | |
682 | [255] |
|
682 | [255] | |
683 |
|
683 | |||
684 | but, regular verify must continue to work |
|
684 | but, regular verify must continue to work | |
685 |
|
685 | |||
686 | $ hg -R orig verify |
|
686 | $ hg -R orig verify | |
687 | checking changesets |
|
687 | checking changesets | |
688 | checking manifests |
|
688 | checking manifests | |
689 | crosschecking files in changesets and manifests |
|
689 | crosschecking files in changesets and manifests | |
690 | checking files |
|
690 | checking files | |
691 | 2 files, 2 changesets, 2 total revisions |
|
691 | 2 files, 2 changesets, 2 total revisions | |
692 |
|
692 | |||
693 | diff against bundle |
|
693 | diff against bundle | |
694 |
|
694 | |||
695 | $ hg init b |
|
695 | $ hg init b | |
696 | $ cd b |
|
696 | $ cd b | |
697 | $ hg -R ../all.hg diff -r tip |
|
697 | $ hg -R ../all.hg diff -r tip | |
698 | diff -r aa35859c02ea anotherfile |
|
698 | diff -r aa35859c02ea anotherfile | |
699 | --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000 |
|
699 | --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000 | |
700 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
700 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
701 | @@ -1,4 +0,0 @@ |
|
701 | @@ -1,4 +0,0 @@ | |
702 | -0 |
|
702 | -0 | |
703 | -1 |
|
703 | -1 | |
704 | -2 |
|
704 | -2 | |
705 | -3 |
|
705 | -3 | |
706 | $ cd .. |
|
706 | $ cd .. | |
707 |
|
707 | |||
708 | bundle single branch |
|
708 | bundle single branch | |
709 |
|
709 | |||
710 | $ hg init branchy |
|
710 | $ hg init branchy | |
711 | $ cd branchy |
|
711 | $ cd branchy | |
712 | $ echo a >a |
|
712 | $ echo a >a | |
713 | $ echo x >x |
|
713 | $ echo x >x | |
714 | $ hg ci -Ama |
|
714 | $ hg ci -Ama | |
715 | adding a |
|
715 | adding a | |
716 | adding x |
|
716 | adding x | |
717 | $ echo c >c |
|
717 | $ echo c >c | |
718 | $ echo xx >x |
|
718 | $ echo xx >x | |
719 | $ hg ci -Amc |
|
719 | $ hg ci -Amc | |
720 | adding c |
|
720 | adding c | |
721 | $ echo c1 >c1 |
|
721 | $ echo c1 >c1 | |
722 | $ hg ci -Amc1 |
|
722 | $ hg ci -Amc1 | |
723 | adding c1 |
|
723 | adding c1 | |
724 | $ hg up 0 |
|
724 | $ hg up 0 | |
725 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
725 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
726 | $ echo b >b |
|
726 | $ echo b >b | |
727 | $ hg ci -Amb |
|
727 | $ hg ci -Amb | |
728 | adding b |
|
728 | adding b | |
729 | created new head |
|
729 | created new head | |
730 | $ echo b1 >b1 |
|
730 | $ echo b1 >b1 | |
731 | $ echo xx >x |
|
731 | $ echo xx >x | |
732 | $ hg ci -Amb1 |
|
732 | $ hg ci -Amb1 | |
733 | adding b1 |
|
733 | adding b1 | |
734 | $ hg clone -q -r2 . part |
|
734 | $ hg clone -q -r2 . part | |
735 |
|
735 | |||
736 | == bundling via incoming |
|
736 | == bundling via incoming | |
737 |
|
737 | |||
738 | $ hg in -R part --bundle incoming.hg --template "{node}\n" . |
|
738 | $ hg in -R part --bundle incoming.hg --template "{node}\n" . | |
739 | comparing with . |
|
739 | comparing with . | |
740 | searching for changes |
|
740 | searching for changes | |
741 | 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a |
|
741 | 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a | |
742 | 057f4db07f61970e1c11e83be79e9d08adc4dc31 |
|
742 | 057f4db07f61970e1c11e83be79e9d08adc4dc31 | |
743 |
|
743 | |||
744 | == bundling |
|
744 | == bundling | |
745 |
|
745 | |||
746 | $ hg bundle bundle.hg part --debug --config progress.debug=true |
|
746 | $ hg bundle bundle.hg part --debug --config progress.debug=true | |
747 | query 1; heads |
|
747 | query 1; heads | |
748 | searching for changes |
|
748 | searching for changes | |
749 | all remote heads known locally |
|
749 | all remote heads known locally | |
750 | 2 changesets found |
|
750 | 2 changesets found | |
751 | list of changesets: |
|
751 | list of changesets: | |
752 | 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a |
|
752 | 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a | |
753 | 057f4db07f61970e1c11e83be79e9d08adc4dc31 |
|
753 | 057f4db07f61970e1c11e83be79e9d08adc4dc31 | |
754 | bundle2-output-bundle: "HG20", (1 params) 1 parts total |
|
754 | bundle2-output-bundle: "HG20", (1 params) 1 parts total | |
755 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
|
755 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload | |
756 | bundling: 1/2 changesets (50.00%) |
|
756 | bundling: 1/2 changesets (50.00%) | |
757 | bundling: 2/2 changesets (100.00%) |
|
757 | bundling: 2/2 changesets (100.00%) | |
758 | bundling: 1/2 manifests (50.00%) |
|
758 | bundling: 1/2 manifests (50.00%) | |
759 | bundling: 2/2 manifests (100.00%) |
|
759 | bundling: 2/2 manifests (100.00%) | |
760 | bundling: b 1/3 files (33.33%) |
|
760 | bundling: b 1/3 files (33.33%) | |
761 | bundling: b1 2/3 files (66.67%) |
|
761 | bundling: b1 2/3 files (66.67%) | |
762 | bundling: x 3/3 files (100.00%) |
|
762 | bundling: x 3/3 files (100.00%) | |
763 |
|
763 | |||
764 | == Test for issue3441 |
|
764 | == Test for issue3441 | |
765 |
|
765 | |||
766 | $ hg clone -q -r0 . part2 |
|
766 | $ hg clone -q -r0 . part2 | |
767 | $ hg -q -R part2 pull bundle.hg |
|
767 | $ hg -q -R part2 pull bundle.hg | |
768 | $ hg -R part2 verify |
|
768 | $ hg -R part2 verify | |
769 | checking changesets |
|
769 | checking changesets | |
770 | checking manifests |
|
770 | checking manifests | |
771 | crosschecking files in changesets and manifests |
|
771 | crosschecking files in changesets and manifests | |
772 | checking files |
|
772 | checking files | |
773 | 4 files, 3 changesets, 5 total revisions |
|
773 | 4 files, 3 changesets, 5 total revisions | |
774 |
|
774 | |||
775 | == Test bundling no commits |
|
775 | == Test bundling no commits | |
776 |
|
776 | |||
777 | $ hg bundle -r 'public()' no-output.hg |
|
777 | $ hg bundle -r 'public()' no-output.hg | |
778 | abort: no commits to bundle |
|
778 | abort: no commits to bundle | |
779 | [255] |
|
779 | [255] | |
780 |
|
780 | |||
781 | $ cd .. |
|
781 | $ cd .. | |
782 |
|
782 | |||
783 | When user merges to the revision existing only in the bundle, |
|
783 | When user merges to the revision existing only in the bundle, | |
784 | it should show warning that second parent of the working |
|
784 | it should show warning that second parent of the working | |
785 | directory does not exist |
|
785 | directory does not exist | |
786 |
|
786 | |||
787 | $ hg init update2bundled |
|
787 | $ hg init update2bundled | |
788 | $ cd update2bundled |
|
788 | $ cd update2bundled | |
789 | $ cat <<EOF >> .hg/hgrc |
|
789 | $ cat <<EOF >> .hg/hgrc | |
790 | > [extensions] |
|
790 | > [extensions] | |
791 | > strip = |
|
791 | > strip = | |
792 | > EOF |
|
792 | > EOF | |
793 | $ echo "aaa" >> a |
|
793 | $ echo "aaa" >> a | |
794 | $ hg commit -A -m 0 |
|
794 | $ hg commit -A -m 0 | |
795 | adding a |
|
795 | adding a | |
796 | $ echo "bbb" >> b |
|
796 | $ echo "bbb" >> b | |
797 | $ hg commit -A -m 1 |
|
797 | $ hg commit -A -m 1 | |
798 | adding b |
|
798 | adding b | |
799 | $ echo "ccc" >> c |
|
799 | $ echo "ccc" >> c | |
800 | $ hg commit -A -m 2 |
|
800 | $ hg commit -A -m 2 | |
801 | adding c |
|
801 | adding c | |
802 | $ hg update -r 1 |
|
802 | $ hg update -r 1 | |
803 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
803 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
804 | $ echo "ddd" >> d |
|
804 | $ echo "ddd" >> d | |
805 | $ hg commit -A -m 3 |
|
805 | $ hg commit -A -m 3 | |
806 | adding d |
|
806 | adding d | |
807 | created new head |
|
807 | created new head | |
808 | $ hg update -r 2 |
|
808 | $ hg update -r 2 | |
809 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
809 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
810 | $ hg log -G |
|
810 | $ hg log -G | |
811 | o changeset: 3:8bd3e1f196af |
|
811 | o changeset: 3:8bd3e1f196af | |
812 | | tag: tip |
|
812 | | tag: tip | |
813 | | parent: 1:a01eca7af26d |
|
813 | | parent: 1:a01eca7af26d | |
814 | | user: test |
|
814 | | user: test | |
815 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
815 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
816 | | summary: 3 |
|
816 | | summary: 3 | |
817 | | |
|
817 | | | |
818 | | @ changeset: 2:4652c276ac4f |
|
818 | | @ changeset: 2:4652c276ac4f | |
819 | |/ user: test |
|
819 | |/ user: test | |
820 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
820 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
821 | | summary: 2 |
|
821 | | summary: 2 | |
822 | | |
|
822 | | | |
823 | o changeset: 1:a01eca7af26d |
|
823 | o changeset: 1:a01eca7af26d | |
824 | | user: test |
|
824 | | user: test | |
825 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
825 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
826 | | summary: 1 |
|
826 | | summary: 1 | |
827 | | |
|
827 | | | |
828 | o changeset: 0:4fe08cd4693e |
|
828 | o changeset: 0:4fe08cd4693e | |
829 | user: test |
|
829 | user: test | |
830 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
830 | date: Thu Jan 01 00:00:00 1970 +0000 | |
831 | summary: 0 |
|
831 | summary: 0 | |
832 |
|
832 | |||
833 | $ hg bundle --base 1 -r 3 ../update2bundled.hg |
|
833 | $ hg bundle --base 1 -r 3 ../update2bundled.hg | |
834 | 1 changesets found |
|
834 | 1 changesets found | |
835 | $ hg strip -r 3 |
|
835 | $ hg strip -r 3 | |
836 | saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg (glob) |
|
836 | saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg (glob) | |
837 | $ hg merge -R ../update2bundled.hg -r 3 |
|
837 | $ hg merge -R ../update2bundled.hg -r 3 | |
838 | setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle |
|
838 | setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle | |
839 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
839 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
840 | (branch merge, don't forget to commit) |
|
840 | (branch merge, don't forget to commit) | |
841 |
|
841 | |||
842 | When user updates to the revision existing only in the bundle, |
|
842 | When user updates to the revision existing only in the bundle, | |
843 | it should show warning |
|
843 | it should show warning | |
844 |
|
844 | |||
845 | $ hg update -R ../update2bundled.hg --clean -r 3 |
|
845 | $ hg update -R ../update2bundled.hg --clean -r 3 | |
846 | setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle |
|
846 | setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle | |
847 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
847 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
848 |
|
848 | |||
849 | When user updates to the revision existing in the local repository |
|
849 | When user updates to the revision existing in the local repository | |
850 | the warning shouldn't be emitted |
|
850 | the warning shouldn't be emitted | |
851 |
|
851 | |||
852 | $ hg update -R ../update2bundled.hg -r 0 |
|
852 | $ hg update -R ../update2bundled.hg -r 0 | |
853 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
853 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
@@ -1,1136 +1,1136 | |||||
1 | Test exchange of common information using bundle2 |
|
1 | Test exchange of common information using bundle2 | |
2 |
|
2 | |||
3 |
|
3 | |||
4 | $ getmainid() { |
|
4 | $ getmainid() { | |
5 | > hg -R main log --template '{node}\n' --rev "$1" |
|
5 | > hg -R main log --template '{node}\n' --rev "$1" | |
6 | > } |
|
6 | > } | |
7 |
|
7 | |||
8 | enable obsolescence |
|
8 | enable obsolescence | |
9 |
|
9 | |||
10 | $ cp $HGRCPATH $TESTTMP/hgrc.orig |
|
10 | $ cp $HGRCPATH $TESTTMP/hgrc.orig | |
11 | $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF |
|
11 | $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF | |
12 | > echo pushkey: lock state after \"\$HG_NAMESPACE\" |
|
12 | > echo pushkey: lock state after \"\$HG_NAMESPACE\" | |
13 | > hg debuglock |
|
13 | > hg debuglock | |
14 | > EOF |
|
14 | > EOF | |
15 |
|
15 | |||
16 | $ cat >> $HGRCPATH << EOF |
|
16 | $ cat >> $HGRCPATH << EOF | |
17 | > [experimental] |
|
17 | > [experimental] | |
18 | > evolution=createmarkers,exchange |
|
18 | > evolution=createmarkers,exchange | |
19 | > bundle2-output-capture=True |
|
19 | > bundle2-output-capture=True | |
20 | > [ui] |
|
20 | > [ui] | |
21 | > ssh=python "$TESTDIR/dummyssh" |
|
21 | > ssh=python "$TESTDIR/dummyssh" | |
22 | > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} |
|
22 | > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} | |
23 | > [web] |
|
23 | > [web] | |
24 | > push_ssl = false |
|
24 | > push_ssl = false | |
25 | > allow_push = * |
|
25 | > allow_push = * | |
26 | > [phases] |
|
26 | > [phases] | |
27 | > publish=False |
|
27 | > publish=False | |
28 | > [hooks] |
|
28 | > [hooks] | |
29 | > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n" |
|
29 | > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n" | |
30 | > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n" |
|
30 | > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n" | |
31 | > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose" |
|
31 | > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose" | |
32 | > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh" |
|
32 | > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh" | |
33 | > EOF |
|
33 | > EOF | |
34 |
|
34 | |||
35 | The extension requires a repo (currently unused) |
|
35 | The extension requires a repo (currently unused) | |
36 |
|
36 | |||
37 | $ hg init main |
|
37 | $ hg init main | |
38 | $ cd main |
|
38 | $ cd main | |
39 | $ touch a |
|
39 | $ touch a | |
40 | $ hg add a |
|
40 | $ hg add a | |
41 | $ hg commit -m 'a' |
|
41 | $ hg commit -m 'a' | |
42 | pre-close-tip:3903775176ed draft |
|
42 | pre-close-tip:3903775176ed draft | |
43 | postclose-tip:3903775176ed draft |
|
43 | postclose-tip:3903775176ed draft | |
44 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
44 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
45 |
|
45 | |||
46 | $ hg unbundle $TESTDIR/bundles/rebase.hg |
|
46 | $ hg unbundle $TESTDIR/bundles/rebase.hg | |
47 | adding changesets |
|
47 | adding changesets | |
48 | adding manifests |
|
48 | adding manifests | |
49 | adding file changes |
|
49 | adding file changes | |
50 | added 8 changesets with 7 changes to 7 files (+3 heads) |
|
50 | added 8 changesets with 7 changes to 7 files (+3 heads) | |
51 | pre-close-tip:02de42196ebe draft |
|
51 | pre-close-tip:02de42196ebe draft | |
52 | postclose-tip:02de42196ebe draft |
|
52 | postclose-tip:02de42196ebe draft | |
53 | txnclose hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNID=TXN:$ID$ HG_TXNNAME=unbundle |
|
53 | txnclose hook: HG_HOOKTYPE=txnclose HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNID=TXN:$ID$ HG_TXNNAME=unbundle | |
54 | bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob) |
|
54 | bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob) | |
55 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
55 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
56 |
|
56 | |||
57 | $ cd .. |
|
57 | $ cd .. | |
58 |
|
58 | |||
59 | Real world exchange |
|
59 | Real world exchange | |
60 | ===================== |
|
60 | ===================== | |
61 |
|
61 | |||
62 | Add more obsolescence information |
|
62 | Add more obsolescence information | |
63 |
|
63 | |||
64 | $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc` |
|
64 | $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc` | |
65 | pre-close-tip:02de42196ebe draft |
|
65 | pre-close-tip:02de42196ebe draft | |
66 | postclose-tip:02de42196ebe draft |
|
66 | postclose-tip:02de42196ebe draft | |
67 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
67 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
68 | $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c` |
|
68 | $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c` | |
69 | pre-close-tip:02de42196ebe draft |
|
69 | pre-close-tip:02de42196ebe draft | |
70 | postclose-tip:02de42196ebe draft |
|
70 | postclose-tip:02de42196ebe draft | |
71 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
71 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
72 |
|
72 | |||
73 | clone --pull |
|
73 | clone --pull | |
74 |
|
74 | |||
75 | $ hg -R main phase --public cd010b8cd998 |
|
75 | $ hg -R main phase --public cd010b8cd998 | |
76 | pre-close-tip:02de42196ebe draft |
|
76 | pre-close-tip:02de42196ebe draft | |
77 | postclose-tip:02de42196ebe draft |
|
77 | postclose-tip:02de42196ebe draft | |
78 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase |
|
78 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase | |
79 | $ hg clone main other --pull --rev 9520eea781bc |
|
79 | $ hg clone main other --pull --rev 9520eea781bc | |
80 | adding changesets |
|
80 | adding changesets | |
81 | adding manifests |
|
81 | adding manifests | |
82 | adding file changes |
|
82 | adding file changes | |
83 | added 2 changesets with 2 changes to 2 files |
|
83 | added 2 changesets with 2 changes to 2 files | |
84 | 1 new obsolescence markers |
|
84 | 1 new obsolescence markers | |
85 | pre-close-tip:9520eea781bc draft |
|
85 | pre-close-tip:9520eea781bc draft | |
86 | postclose-tip:9520eea781bc draft |
|
86 | postclose-tip:9520eea781bc draft | |
87 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=9520eea781bcca16c1e15acc0ba14335a0e8e5ba HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull |
|
87 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=9520eea781bcca16c1e15acc0ba14335a0e8e5ba HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull | |
88 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) |
|
88 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) | |
89 | updating to branch default |
|
89 | updating to branch default | |
90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
91 | $ hg -R other log -G |
|
91 | $ hg -R other log -G | |
92 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
92 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
93 | | |
|
93 | | | |
94 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
94 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A | |
95 |
|
95 | |||
96 | $ hg -R other debugobsolete |
|
96 | $ hg -R other debugobsolete | |
97 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
97 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
98 |
|
98 | |||
99 | pull |
|
99 | pull | |
100 |
|
100 | |||
101 | $ hg -R main phase --public 9520eea781bc |
|
101 | $ hg -R main phase --public 9520eea781bc | |
102 | pre-close-tip:02de42196ebe draft |
|
102 | pre-close-tip:02de42196ebe draft | |
103 | postclose-tip:02de42196ebe draft |
|
103 | postclose-tip:02de42196ebe draft | |
104 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase |
|
104 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase | |
105 | $ hg -R other pull -r 24b6387c8c8c |
|
105 | $ hg -R other pull -r 24b6387c8c8c | |
106 | pulling from $TESTTMP/main (glob) |
|
106 | pulling from $TESTTMP/main (glob) | |
107 | searching for changes |
|
107 | searching for changes | |
108 | adding changesets |
|
108 | adding changesets | |
109 | adding manifests |
|
109 | adding manifests | |
110 | adding file changes |
|
110 | adding file changes | |
111 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
111 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
112 | 1 new obsolescence markers |
|
112 | 1 new obsolescence markers | |
113 | pre-close-tip:24b6387c8c8c draft |
|
113 | pre-close-tip:24b6387c8c8c draft | |
114 | postclose-tip:24b6387c8c8c draft |
|
114 | postclose-tip:24b6387c8c8c draft | |
115 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_NODE_LAST=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull |
|
115 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_NODE_LAST=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull | |
116 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) |
|
116 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) | |
117 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
117 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
118 | $ hg -R other log -G |
|
118 | $ hg -R other log -G | |
119 | o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
119 | o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
120 | | |
|
120 | | | |
121 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
121 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
122 | |/ |
|
122 | |/ | |
123 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
123 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A | |
124 |
|
124 | |||
125 | $ hg -R other debugobsolete |
|
125 | $ hg -R other debugobsolete | |
126 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
126 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
127 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
127 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
128 |
|
128 | |||
129 | pull empty (with phase movement) |
|
129 | pull empty (with phase movement) | |
130 |
|
130 | |||
131 | $ hg -R main phase --public 24b6387c8c8c |
|
131 | $ hg -R main phase --public 24b6387c8c8c | |
132 | pre-close-tip:02de42196ebe draft |
|
132 | pre-close-tip:02de42196ebe draft | |
133 | postclose-tip:02de42196ebe draft |
|
133 | postclose-tip:02de42196ebe draft | |
134 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase |
|
134 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase | |
135 | $ hg -R other pull -r 24b6387c8c8c |
|
135 | $ hg -R other pull -r 24b6387c8c8c | |
136 | pulling from $TESTTMP/main (glob) |
|
136 | pulling from $TESTTMP/main (glob) | |
137 | no changes found |
|
137 | no changes found | |
138 | pre-close-tip:24b6387c8c8c public |
|
138 | pre-close-tip:24b6387c8c8c public | |
139 | postclose-tip:24b6387c8c8c public |
|
139 | postclose-tip:24b6387c8c8c public | |
140 | txnclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull |
|
140 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull | |
141 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) |
|
141 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) | |
142 | $ hg -R other log -G |
|
142 | $ hg -R other log -G | |
143 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
143 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
144 | | |
|
144 | | | |
145 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
145 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
146 | |/ |
|
146 | |/ | |
147 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
147 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A | |
148 |
|
148 | |||
149 | $ hg -R other debugobsolete |
|
149 | $ hg -R other debugobsolete | |
150 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
150 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
151 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
151 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
152 |
|
152 | |||
153 | pull empty |
|
153 | pull empty | |
154 |
|
154 | |||
155 | $ hg -R other pull -r 24b6387c8c8c |
|
155 | $ hg -R other pull -r 24b6387c8c8c | |
156 | pulling from $TESTTMP/main (glob) |
|
156 | pulling from $TESTTMP/main (glob) | |
157 | no changes found |
|
157 | no changes found | |
158 | pre-close-tip:24b6387c8c8c public |
|
158 | pre-close-tip:24b6387c8c8c public | |
159 | postclose-tip:24b6387c8c8c public |
|
159 | postclose-tip:24b6387c8c8c public | |
160 | txnclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull |
|
160 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull | |
161 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) |
|
161 | file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob) | |
162 | $ hg -R other log -G |
|
162 | $ hg -R other log -G | |
163 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
163 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
164 | | |
|
164 | | | |
165 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
165 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
166 | |/ |
|
166 | |/ | |
167 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
167 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A | |
168 |
|
168 | |||
169 | $ hg -R other debugobsolete |
|
169 | $ hg -R other debugobsolete | |
170 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
170 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
171 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
171 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
172 |
|
172 | |||
173 | add extra data to test their exchange during push |
|
173 | add extra data to test their exchange during push | |
174 |
|
174 | |||
175 | $ hg -R main bookmark --rev eea13746799a book_eea1 |
|
175 | $ hg -R main bookmark --rev eea13746799a book_eea1 | |
176 | pre-close-tip:02de42196ebe draft |
|
176 | pre-close-tip:02de42196ebe draft | |
177 | postclose-tip:02de42196ebe draft |
|
177 | postclose-tip:02de42196ebe draft | |
178 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
178 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
179 | $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a` |
|
179 | $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a` | |
180 | pre-close-tip:02de42196ebe draft |
|
180 | pre-close-tip:02de42196ebe draft | |
181 | postclose-tip:02de42196ebe draft |
|
181 | postclose-tip:02de42196ebe draft | |
182 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
182 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
183 | $ hg -R main bookmark --rev 02de42196ebe book_02de |
|
183 | $ hg -R main bookmark --rev 02de42196ebe book_02de | |
184 | pre-close-tip:02de42196ebe draft book_02de |
|
184 | pre-close-tip:02de42196ebe draft book_02de | |
185 | postclose-tip:02de42196ebe draft book_02de |
|
185 | postclose-tip:02de42196ebe draft book_02de | |
186 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
186 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
187 | $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe` |
|
187 | $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe` | |
188 | pre-close-tip:02de42196ebe draft book_02de |
|
188 | pre-close-tip:02de42196ebe draft book_02de | |
189 | postclose-tip:02de42196ebe draft book_02de |
|
189 | postclose-tip:02de42196ebe draft book_02de | |
190 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
190 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
191 | $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc |
|
191 | $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc | |
192 | pre-close-tip:02de42196ebe draft book_02de |
|
192 | pre-close-tip:02de42196ebe draft book_02de | |
193 | postclose-tip:02de42196ebe draft book_02de |
|
193 | postclose-tip:02de42196ebe draft book_02de | |
194 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
194 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
195 | $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16` |
|
195 | $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16` | |
196 | pre-close-tip:02de42196ebe draft book_02de |
|
196 | pre-close-tip:02de42196ebe draft book_02de | |
197 | postclose-tip:02de42196ebe draft book_02de |
|
197 | postclose-tip:02de42196ebe draft book_02de | |
198 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
198 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
199 | $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd |
|
199 | $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd | |
200 | pre-close-tip:02de42196ebe draft book_02de |
|
200 | pre-close-tip:02de42196ebe draft book_02de | |
201 | postclose-tip:02de42196ebe draft book_02de |
|
201 | postclose-tip:02de42196ebe draft book_02de | |
202 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
202 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
203 | $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8` |
|
203 | $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8` | |
204 | pre-close-tip:02de42196ebe draft book_02de |
|
204 | pre-close-tip:02de42196ebe draft book_02de | |
205 | postclose-tip:02de42196ebe draft book_02de |
|
205 | postclose-tip:02de42196ebe draft book_02de | |
206 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
206 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
207 | $ hg -R main bookmark --rev 32af7686d403 book_32af |
|
207 | $ hg -R main bookmark --rev 32af7686d403 book_32af | |
208 | pre-close-tip:02de42196ebe draft book_02de |
|
208 | pre-close-tip:02de42196ebe draft book_02de | |
209 | postclose-tip:02de42196ebe draft book_02de |
|
209 | postclose-tip:02de42196ebe draft book_02de | |
210 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
210 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
211 | $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403` |
|
211 | $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403` | |
212 | pre-close-tip:02de42196ebe draft book_02de |
|
212 | pre-close-tip:02de42196ebe draft book_02de | |
213 | postclose-tip:02de42196ebe draft book_02de |
|
213 | postclose-tip:02de42196ebe draft book_02de | |
214 | txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete |
|
214 | txnclose hook: HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete | |
215 |
|
215 | |||
216 | $ hg -R other bookmark --rev cd010b8cd998 book_eea1 |
|
216 | $ hg -R other bookmark --rev cd010b8cd998 book_eea1 | |
217 | pre-close-tip:24b6387c8c8c public |
|
217 | pre-close-tip:24b6387c8c8c public | |
218 | postclose-tip:24b6387c8c8c public |
|
218 | postclose-tip:24b6387c8c8c public | |
219 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
219 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
220 | $ hg -R other bookmark --rev cd010b8cd998 book_02de |
|
220 | $ hg -R other bookmark --rev cd010b8cd998 book_02de | |
221 | pre-close-tip:24b6387c8c8c public |
|
221 | pre-close-tip:24b6387c8c8c public | |
222 | postclose-tip:24b6387c8c8c public |
|
222 | postclose-tip:24b6387c8c8c public | |
223 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
223 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
224 | $ hg -R other bookmark --rev cd010b8cd998 book_42cc |
|
224 | $ hg -R other bookmark --rev cd010b8cd998 book_42cc | |
225 | pre-close-tip:24b6387c8c8c public |
|
225 | pre-close-tip:24b6387c8c8c public | |
226 | postclose-tip:24b6387c8c8c public |
|
226 | postclose-tip:24b6387c8c8c public | |
227 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
227 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
228 | $ hg -R other bookmark --rev cd010b8cd998 book_5fdd |
|
228 | $ hg -R other bookmark --rev cd010b8cd998 book_5fdd | |
229 | pre-close-tip:24b6387c8c8c public |
|
229 | pre-close-tip:24b6387c8c8c public | |
230 | postclose-tip:24b6387c8c8c public |
|
230 | postclose-tip:24b6387c8c8c public | |
231 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
231 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
232 | $ hg -R other bookmark --rev cd010b8cd998 book_32af |
|
232 | $ hg -R other bookmark --rev cd010b8cd998 book_32af | |
233 | pre-close-tip:24b6387c8c8c public |
|
233 | pre-close-tip:24b6387c8c8c public | |
234 | postclose-tip:24b6387c8c8c public |
|
234 | postclose-tip:24b6387c8c8c public | |
235 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
235 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
236 |
|
236 | |||
237 | $ hg -R main phase --public eea13746799a |
|
237 | $ hg -R main phase --public eea13746799a | |
238 | pre-close-tip:02de42196ebe draft book_02de |
|
238 | pre-close-tip:02de42196ebe draft book_02de | |
239 | postclose-tip:02de42196ebe draft book_02de |
|
239 | postclose-tip:02de42196ebe draft book_02de | |
240 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase |
|
240 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase | |
241 |
|
241 | |||
242 | push |
|
242 | push | |
243 | $ hg -R main push other --rev eea13746799a --bookmark book_eea1 |
|
243 | $ hg -R main push other --rev eea13746799a --bookmark book_eea1 | |
244 | pushing to other |
|
244 | pushing to other | |
245 | searching for changes |
|
245 | searching for changes | |
246 | remote: adding changesets |
|
246 | remote: adding changesets | |
247 | remote: adding manifests |
|
247 | remote: adding manifests | |
248 | remote: adding file changes |
|
248 | remote: adding file changes | |
249 | remote: added 1 changesets with 0 changes to 0 files (-1 heads) |
|
249 | remote: added 1 changesets with 0 changes to 0 files (-1 heads) | |
250 | remote: 1 new obsolescence markers |
|
250 | remote: 1 new obsolescence markers | |
251 | remote: pre-close-tip:eea13746799a public book_eea1 |
|
251 | remote: pre-close-tip:eea13746799a public book_eea1 | |
252 | remote: pushkey: lock state after "phases" |
|
252 | remote: pushkey: lock state after "phases" | |
253 | remote: lock: free |
|
253 | remote: lock: free | |
254 | remote: wlock: free |
|
254 | remote: wlock: free | |
255 | remote: pushkey: lock state after "bookmarks" |
|
255 | remote: pushkey: lock state after "bookmarks" | |
256 | remote: lock: free |
|
256 | remote: lock: free | |
257 | remote: wlock: free |
|
257 | remote: wlock: free | |
258 | remote: postclose-tip:eea13746799a public book_eea1 |
|
258 | remote: postclose-tip:eea13746799a public book_eea1 | |
259 | remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other |
|
259 | remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other | |
260 | updating bookmark book_eea1 |
|
260 | updating bookmark book_eea1 | |
261 | pre-close-tip:02de42196ebe draft book_02de |
|
261 | pre-close-tip:02de42196ebe draft book_02de | |
262 | postclose-tip:02de42196ebe draft book_02de |
|
262 | postclose-tip:02de42196ebe draft book_02de | |
263 | txnclose hook: HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response |
|
263 | txnclose hook: HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response | |
264 | file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob) |
|
264 | file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob) | |
265 | $ hg -R other log -G |
|
265 | $ hg -R other log -G | |
266 | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G |
|
266 | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G | |
267 | |\ |
|
267 | |\ | |
268 | | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
268 | | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
269 | | | |
|
269 | | | | |
270 | @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
270 | @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
271 | |/ |
|
271 | |/ | |
272 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A |
|
272 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A | |
273 |
|
273 | |||
274 | $ hg -R other debugobsolete |
|
274 | $ hg -R other debugobsolete | |
275 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
275 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
276 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
276 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
277 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
277 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
278 |
|
278 | |||
279 | pull over ssh |
|
279 | pull over ssh | |
280 |
|
280 | |||
281 | $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de |
|
281 | $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de | |
282 | pulling from ssh://user@dummy/main |
|
282 | pulling from ssh://user@dummy/main | |
283 | searching for changes |
|
283 | searching for changes | |
284 | adding changesets |
|
284 | adding changesets | |
285 | adding manifests |
|
285 | adding manifests | |
286 | adding file changes |
|
286 | adding file changes | |
287 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
287 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
288 | 1 new obsolescence markers |
|
288 | 1 new obsolescence markers | |
289 | updating bookmark book_02de |
|
289 | updating bookmark book_02de | |
290 | pre-close-tip:02de42196ebe draft book_02de |
|
290 | pre-close-tip:02de42196ebe draft book_02de | |
291 | postclose-tip:02de42196ebe draft book_02de |
|
291 | postclose-tip:02de42196ebe draft book_02de | |
292 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull |
|
292 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull | |
293 | ssh://user@dummy/main HG_URL=ssh://user@dummy/main |
|
293 | ssh://user@dummy/main HG_URL=ssh://user@dummy/main | |
294 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
294 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
295 | $ hg -R other debugobsolete |
|
295 | $ hg -R other debugobsolete | |
296 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
296 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
297 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
297 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
298 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
298 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
299 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
299 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
300 |
|
300 | |||
301 | pull over http |
|
301 | pull over http | |
302 |
|
302 | |||
303 | $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log |
|
303 | $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log | |
304 | $ cat main.pid >> $DAEMON_PIDS |
|
304 | $ cat main.pid >> $DAEMON_PIDS | |
305 |
|
305 | |||
306 | $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc |
|
306 | $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc | |
307 | pulling from http://localhost:$HGPORT/ |
|
307 | pulling from http://localhost:$HGPORT/ | |
308 | searching for changes |
|
308 | searching for changes | |
309 | adding changesets |
|
309 | adding changesets | |
310 | adding manifests |
|
310 | adding manifests | |
311 | adding file changes |
|
311 | adding file changes | |
312 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
312 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
313 | 1 new obsolescence markers |
|
313 | 1 new obsolescence markers | |
314 | updating bookmark book_42cc |
|
314 | updating bookmark book_42cc | |
315 | pre-close-tip:42ccdea3bb16 draft book_42cc |
|
315 | pre-close-tip:42ccdea3bb16 draft book_42cc | |
316 | postclose-tip:42ccdea3bb16 draft book_42cc |
|
316 | postclose-tip:42ccdea3bb16 draft book_42cc | |
317 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_NODE_LAST=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull |
|
317 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_NODE_LAST=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull | |
318 | http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/ |
|
318 | http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/ | |
319 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
319 | (run 'hg heads .' to see heads, 'hg merge' to merge) | |
320 | $ cat main-error.log |
|
320 | $ cat main-error.log | |
321 | $ hg -R other debugobsolete |
|
321 | $ hg -R other debugobsolete | |
322 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
322 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
323 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
323 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
324 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
324 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
325 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
325 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
326 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
326 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
327 |
|
327 | |||
328 | push over ssh |
|
328 | push over ssh | |
329 |
|
329 | |||
330 | $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd |
|
330 | $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd | |
331 | pushing to ssh://user@dummy/other |
|
331 | pushing to ssh://user@dummy/other | |
332 | searching for changes |
|
332 | searching for changes | |
333 | remote: adding changesets |
|
333 | remote: adding changesets | |
334 | remote: adding manifests |
|
334 | remote: adding manifests | |
335 | remote: adding file changes |
|
335 | remote: adding file changes | |
336 | remote: added 1 changesets with 1 changes to 1 files |
|
336 | remote: added 1 changesets with 1 changes to 1 files | |
337 | remote: 1 new obsolescence markers |
|
337 | remote: 1 new obsolescence markers | |
338 | remote: pre-close-tip:5fddd98957c8 draft book_5fdd |
|
338 | remote: pre-close-tip:5fddd98957c8 draft book_5fdd | |
339 | remote: pushkey: lock state after "bookmarks" |
|
339 | remote: pushkey: lock state after "bookmarks" | |
340 | remote: lock: free |
|
340 | remote: lock: free | |
341 | remote: wlock: free |
|
341 | remote: wlock: free | |
342 | remote: postclose-tip:5fddd98957c8 draft book_5fdd |
|
342 | remote: postclose-tip:5fddd98957c8 draft book_5fdd | |
343 | remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP |
|
343 | remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP | |
344 | updating bookmark book_5fdd |
|
344 | updating bookmark book_5fdd | |
345 | pre-close-tip:02de42196ebe draft book_02de |
|
345 | pre-close-tip:02de42196ebe draft book_02de | |
346 | postclose-tip:02de42196ebe draft book_02de |
|
346 | postclose-tip:02de42196ebe draft book_02de | |
347 | txnclose hook: HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response |
|
347 | txnclose hook: HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response | |
348 | ssh://user@dummy/other HG_URL=ssh://user@dummy/other |
|
348 | ssh://user@dummy/other HG_URL=ssh://user@dummy/other | |
349 | $ hg -R other log -G |
|
349 | $ hg -R other log -G | |
350 | o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C |
|
350 | o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C | |
351 | | |
|
351 | | | |
352 | o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B |
|
352 | o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B | |
353 | | |
|
353 | | | |
354 | | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H |
|
354 | | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H | |
355 | | | |
|
355 | | | | |
356 | | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G |
|
356 | | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G | |
357 | | |/| |
|
357 | | |/| | |
358 | | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
358 | | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
359 | |/ / |
|
359 | |/ / | |
360 | | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
360 | | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
361 | |/ |
|
361 | |/ | |
362 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A |
|
362 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A | |
363 |
|
363 | |||
364 | $ hg -R other debugobsolete |
|
364 | $ hg -R other debugobsolete | |
365 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
365 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
366 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
366 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
367 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
367 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
368 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
368 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
369 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
369 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
370 | 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
370 | 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
371 |
|
371 | |||
372 | push over http |
|
372 | push over http | |
373 |
|
373 | |||
374 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
374 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log | |
375 | $ cat other.pid >> $DAEMON_PIDS |
|
375 | $ cat other.pid >> $DAEMON_PIDS | |
376 |
|
376 | |||
377 | $ hg -R main phase --public 32af7686d403 |
|
377 | $ hg -R main phase --public 32af7686d403 | |
378 | pre-close-tip:02de42196ebe draft book_02de |
|
378 | pre-close-tip:02de42196ebe draft book_02de | |
379 | postclose-tip:02de42196ebe draft book_02de |
|
379 | postclose-tip:02de42196ebe draft book_02de | |
380 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase |
|
380 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase | |
381 | $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af |
|
381 | $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af | |
382 | pushing to http://localhost:$HGPORT2/ |
|
382 | pushing to http://localhost:$HGPORT2/ | |
383 | searching for changes |
|
383 | searching for changes | |
384 | remote: adding changesets |
|
384 | remote: adding changesets | |
385 | remote: adding manifests |
|
385 | remote: adding manifests | |
386 | remote: adding file changes |
|
386 | remote: adding file changes | |
387 | remote: added 1 changesets with 1 changes to 1 files |
|
387 | remote: added 1 changesets with 1 changes to 1 files | |
388 | remote: 1 new obsolescence markers |
|
388 | remote: 1 new obsolescence markers | |
389 | remote: pre-close-tip:32af7686d403 public book_32af |
|
389 | remote: pre-close-tip:32af7686d403 public book_32af | |
390 | remote: pushkey: lock state after "phases" |
|
390 | remote: pushkey: lock state after "phases" | |
391 | remote: lock: free |
|
391 | remote: lock: free | |
392 | remote: wlock: free |
|
392 | remote: wlock: free | |
393 | remote: pushkey: lock state after "bookmarks" |
|
393 | remote: pushkey: lock state after "bookmarks" | |
394 | remote: lock: free |
|
394 | remote: lock: free | |
395 | remote: wlock: free |
|
395 | remote: wlock: free | |
396 | remote: postclose-tip:32af7686d403 public book_32af |
|
396 | remote: postclose-tip:32af7686d403 public book_32af | |
397 | remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: |
|
397 | remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: | |
398 | updating bookmark book_32af |
|
398 | updating bookmark book_32af | |
399 | pre-close-tip:02de42196ebe draft book_02de |
|
399 | pre-close-tip:02de42196ebe draft book_02de | |
400 | postclose-tip:02de42196ebe draft book_02de |
|
400 | postclose-tip:02de42196ebe draft book_02de | |
401 | txnclose hook: HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response |
|
401 | txnclose hook: HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response | |
402 | http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/ |
|
402 | http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/ | |
403 | $ cat other-error.log |
|
403 | $ cat other-error.log | |
404 |
|
404 | |||
405 | Check final content. |
|
405 | Check final content. | |
406 |
|
406 | |||
407 | $ hg -R other log -G |
|
407 | $ hg -R other log -G | |
408 | o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D |
|
408 | o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D | |
409 | | |
|
409 | | | |
410 | o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C |
|
410 | o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C | |
411 | | |
|
411 | | | |
412 | o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B |
|
412 | o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B | |
413 | | |
|
413 | | | |
414 | | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H |
|
414 | | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H | |
415 | | | |
|
415 | | | | |
416 | | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G |
|
416 | | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G | |
417 | | |/| |
|
417 | | |/| | |
418 | | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
418 | | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
419 | |/ / |
|
419 | |/ / | |
420 | | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
420 | | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
421 | |/ |
|
421 | |/ | |
422 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
422 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A | |
423 |
|
423 | |||
424 | $ hg -R other debugobsolete |
|
424 | $ hg -R other debugobsolete | |
425 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
425 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
426 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
426 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
427 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
427 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
428 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
428 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
429 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
429 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
430 | 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
430 | 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
431 | 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
431 | 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
432 |
|
432 | |||
433 | (check that no 'pending' files remain) |
|
433 | (check that no 'pending' files remain) | |
434 |
|
434 | |||
435 | $ ls -1 other/.hg/bookmarks* |
|
435 | $ ls -1 other/.hg/bookmarks* | |
436 | other/.hg/bookmarks |
|
436 | other/.hg/bookmarks | |
437 | $ ls -1 other/.hg/store/phaseroots* |
|
437 | $ ls -1 other/.hg/store/phaseroots* | |
438 | other/.hg/store/phaseroots |
|
438 | other/.hg/store/phaseroots | |
439 | $ ls -1 other/.hg/store/00changelog.i* |
|
439 | $ ls -1 other/.hg/store/00changelog.i* | |
440 | other/.hg/store/00changelog.i |
|
440 | other/.hg/store/00changelog.i | |
441 |
|
441 | |||
442 | Error Handling |
|
442 | Error Handling | |
443 | ============== |
|
443 | ============== | |
444 |
|
444 | |||
445 | Check that errors are properly returned to the client during push. |
|
445 | Check that errors are properly returned to the client during push. | |
446 |
|
446 | |||
447 | Setting up |
|
447 | Setting up | |
448 |
|
448 | |||
449 | $ cat > failpush.py << EOF |
|
449 | $ cat > failpush.py << EOF | |
450 | > """A small extension that makes push fails when using bundle2 |
|
450 | > """A small extension that makes push fails when using bundle2 | |
451 | > |
|
451 | > | |
452 | > used to test error handling in bundle2 |
|
452 | > used to test error handling in bundle2 | |
453 | > """ |
|
453 | > """ | |
454 | > |
|
454 | > | |
455 | > from mercurial import error |
|
455 | > from mercurial import error | |
456 | > from mercurial import bundle2 |
|
456 | > from mercurial import bundle2 | |
457 | > from mercurial import exchange |
|
457 | > from mercurial import exchange | |
458 | > from mercurial import extensions |
|
458 | > from mercurial import extensions | |
459 | > |
|
459 | > | |
460 | > def _pushbundle2failpart(pushop, bundler): |
|
460 | > def _pushbundle2failpart(pushop, bundler): | |
461 | > reason = pushop.ui.config('failpush', 'reason', None) |
|
461 | > reason = pushop.ui.config('failpush', 'reason', None) | |
462 | > part = None |
|
462 | > part = None | |
463 | > if reason == 'abort': |
|
463 | > if reason == 'abort': | |
464 | > bundler.newpart('test:abort') |
|
464 | > bundler.newpart('test:abort') | |
465 | > if reason == 'unknown': |
|
465 | > if reason == 'unknown': | |
466 | > bundler.newpart('test:unknown') |
|
466 | > bundler.newpart('test:unknown') | |
467 | > if reason == 'race': |
|
467 | > if reason == 'race': | |
468 | > # 20 Bytes of crap |
|
468 | > # 20 Bytes of crap | |
469 | > bundler.newpart('check:heads', data='01234567890123456789') |
|
469 | > bundler.newpart('check:heads', data='01234567890123456789') | |
470 | > |
|
470 | > | |
471 | > @bundle2.parthandler("test:abort") |
|
471 | > @bundle2.parthandler("test:abort") | |
472 | > def handleabort(op, part): |
|
472 | > def handleabort(op, part): | |
473 | > raise error.Abort('Abandon ship!', hint="don't panic") |
|
473 | > raise error.Abort('Abandon ship!', hint="don't panic") | |
474 | > |
|
474 | > | |
475 | > def uisetup(ui): |
|
475 | > def uisetup(ui): | |
476 | > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart |
|
476 | > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart | |
477 | > exchange.b2partsgenorder.insert(0, 'failpart') |
|
477 | > exchange.b2partsgenorder.insert(0, 'failpart') | |
478 | > |
|
478 | > | |
479 | > EOF |
|
479 | > EOF | |
480 |
|
480 | |||
481 | $ cd main |
|
481 | $ cd main | |
482 | $ hg up tip |
|
482 | $ hg up tip | |
483 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
483 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
484 | $ echo 'I' > I |
|
484 | $ echo 'I' > I | |
485 | $ hg add I |
|
485 | $ hg add I | |
486 | $ hg ci -m 'I' |
|
486 | $ hg ci -m 'I' | |
487 | pre-close-tip:e7ec4e813ba6 draft |
|
487 | pre-close-tip:e7ec4e813ba6 draft | |
488 | postclose-tip:e7ec4e813ba6 draft |
|
488 | postclose-tip:e7ec4e813ba6 draft | |
489 | txnclose hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
489 | txnclose hook: HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
490 | $ hg id |
|
490 | $ hg id | |
491 | e7ec4e813ba6 tip |
|
491 | e7ec4e813ba6 tip | |
492 | $ cd .. |
|
492 | $ cd .. | |
493 |
|
493 | |||
494 | $ cat << EOF >> $HGRCPATH |
|
494 | $ cat << EOF >> $HGRCPATH | |
495 | > [extensions] |
|
495 | > [extensions] | |
496 | > failpush=$TESTTMP/failpush.py |
|
496 | > failpush=$TESTTMP/failpush.py | |
497 | > EOF |
|
497 | > EOF | |
498 |
|
498 | |||
499 | $ killdaemons.py |
|
499 | $ killdaemons.py | |
500 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
500 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log | |
501 | $ cat other.pid >> $DAEMON_PIDS |
|
501 | $ cat other.pid >> $DAEMON_PIDS | |
502 |
|
502 | |||
503 | Doing the actual push: Abort error |
|
503 | Doing the actual push: Abort error | |
504 |
|
504 | |||
505 | $ cat << EOF >> $HGRCPATH |
|
505 | $ cat << EOF >> $HGRCPATH | |
506 | > [failpush] |
|
506 | > [failpush] | |
507 | > reason = abort |
|
507 | > reason = abort | |
508 | > EOF |
|
508 | > EOF | |
509 |
|
509 | |||
510 | $ hg -R main push other -r e7ec4e813ba6 |
|
510 | $ hg -R main push other -r e7ec4e813ba6 | |
511 | pushing to other |
|
511 | pushing to other | |
512 | searching for changes |
|
512 | searching for changes | |
513 | abort: Abandon ship! |
|
513 | abort: Abandon ship! | |
514 | (don't panic) |
|
514 | (don't panic) | |
515 | [255] |
|
515 | [255] | |
516 |
|
516 | |||
517 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
517 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
518 | pushing to ssh://user@dummy/other |
|
518 | pushing to ssh://user@dummy/other | |
519 | searching for changes |
|
519 | searching for changes | |
520 | remote: Abandon ship! |
|
520 | remote: Abandon ship! | |
521 | remote: (don't panic) |
|
521 | remote: (don't panic) | |
522 | abort: push failed on remote |
|
522 | abort: push failed on remote | |
523 | [255] |
|
523 | [255] | |
524 |
|
524 | |||
525 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
525 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
526 | pushing to http://localhost:$HGPORT2/ |
|
526 | pushing to http://localhost:$HGPORT2/ | |
527 | searching for changes |
|
527 | searching for changes | |
528 | remote: Abandon ship! |
|
528 | remote: Abandon ship! | |
529 | remote: (don't panic) |
|
529 | remote: (don't panic) | |
530 | abort: push failed on remote |
|
530 | abort: push failed on remote | |
531 | [255] |
|
531 | [255] | |
532 |
|
532 | |||
533 |
|
533 | |||
534 | Doing the actual push: unknown mandatory parts |
|
534 | Doing the actual push: unknown mandatory parts | |
535 |
|
535 | |||
536 | $ cat << EOF >> $HGRCPATH |
|
536 | $ cat << EOF >> $HGRCPATH | |
537 | > [failpush] |
|
537 | > [failpush] | |
538 | > reason = unknown |
|
538 | > reason = unknown | |
539 | > EOF |
|
539 | > EOF | |
540 |
|
540 | |||
541 | $ hg -R main push other -r e7ec4e813ba6 |
|
541 | $ hg -R main push other -r e7ec4e813ba6 | |
542 | pushing to other |
|
542 | pushing to other | |
543 | searching for changes |
|
543 | searching for changes | |
544 | abort: missing support for test:unknown |
|
544 | abort: missing support for test:unknown | |
545 | [255] |
|
545 | [255] | |
546 |
|
546 | |||
547 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
547 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
548 | pushing to ssh://user@dummy/other |
|
548 | pushing to ssh://user@dummy/other | |
549 | searching for changes |
|
549 | searching for changes | |
550 | abort: missing support for test:unknown |
|
550 | abort: missing support for test:unknown | |
551 | [255] |
|
551 | [255] | |
552 |
|
552 | |||
553 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
553 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
554 | pushing to http://localhost:$HGPORT2/ |
|
554 | pushing to http://localhost:$HGPORT2/ | |
555 | searching for changes |
|
555 | searching for changes | |
556 | abort: missing support for test:unknown |
|
556 | abort: missing support for test:unknown | |
557 | [255] |
|
557 | [255] | |
558 |
|
558 | |||
559 | Doing the actual push: race |
|
559 | Doing the actual push: race | |
560 |
|
560 | |||
561 | $ cat << EOF >> $HGRCPATH |
|
561 | $ cat << EOF >> $HGRCPATH | |
562 | > [failpush] |
|
562 | > [failpush] | |
563 | > reason = race |
|
563 | > reason = race | |
564 | > EOF |
|
564 | > EOF | |
565 |
|
565 | |||
566 | $ hg -R main push other -r e7ec4e813ba6 |
|
566 | $ hg -R main push other -r e7ec4e813ba6 | |
567 | pushing to other |
|
567 | pushing to other | |
568 | searching for changes |
|
568 | searching for changes | |
569 | abort: push failed: |
|
569 | abort: push failed: | |
570 | 'repository changed while pushing - please try again' |
|
570 | 'repository changed while pushing - please try again' | |
571 | [255] |
|
571 | [255] | |
572 |
|
572 | |||
573 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
573 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
574 | pushing to ssh://user@dummy/other |
|
574 | pushing to ssh://user@dummy/other | |
575 | searching for changes |
|
575 | searching for changes | |
576 | abort: push failed: |
|
576 | abort: push failed: | |
577 | 'repository changed while pushing - please try again' |
|
577 | 'repository changed while pushing - please try again' | |
578 | [255] |
|
578 | [255] | |
579 |
|
579 | |||
580 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
580 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
581 | pushing to http://localhost:$HGPORT2/ |
|
581 | pushing to http://localhost:$HGPORT2/ | |
582 | searching for changes |
|
582 | searching for changes | |
583 | abort: push failed: |
|
583 | abort: push failed: | |
584 | 'repository changed while pushing - please try again' |
|
584 | 'repository changed while pushing - please try again' | |
585 | [255] |
|
585 | [255] | |
586 |
|
586 | |||
587 | Doing the actual push: hook abort |
|
587 | Doing the actual push: hook abort | |
588 |
|
588 | |||
589 | $ cat << EOF >> $HGRCPATH |
|
589 | $ cat << EOF >> $HGRCPATH | |
590 | > [failpush] |
|
590 | > [failpush] | |
591 | > reason = |
|
591 | > reason = | |
592 | > [hooks] |
|
592 | > [hooks] | |
593 | > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false" |
|
593 | > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false" | |
594 | > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'" |
|
594 | > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'" | |
595 | > EOF |
|
595 | > EOF | |
596 |
|
596 | |||
597 | $ killdaemons.py |
|
597 | $ killdaemons.py | |
598 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
598 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log | |
599 | $ cat other.pid >> $DAEMON_PIDS |
|
599 | $ cat other.pid >> $DAEMON_PIDS | |
600 |
|
600 | |||
601 | $ hg -R main push other -r e7ec4e813ba6 |
|
601 | $ hg -R main push other -r e7ec4e813ba6 | |
602 | pushing to other |
|
602 | pushing to other | |
603 | searching for changes |
|
603 | searching for changes | |
604 | remote: adding changesets |
|
604 | remote: adding changesets | |
605 | remote: adding manifests |
|
605 | remote: adding manifests | |
606 | remote: adding file changes |
|
606 | remote: adding file changes | |
607 | remote: added 1 changesets with 1 changes to 1 files |
|
607 | remote: added 1 changesets with 1 changes to 1 files | |
608 | remote: pre-close-tip:e7ec4e813ba6 draft |
|
608 | remote: pre-close-tip:e7ec4e813ba6 draft | |
609 | remote: You shall not pass! |
|
609 | remote: You shall not pass! | |
610 | remote: transaction abort! |
|
610 | remote: transaction abort! | |
611 | remote: Cleaning up the mess... |
|
611 | remote: Cleaning up the mess... | |
612 | remote: rollback completed |
|
612 | remote: rollback completed | |
613 | abort: pretxnclose.failpush hook exited with status 1 |
|
613 | abort: pretxnclose.failpush hook exited with status 1 | |
614 | [255] |
|
614 | [255] | |
615 |
|
615 | |||
616 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
616 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
617 | pushing to ssh://user@dummy/other |
|
617 | pushing to ssh://user@dummy/other | |
618 | searching for changes |
|
618 | searching for changes | |
619 | remote: adding changesets |
|
619 | remote: adding changesets | |
620 | remote: adding manifests |
|
620 | remote: adding manifests | |
621 | remote: adding file changes |
|
621 | remote: adding file changes | |
622 | remote: added 1 changesets with 1 changes to 1 files |
|
622 | remote: added 1 changesets with 1 changes to 1 files | |
623 | remote: pre-close-tip:e7ec4e813ba6 draft |
|
623 | remote: pre-close-tip:e7ec4e813ba6 draft | |
624 | remote: You shall not pass! |
|
624 | remote: You shall not pass! | |
625 | remote: transaction abort! |
|
625 | remote: transaction abort! | |
626 | remote: Cleaning up the mess... |
|
626 | remote: Cleaning up the mess... | |
627 | remote: rollback completed |
|
627 | remote: rollback completed | |
628 | remote: pretxnclose.failpush hook exited with status 1 |
|
628 | remote: pretxnclose.failpush hook exited with status 1 | |
629 | abort: push failed on remote |
|
629 | abort: push failed on remote | |
630 | [255] |
|
630 | [255] | |
631 |
|
631 | |||
632 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
632 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
633 | pushing to http://localhost:$HGPORT2/ |
|
633 | pushing to http://localhost:$HGPORT2/ | |
634 | searching for changes |
|
634 | searching for changes | |
635 | remote: adding changesets |
|
635 | remote: adding changesets | |
636 | remote: adding manifests |
|
636 | remote: adding manifests | |
637 | remote: adding file changes |
|
637 | remote: adding file changes | |
638 | remote: added 1 changesets with 1 changes to 1 files |
|
638 | remote: added 1 changesets with 1 changes to 1 files | |
639 | remote: pre-close-tip:e7ec4e813ba6 draft |
|
639 | remote: pre-close-tip:e7ec4e813ba6 draft | |
640 | remote: You shall not pass! |
|
640 | remote: You shall not pass! | |
641 | remote: transaction abort! |
|
641 | remote: transaction abort! | |
642 | remote: Cleaning up the mess... |
|
642 | remote: Cleaning up the mess... | |
643 | remote: rollback completed |
|
643 | remote: rollback completed | |
644 | remote: pretxnclose.failpush hook exited with status 1 |
|
644 | remote: pretxnclose.failpush hook exited with status 1 | |
645 | abort: push failed on remote |
|
645 | abort: push failed on remote | |
646 | [255] |
|
646 | [255] | |
647 |
|
647 | |||
648 | (check that no 'pending' files remain) |
|
648 | (check that no 'pending' files remain) | |
649 |
|
649 | |||
650 | $ ls -1 other/.hg/bookmarks* |
|
650 | $ ls -1 other/.hg/bookmarks* | |
651 | other/.hg/bookmarks |
|
651 | other/.hg/bookmarks | |
652 | $ ls -1 other/.hg/store/phaseroots* |
|
652 | $ ls -1 other/.hg/store/phaseroots* | |
653 | other/.hg/store/phaseroots |
|
653 | other/.hg/store/phaseroots | |
654 | $ ls -1 other/.hg/store/00changelog.i* |
|
654 | $ ls -1 other/.hg/store/00changelog.i* | |
655 | other/.hg/store/00changelog.i |
|
655 | other/.hg/store/00changelog.i | |
656 |
|
656 | |||
657 | Check error from hook during the unbundling process itself |
|
657 | Check error from hook during the unbundling process itself | |
658 |
|
658 | |||
659 | $ cat << EOF >> $HGRCPATH |
|
659 | $ cat << EOF >> $HGRCPATH | |
660 | > pretxnchangegroup = sh -c "echo 'Fail early!'; false" |
|
660 | > pretxnchangegroup = sh -c "echo 'Fail early!'; false" | |
661 | > EOF |
|
661 | > EOF | |
662 | $ killdaemons.py # reload http config |
|
662 | $ killdaemons.py # reload http config | |
663 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
663 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log | |
664 | $ cat other.pid >> $DAEMON_PIDS |
|
664 | $ cat other.pid >> $DAEMON_PIDS | |
665 |
|
665 | |||
666 | $ hg -R main push other -r e7ec4e813ba6 |
|
666 | $ hg -R main push other -r e7ec4e813ba6 | |
667 | pushing to other |
|
667 | pushing to other | |
668 | searching for changes |
|
668 | searching for changes | |
669 | remote: adding changesets |
|
669 | remote: adding changesets | |
670 | remote: adding manifests |
|
670 | remote: adding manifests | |
671 | remote: adding file changes |
|
671 | remote: adding file changes | |
672 | remote: added 1 changesets with 1 changes to 1 files |
|
672 | remote: added 1 changesets with 1 changes to 1 files | |
673 | remote: Fail early! |
|
673 | remote: Fail early! | |
674 | remote: transaction abort! |
|
674 | remote: transaction abort! | |
675 | remote: Cleaning up the mess... |
|
675 | remote: Cleaning up the mess... | |
676 | remote: rollback completed |
|
676 | remote: rollback completed | |
677 | abort: pretxnchangegroup hook exited with status 1 |
|
677 | abort: pretxnchangegroup hook exited with status 1 | |
678 | [255] |
|
678 | [255] | |
679 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
679 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
680 | pushing to ssh://user@dummy/other |
|
680 | pushing to ssh://user@dummy/other | |
681 | searching for changes |
|
681 | searching for changes | |
682 | remote: adding changesets |
|
682 | remote: adding changesets | |
683 | remote: adding manifests |
|
683 | remote: adding manifests | |
684 | remote: adding file changes |
|
684 | remote: adding file changes | |
685 | remote: added 1 changesets with 1 changes to 1 files |
|
685 | remote: added 1 changesets with 1 changes to 1 files | |
686 | remote: Fail early! |
|
686 | remote: Fail early! | |
687 | remote: transaction abort! |
|
687 | remote: transaction abort! | |
688 | remote: Cleaning up the mess... |
|
688 | remote: Cleaning up the mess... | |
689 | remote: rollback completed |
|
689 | remote: rollback completed | |
690 | remote: pretxnchangegroup hook exited with status 1 |
|
690 | remote: pretxnchangegroup hook exited with status 1 | |
691 | abort: push failed on remote |
|
691 | abort: push failed on remote | |
692 | [255] |
|
692 | [255] | |
693 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
693 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
694 | pushing to http://localhost:$HGPORT2/ |
|
694 | pushing to http://localhost:$HGPORT2/ | |
695 | searching for changes |
|
695 | searching for changes | |
696 | remote: adding changesets |
|
696 | remote: adding changesets | |
697 | remote: adding manifests |
|
697 | remote: adding manifests | |
698 | remote: adding file changes |
|
698 | remote: adding file changes | |
699 | remote: added 1 changesets with 1 changes to 1 files |
|
699 | remote: added 1 changesets with 1 changes to 1 files | |
700 | remote: Fail early! |
|
700 | remote: Fail early! | |
701 | remote: transaction abort! |
|
701 | remote: transaction abort! | |
702 | remote: Cleaning up the mess... |
|
702 | remote: Cleaning up the mess... | |
703 | remote: rollback completed |
|
703 | remote: rollback completed | |
704 | remote: pretxnchangegroup hook exited with status 1 |
|
704 | remote: pretxnchangegroup hook exited with status 1 | |
705 | abort: push failed on remote |
|
705 | abort: push failed on remote | |
706 | [255] |
|
706 | [255] | |
707 |
|
707 | |||
708 | Check output capture control. |
|
708 | Check output capture control. | |
709 |
|
709 | |||
710 | (should be still forced for http, disabled for local and ssh) |
|
710 | (should be still forced for http, disabled for local and ssh) | |
711 |
|
711 | |||
712 | $ cat >> $HGRCPATH << EOF |
|
712 | $ cat >> $HGRCPATH << EOF | |
713 | > [experimental] |
|
713 | > [experimental] | |
714 | > bundle2-output-capture=False |
|
714 | > bundle2-output-capture=False | |
715 | > EOF |
|
715 | > EOF | |
716 |
|
716 | |||
717 | $ hg -R main push other -r e7ec4e813ba6 |
|
717 | $ hg -R main push other -r e7ec4e813ba6 | |
718 | pushing to other |
|
718 | pushing to other | |
719 | searching for changes |
|
719 | searching for changes | |
720 | adding changesets |
|
720 | adding changesets | |
721 | adding manifests |
|
721 | adding manifests | |
722 | adding file changes |
|
722 | adding file changes | |
723 | added 1 changesets with 1 changes to 1 files |
|
723 | added 1 changesets with 1 changes to 1 files | |
724 | Fail early! |
|
724 | Fail early! | |
725 | transaction abort! |
|
725 | transaction abort! | |
726 | Cleaning up the mess... |
|
726 | Cleaning up the mess... | |
727 | rollback completed |
|
727 | rollback completed | |
728 | abort: pretxnchangegroup hook exited with status 1 |
|
728 | abort: pretxnchangegroup hook exited with status 1 | |
729 | [255] |
|
729 | [255] | |
730 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
730 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
731 | pushing to ssh://user@dummy/other |
|
731 | pushing to ssh://user@dummy/other | |
732 | searching for changes |
|
732 | searching for changes | |
733 | remote: adding changesets |
|
733 | remote: adding changesets | |
734 | remote: adding manifests |
|
734 | remote: adding manifests | |
735 | remote: adding file changes |
|
735 | remote: adding file changes | |
736 | remote: added 1 changesets with 1 changes to 1 files |
|
736 | remote: added 1 changesets with 1 changes to 1 files | |
737 | remote: Fail early! |
|
737 | remote: Fail early! | |
738 | remote: transaction abort! |
|
738 | remote: transaction abort! | |
739 | remote: Cleaning up the mess... |
|
739 | remote: Cleaning up the mess... | |
740 | remote: rollback completed |
|
740 | remote: rollback completed | |
741 | remote: pretxnchangegroup hook exited with status 1 |
|
741 | remote: pretxnchangegroup hook exited with status 1 | |
742 | abort: push failed on remote |
|
742 | abort: push failed on remote | |
743 | [255] |
|
743 | [255] | |
744 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
744 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
745 | pushing to http://localhost:$HGPORT2/ |
|
745 | pushing to http://localhost:$HGPORT2/ | |
746 | searching for changes |
|
746 | searching for changes | |
747 | remote: adding changesets |
|
747 | remote: adding changesets | |
748 | remote: adding manifests |
|
748 | remote: adding manifests | |
749 | remote: adding file changes |
|
749 | remote: adding file changes | |
750 | remote: added 1 changesets with 1 changes to 1 files |
|
750 | remote: added 1 changesets with 1 changes to 1 files | |
751 | remote: Fail early! |
|
751 | remote: Fail early! | |
752 | remote: transaction abort! |
|
752 | remote: transaction abort! | |
753 | remote: Cleaning up the mess... |
|
753 | remote: Cleaning up the mess... | |
754 | remote: rollback completed |
|
754 | remote: rollback completed | |
755 | remote: pretxnchangegroup hook exited with status 1 |
|
755 | remote: pretxnchangegroup hook exited with status 1 | |
756 | abort: push failed on remote |
|
756 | abort: push failed on remote | |
757 | [255] |
|
757 | [255] | |
758 |
|
758 | |||
759 | Check abort from mandatory pushkey |
|
759 | Check abort from mandatory pushkey | |
760 |
|
760 | |||
761 | $ cat > mandatorypart.py << EOF |
|
761 | $ cat > mandatorypart.py << EOF | |
762 | > from mercurial import exchange |
|
762 | > from mercurial import exchange | |
763 | > from mercurial import pushkey |
|
763 | > from mercurial import pushkey | |
764 | > from mercurial import node |
|
764 | > from mercurial import node | |
765 | > from mercurial import error |
|
765 | > from mercurial import error | |
766 | > @exchange.b2partsgenerator('failingpuskey') |
|
766 | > @exchange.b2partsgenerator('failingpuskey') | |
767 | > def addfailingpushey(pushop, bundler): |
|
767 | > def addfailingpushey(pushop, bundler): | |
768 | > enc = pushkey.encode |
|
768 | > enc = pushkey.encode | |
769 | > part = bundler.newpart('pushkey') |
|
769 | > part = bundler.newpart('pushkey') | |
770 | > part.addparam('namespace', enc('phases')) |
|
770 | > part.addparam('namespace', enc('phases')) | |
771 | > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex())) |
|
771 | > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex())) | |
772 | > part.addparam('old', enc(str(0))) # successful update |
|
772 | > part.addparam('old', enc(str(0))) # successful update | |
773 | > part.addparam('new', enc(str(0))) |
|
773 | > part.addparam('new', enc(str(0))) | |
774 | > def fail(pushop, exc): |
|
774 | > def fail(pushop, exc): | |
775 | > raise error.Abort('Correct phase push failed (because hooks)') |
|
775 | > raise error.Abort('Correct phase push failed (because hooks)') | |
776 | > pushop.pkfailcb[part.id] = fail |
|
776 | > pushop.pkfailcb[part.id] = fail | |
777 | > EOF |
|
777 | > EOF | |
778 | $ cat >> $HGRCPATH << EOF |
|
778 | $ cat >> $HGRCPATH << EOF | |
779 | > [hooks] |
|
779 | > [hooks] | |
780 | > pretxnchangegroup= |
|
780 | > pretxnchangegroup= | |
781 | > pretxnclose.failpush= |
|
781 | > pretxnclose.failpush= | |
782 | > prepushkey.failpush = sh -c "echo 'do not push the key !'; false" |
|
782 | > prepushkey.failpush = sh -c "echo 'do not push the key !'; false" | |
783 | > [extensions] |
|
783 | > [extensions] | |
784 | > mandatorypart=$TESTTMP/mandatorypart.py |
|
784 | > mandatorypart=$TESTTMP/mandatorypart.py | |
785 | > EOF |
|
785 | > EOF | |
786 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config |
|
786 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config | |
787 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
787 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log | |
788 | $ cat other.pid >> $DAEMON_PIDS |
|
788 | $ cat other.pid >> $DAEMON_PIDS | |
789 |
|
789 | |||
790 | (Failure from a hook) |
|
790 | (Failure from a hook) | |
791 |
|
791 | |||
792 | $ hg -R main push other -r e7ec4e813ba6 |
|
792 | $ hg -R main push other -r e7ec4e813ba6 | |
793 | pushing to other |
|
793 | pushing to other | |
794 | searching for changes |
|
794 | searching for changes | |
795 | adding changesets |
|
795 | adding changesets | |
796 | adding manifests |
|
796 | adding manifests | |
797 | adding file changes |
|
797 | adding file changes | |
798 | added 1 changesets with 1 changes to 1 files |
|
798 | added 1 changesets with 1 changes to 1 files | |
799 | do not push the key ! |
|
799 | do not push the key ! | |
800 | pushkey-abort: prepushkey.failpush hook exited with status 1 |
|
800 | pushkey-abort: prepushkey.failpush hook exited with status 1 | |
801 | transaction abort! |
|
801 | transaction abort! | |
802 | Cleaning up the mess... |
|
802 | Cleaning up the mess... | |
803 | rollback completed |
|
803 | rollback completed | |
804 | abort: Correct phase push failed (because hooks) |
|
804 | abort: Correct phase push failed (because hooks) | |
805 | [255] |
|
805 | [255] | |
806 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
806 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
807 | pushing to ssh://user@dummy/other |
|
807 | pushing to ssh://user@dummy/other | |
808 | searching for changes |
|
808 | searching for changes | |
809 | remote: adding changesets |
|
809 | remote: adding changesets | |
810 | remote: adding manifests |
|
810 | remote: adding manifests | |
811 | remote: adding file changes |
|
811 | remote: adding file changes | |
812 | remote: added 1 changesets with 1 changes to 1 files |
|
812 | remote: added 1 changesets with 1 changes to 1 files | |
813 | remote: do not push the key ! |
|
813 | remote: do not push the key ! | |
814 | remote: pushkey-abort: prepushkey.failpush hook exited with status 1 |
|
814 | remote: pushkey-abort: prepushkey.failpush hook exited with status 1 | |
815 | remote: transaction abort! |
|
815 | remote: transaction abort! | |
816 | remote: Cleaning up the mess... |
|
816 | remote: Cleaning up the mess... | |
817 | remote: rollback completed |
|
817 | remote: rollback completed | |
818 | abort: Correct phase push failed (because hooks) |
|
818 | abort: Correct phase push failed (because hooks) | |
819 | [255] |
|
819 | [255] | |
820 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
820 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
821 | pushing to http://localhost:$HGPORT2/ |
|
821 | pushing to http://localhost:$HGPORT2/ | |
822 | searching for changes |
|
822 | searching for changes | |
823 | remote: adding changesets |
|
823 | remote: adding changesets | |
824 | remote: adding manifests |
|
824 | remote: adding manifests | |
825 | remote: adding file changes |
|
825 | remote: adding file changes | |
826 | remote: added 1 changesets with 1 changes to 1 files |
|
826 | remote: added 1 changesets with 1 changes to 1 files | |
827 | remote: do not push the key ! |
|
827 | remote: do not push the key ! | |
828 | remote: pushkey-abort: prepushkey.failpush hook exited with status 1 |
|
828 | remote: pushkey-abort: prepushkey.failpush hook exited with status 1 | |
829 | remote: transaction abort! |
|
829 | remote: transaction abort! | |
830 | remote: Cleaning up the mess... |
|
830 | remote: Cleaning up the mess... | |
831 | remote: rollback completed |
|
831 | remote: rollback completed | |
832 | abort: Correct phase push failed (because hooks) |
|
832 | abort: Correct phase push failed (because hooks) | |
833 | [255] |
|
833 | [255] | |
834 |
|
834 | |||
835 | (Failure from a the pushkey) |
|
835 | (Failure from a the pushkey) | |
836 |
|
836 | |||
837 | $ cat > mandatorypart.py << EOF |
|
837 | $ cat > mandatorypart.py << EOF | |
838 | > from mercurial import exchange |
|
838 | > from mercurial import exchange | |
839 | > from mercurial import pushkey |
|
839 | > from mercurial import pushkey | |
840 | > from mercurial import node |
|
840 | > from mercurial import node | |
841 | > from mercurial import error |
|
841 | > from mercurial import error | |
842 | > @exchange.b2partsgenerator('failingpuskey') |
|
842 | > @exchange.b2partsgenerator('failingpuskey') | |
843 | > def addfailingpushey(pushop, bundler): |
|
843 | > def addfailingpushey(pushop, bundler): | |
844 | > enc = pushkey.encode |
|
844 | > enc = pushkey.encode | |
845 | > part = bundler.newpart('pushkey') |
|
845 | > part = bundler.newpart('pushkey') | |
846 | > part.addparam('namespace', enc('phases')) |
|
846 | > part.addparam('namespace', enc('phases')) | |
847 | > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex())) |
|
847 | > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex())) | |
848 | > part.addparam('old', enc(str(4))) # will fail |
|
848 | > part.addparam('old', enc(str(4))) # will fail | |
849 | > part.addparam('new', enc(str(3))) |
|
849 | > part.addparam('new', enc(str(3))) | |
850 | > def fail(pushop, exc): |
|
850 | > def fail(pushop, exc): | |
851 | > raise error.Abort('Clown phase push failed') |
|
851 | > raise error.Abort('Clown phase push failed') | |
852 | > pushop.pkfailcb[part.id] = fail |
|
852 | > pushop.pkfailcb[part.id] = fail | |
853 | > EOF |
|
853 | > EOF | |
854 | $ cat >> $HGRCPATH << EOF |
|
854 | $ cat >> $HGRCPATH << EOF | |
855 | > [hooks] |
|
855 | > [hooks] | |
856 | > prepushkey.failpush = |
|
856 | > prepushkey.failpush = | |
857 | > EOF |
|
857 | > EOF | |
858 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config |
|
858 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config | |
859 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
859 | $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log | |
860 | $ cat other.pid >> $DAEMON_PIDS |
|
860 | $ cat other.pid >> $DAEMON_PIDS | |
861 |
|
861 | |||
862 | $ hg -R main push other -r e7ec4e813ba6 |
|
862 | $ hg -R main push other -r e7ec4e813ba6 | |
863 | pushing to other |
|
863 | pushing to other | |
864 | searching for changes |
|
864 | searching for changes | |
865 | adding changesets |
|
865 | adding changesets | |
866 | adding manifests |
|
866 | adding manifests | |
867 | adding file changes |
|
867 | adding file changes | |
868 | added 1 changesets with 1 changes to 1 files |
|
868 | added 1 changesets with 1 changes to 1 files | |
869 | transaction abort! |
|
869 | transaction abort! | |
870 | Cleaning up the mess... |
|
870 | Cleaning up the mess... | |
871 | rollback completed |
|
871 | rollback completed | |
872 | pushkey: lock state after "phases" |
|
872 | pushkey: lock state after "phases" | |
873 | lock: free |
|
873 | lock: free | |
874 | wlock: free |
|
874 | wlock: free | |
875 | abort: Clown phase push failed |
|
875 | abort: Clown phase push failed | |
876 | [255] |
|
876 | [255] | |
877 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
877 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
878 | pushing to ssh://user@dummy/other |
|
878 | pushing to ssh://user@dummy/other | |
879 | searching for changes |
|
879 | searching for changes | |
880 | remote: adding changesets |
|
880 | remote: adding changesets | |
881 | remote: adding manifests |
|
881 | remote: adding manifests | |
882 | remote: adding file changes |
|
882 | remote: adding file changes | |
883 | remote: added 1 changesets with 1 changes to 1 files |
|
883 | remote: added 1 changesets with 1 changes to 1 files | |
884 | remote: transaction abort! |
|
884 | remote: transaction abort! | |
885 | remote: Cleaning up the mess... |
|
885 | remote: Cleaning up the mess... | |
886 | remote: rollback completed |
|
886 | remote: rollback completed | |
887 | remote: pushkey: lock state after "phases" |
|
887 | remote: pushkey: lock state after "phases" | |
888 | remote: lock: free |
|
888 | remote: lock: free | |
889 | remote: wlock: free |
|
889 | remote: wlock: free | |
890 | abort: Clown phase push failed |
|
890 | abort: Clown phase push failed | |
891 | [255] |
|
891 | [255] | |
892 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
892 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
893 | pushing to http://localhost:$HGPORT2/ |
|
893 | pushing to http://localhost:$HGPORT2/ | |
894 | searching for changes |
|
894 | searching for changes | |
895 | remote: adding changesets |
|
895 | remote: adding changesets | |
896 | remote: adding manifests |
|
896 | remote: adding manifests | |
897 | remote: adding file changes |
|
897 | remote: adding file changes | |
898 | remote: added 1 changesets with 1 changes to 1 files |
|
898 | remote: added 1 changesets with 1 changes to 1 files | |
899 | remote: transaction abort! |
|
899 | remote: transaction abort! | |
900 | remote: Cleaning up the mess... |
|
900 | remote: Cleaning up the mess... | |
901 | remote: rollback completed |
|
901 | remote: rollback completed | |
902 | remote: pushkey: lock state after "phases" |
|
902 | remote: pushkey: lock state after "phases" | |
903 | remote: lock: free |
|
903 | remote: lock: free | |
904 | remote: wlock: free |
|
904 | remote: wlock: free | |
905 | abort: Clown phase push failed |
|
905 | abort: Clown phase push failed | |
906 | [255] |
|
906 | [255] | |
907 |
|
907 | |||
908 | Test lazily acquiring the lock during unbundle |
|
908 | Test lazily acquiring the lock during unbundle | |
909 | $ cp $TESTTMP/hgrc.orig $HGRCPATH |
|
909 | $ cp $TESTTMP/hgrc.orig $HGRCPATH | |
910 | $ cat >> $HGRCPATH <<EOF |
|
910 | $ cat >> $HGRCPATH <<EOF | |
911 | > [ui] |
|
911 | > [ui] | |
912 | > ssh=python "$TESTDIR/dummyssh" |
|
912 | > ssh=python "$TESTDIR/dummyssh" | |
913 | > EOF |
|
913 | > EOF | |
914 |
|
914 | |||
915 | $ cat >> $TESTTMP/locktester.py <<EOF |
|
915 | $ cat >> $TESTTMP/locktester.py <<EOF | |
916 | > import os |
|
916 | > import os | |
917 | > from mercurial import extensions, bundle2, util |
|
917 | > from mercurial import extensions, bundle2, util | |
918 | > def checklock(orig, repo, *args, **kwargs): |
|
918 | > def checklock(orig, repo, *args, **kwargs): | |
919 | > if repo.svfs.lexists("lock"): |
|
919 | > if repo.svfs.lexists("lock"): | |
920 | > raise util.Abort("Lock should not be taken") |
|
920 | > raise util.Abort("Lock should not be taken") | |
921 | > return orig(repo, *args, **kwargs) |
|
921 | > return orig(repo, *args, **kwargs) | |
922 | > def extsetup(ui): |
|
922 | > def extsetup(ui): | |
923 | > extensions.wrapfunction(bundle2, 'processbundle', checklock) |
|
923 | > extensions.wrapfunction(bundle2, 'processbundle', checklock) | |
924 | > EOF |
|
924 | > EOF | |
925 |
|
925 | |||
926 | $ hg init lazylock |
|
926 | $ hg init lazylock | |
927 | $ cat >> lazylock/.hg/hgrc <<EOF |
|
927 | $ cat >> lazylock/.hg/hgrc <<EOF | |
928 | > [extensions] |
|
928 | > [extensions] | |
929 | > locktester=$TESTTMP/locktester.py |
|
929 | > locktester=$TESTTMP/locktester.py | |
930 | > EOF |
|
930 | > EOF | |
931 |
|
931 | |||
932 | $ hg clone -q ssh://user@dummy/lazylock lazylockclient |
|
932 | $ hg clone -q ssh://user@dummy/lazylock lazylockclient | |
933 | $ cd lazylockclient |
|
933 | $ cd lazylockclient | |
934 | $ touch a && hg ci -Aqm a |
|
934 | $ touch a && hg ci -Aqm a | |
935 | $ hg push |
|
935 | $ hg push | |
936 | pushing to ssh://user@dummy/lazylock |
|
936 | pushing to ssh://user@dummy/lazylock | |
937 | searching for changes |
|
937 | searching for changes | |
938 | remote: Lock should not be taken |
|
938 | remote: Lock should not be taken | |
939 | abort: push failed on remote |
|
939 | abort: push failed on remote | |
940 | [255] |
|
940 | [255] | |
941 |
|
941 | |||
942 | $ cat >> ../lazylock/.hg/hgrc <<EOF |
|
942 | $ cat >> ../lazylock/.hg/hgrc <<EOF | |
943 | > [experimental] |
|
943 | > [experimental] | |
944 | > bundle2lazylocking=True |
|
944 | > bundle2lazylocking=True | |
945 | > EOF |
|
945 | > EOF | |
946 | $ hg push |
|
946 | $ hg push | |
947 | pushing to ssh://user@dummy/lazylock |
|
947 | pushing to ssh://user@dummy/lazylock | |
948 | searching for changes |
|
948 | searching for changes | |
949 | remote: adding changesets |
|
949 | remote: adding changesets | |
950 | remote: adding manifests |
|
950 | remote: adding manifests | |
951 | remote: adding file changes |
|
951 | remote: adding file changes | |
952 | remote: added 1 changesets with 1 changes to 1 files |
|
952 | remote: added 1 changesets with 1 changes to 1 files | |
953 |
|
953 | |||
954 | $ cd .. |
|
954 | $ cd .. | |
955 |
|
955 | |||
956 | Servers can disable bundle1 for clone/pull operations |
|
956 | Servers can disable bundle1 for clone/pull operations | |
957 |
|
957 | |||
958 | $ killdaemons.py |
|
958 | $ killdaemons.py | |
959 | $ hg init bundle2onlyserver |
|
959 | $ hg init bundle2onlyserver | |
960 | $ cd bundle2onlyserver |
|
960 | $ cd bundle2onlyserver | |
961 | $ cat > .hg/hgrc << EOF |
|
961 | $ cat > .hg/hgrc << EOF | |
962 | > [server] |
|
962 | > [server] | |
963 | > bundle1.pull = false |
|
963 | > bundle1.pull = false | |
964 | > EOF |
|
964 | > EOF | |
965 |
|
965 | |||
966 | $ touch foo |
|
966 | $ touch foo | |
967 | $ hg -q commit -A -m initial |
|
967 | $ hg -q commit -A -m initial | |
968 |
|
968 | |||
969 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
969 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
970 | $ cat hg.pid >> $DAEMON_PIDS |
|
970 | $ cat hg.pid >> $DAEMON_PIDS | |
971 |
|
971 | |||
972 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2 |
|
972 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2 | |
973 | requesting all changes |
|
973 | requesting all changes | |
974 | abort: remote error: |
|
974 | abort: remote error: | |
975 | incompatible Mercurial client; bundle2 required |
|
975 | incompatible Mercurial client; bundle2 required | |
976 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
976 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
977 | [255] |
|
977 | [255] | |
978 | $ killdaemons.py |
|
978 | $ killdaemons.py | |
979 | $ cd .. |
|
979 | $ cd .. | |
980 |
|
980 | |||
981 | bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled |
|
981 | bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled | |
982 |
|
982 | |||
983 | $ hg --config format.usegeneraldelta=false init notgdserver |
|
983 | $ hg --config format.usegeneraldelta=false init notgdserver | |
984 | $ cd notgdserver |
|
984 | $ cd notgdserver | |
985 | $ cat > .hg/hgrc << EOF |
|
985 | $ cat > .hg/hgrc << EOF | |
986 | > [server] |
|
986 | > [server] | |
987 | > bundle1gd.pull = false |
|
987 | > bundle1gd.pull = false | |
988 | > EOF |
|
988 | > EOF | |
989 |
|
989 | |||
990 | $ touch foo |
|
990 | $ touch foo | |
991 | $ hg -q commit -A -m initial |
|
991 | $ hg -q commit -A -m initial | |
992 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
992 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
993 | $ cat hg.pid >> $DAEMON_PIDS |
|
993 | $ cat hg.pid >> $DAEMON_PIDS | |
994 |
|
994 | |||
995 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1 |
|
995 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1 | |
996 | requesting all changes |
|
996 | requesting all changes | |
997 | adding changesets |
|
997 | adding changesets | |
998 | adding manifests |
|
998 | adding manifests | |
999 | adding file changes |
|
999 | adding file changes | |
1000 | added 1 changesets with 1 changes to 1 files |
|
1000 | added 1 changesets with 1 changes to 1 files | |
1001 | updating to branch default |
|
1001 | updating to branch default | |
1002 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1002 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1003 |
|
1003 | |||
1004 | $ killdaemons.py |
|
1004 | $ killdaemons.py | |
1005 | $ cd ../bundle2onlyserver |
|
1005 | $ cd ../bundle2onlyserver | |
1006 |
|
1006 | |||
1007 | bundle1 pull can be disabled for generaldelta repos only |
|
1007 | bundle1 pull can be disabled for generaldelta repos only | |
1008 |
|
1008 | |||
1009 | $ cat > .hg/hgrc << EOF |
|
1009 | $ cat > .hg/hgrc << EOF | |
1010 | > [server] |
|
1010 | > [server] | |
1011 | > bundle1gd.pull = false |
|
1011 | > bundle1gd.pull = false | |
1012 | > EOF |
|
1012 | > EOF | |
1013 |
|
1013 | |||
1014 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
1014 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
1015 | $ cat hg.pid >> $DAEMON_PIDS |
|
1015 | $ cat hg.pid >> $DAEMON_PIDS | |
1016 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2 |
|
1016 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2 | |
1017 | requesting all changes |
|
1017 | requesting all changes | |
1018 | abort: remote error: |
|
1018 | abort: remote error: | |
1019 | incompatible Mercurial client; bundle2 required |
|
1019 | incompatible Mercurial client; bundle2 required | |
1020 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1020 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1021 | [255] |
|
1021 | [255] | |
1022 |
|
1022 | |||
1023 | $ killdaemons.py |
|
1023 | $ killdaemons.py | |
1024 |
|
1024 | |||
1025 | Verify the global server.bundle1 option works |
|
1025 | Verify the global server.bundle1 option works | |
1026 |
|
1026 | |||
1027 | $ cd .. |
|
1027 | $ cd .. | |
1028 | $ cat > bundle2onlyserver/.hg/hgrc << EOF |
|
1028 | $ cat > bundle2onlyserver/.hg/hgrc << EOF | |
1029 | > [server] |
|
1029 | > [server] | |
1030 | > bundle1 = false |
|
1030 | > bundle1 = false | |
1031 | > EOF |
|
1031 | > EOF | |
1032 | $ hg -R bundle2onlyserver serve -p $HGPORT -d --pid-file=hg.pid |
|
1032 | $ hg -R bundle2onlyserver serve -p $HGPORT -d --pid-file=hg.pid | |
1033 | $ cat hg.pid >> $DAEMON_PIDS |
|
1033 | $ cat hg.pid >> $DAEMON_PIDS | |
1034 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2 |
|
1034 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2 | |
1035 | requesting all changes |
|
1035 | requesting all changes | |
1036 | abort: remote error: |
|
1036 | abort: remote error: | |
1037 | incompatible Mercurial client; bundle2 required |
|
1037 | incompatible Mercurial client; bundle2 required | |
1038 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1038 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1039 | [255] |
|
1039 | [255] | |
1040 | $ killdaemons.py |
|
1040 | $ killdaemons.py | |
1041 |
|
1041 | |||
1042 | $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh |
|
1042 | $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh | |
1043 | requesting all changes |
|
1043 | requesting all changes | |
1044 | adding changesets |
|
1044 | adding changesets | |
1045 | remote: abort: incompatible Mercurial client; bundle2 required |
|
1045 | remote: abort: incompatible Mercurial client; bundle2 required | |
1046 | remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1046 | remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1047 | transaction abort! |
|
1047 | transaction abort! | |
1048 | rollback completed |
|
1048 | rollback completed | |
1049 | abort: stream ended unexpectedly (got 0 bytes, expected 4) |
|
1049 | abort: stream ended unexpectedly (got 0 bytes, expected 4) | |
1050 | [255] |
|
1050 | [255] | |
1051 |
|
1051 | |||
1052 | $ cat > bundle2onlyserver/.hg/hgrc << EOF |
|
1052 | $ cat > bundle2onlyserver/.hg/hgrc << EOF | |
1053 | > [server] |
|
1053 | > [server] | |
1054 | > bundle1gd = false |
|
1054 | > bundle1gd = false | |
1055 | > EOF |
|
1055 | > EOF | |
1056 | $ hg -R bundle2onlyserver serve -p $HGPORT -d --pid-file=hg.pid |
|
1056 | $ hg -R bundle2onlyserver serve -p $HGPORT -d --pid-file=hg.pid | |
1057 | $ cat hg.pid >> $DAEMON_PIDS |
|
1057 | $ cat hg.pid >> $DAEMON_PIDS | |
1058 |
|
1058 | |||
1059 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2 |
|
1059 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2 | |
1060 | requesting all changes |
|
1060 | requesting all changes | |
1061 | abort: remote error: |
|
1061 | abort: remote error: | |
1062 | incompatible Mercurial client; bundle2 required |
|
1062 | incompatible Mercurial client; bundle2 required | |
1063 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1063 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1064 | [255] |
|
1064 | [255] | |
1065 |
|
1065 | |||
1066 | $ killdaemons.py |
|
1066 | $ killdaemons.py | |
1067 |
|
1067 | |||
1068 | $ cd notgdserver |
|
1068 | $ cd notgdserver | |
1069 | $ cat > .hg/hgrc << EOF |
|
1069 | $ cat > .hg/hgrc << EOF | |
1070 | > [server] |
|
1070 | > [server] | |
1071 | > bundle1gd = false |
|
1071 | > bundle1gd = false | |
1072 | > EOF |
|
1072 | > EOF | |
1073 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
1073 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
1074 | $ cat hg.pid >> $DAEMON_PIDS |
|
1074 | $ cat hg.pid >> $DAEMON_PIDS | |
1075 |
|
1075 | |||
1076 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2 |
|
1076 | $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2 | |
1077 | requesting all changes |
|
1077 | requesting all changes | |
1078 | adding changesets |
|
1078 | adding changesets | |
1079 | adding manifests |
|
1079 | adding manifests | |
1080 | adding file changes |
|
1080 | adding file changes | |
1081 | added 1 changesets with 1 changes to 1 files |
|
1081 | added 1 changesets with 1 changes to 1 files | |
1082 | updating to branch default |
|
1082 | updating to branch default | |
1083 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1083 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1084 |
|
1084 | |||
1085 | $ killdaemons.py |
|
1085 | $ killdaemons.py | |
1086 | $ cd ../bundle2onlyserver |
|
1086 | $ cd ../bundle2onlyserver | |
1087 |
|
1087 | |||
1088 | Verify bundle1 pushes can be disabled |
|
1088 | Verify bundle1 pushes can be disabled | |
1089 |
|
1089 | |||
1090 | $ cat > .hg/hgrc << EOF |
|
1090 | $ cat > .hg/hgrc << EOF | |
1091 | > [server] |
|
1091 | > [server] | |
1092 | > bundle1.push = false |
|
1092 | > bundle1.push = false | |
1093 | > [web] |
|
1093 | > [web] | |
1094 | > allow_push = * |
|
1094 | > allow_push = * | |
1095 | > push_ssl = false |
|
1095 | > push_ssl = false | |
1096 | > EOF |
|
1096 | > EOF | |
1097 |
|
1097 | |||
1098 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
|
1098 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log | |
1099 | $ cat hg.pid >> $DAEMON_PIDS |
|
1099 | $ cat hg.pid >> $DAEMON_PIDS | |
1100 | $ cd .. |
|
1100 | $ cd .. | |
1101 |
|
1101 | |||
1102 | $ hg clone http://localhost:$HGPORT bundle2-only |
|
1102 | $ hg clone http://localhost:$HGPORT bundle2-only | |
1103 | requesting all changes |
|
1103 | requesting all changes | |
1104 | adding changesets |
|
1104 | adding changesets | |
1105 | adding manifests |
|
1105 | adding manifests | |
1106 | adding file changes |
|
1106 | adding file changes | |
1107 | added 1 changesets with 1 changes to 1 files |
|
1107 | added 1 changesets with 1 changes to 1 files | |
1108 | updating to branch default |
|
1108 | updating to branch default | |
1109 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1109 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1110 | $ cd bundle2-only |
|
1110 | $ cd bundle2-only | |
1111 | $ echo commit > foo |
|
1111 | $ echo commit > foo | |
1112 | $ hg commit -m commit |
|
1112 | $ hg commit -m commit | |
1113 | $ hg --config devel.legacy.exchange=bundle1 push |
|
1113 | $ hg --config devel.legacy.exchange=bundle1 push | |
1114 | pushing to http://localhost:$HGPORT/ |
|
1114 | pushing to http://localhost:$HGPORT/ | |
1115 | searching for changes |
|
1115 | searching for changes | |
1116 | abort: remote error: |
|
1116 | abort: remote error: | |
1117 | incompatible Mercurial client; bundle2 required |
|
1117 | incompatible Mercurial client; bundle2 required | |
1118 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1118 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1119 | [255] |
|
1119 | [255] | |
1120 |
|
1120 | |||
1121 | (also check with ssh) |
|
1121 | (also check with ssh) | |
1122 |
|
1122 | |||
1123 | $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver |
|
1123 | $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver | |
1124 | pushing to ssh://user@dummy/bundle2onlyserver |
|
1124 | pushing to ssh://user@dummy/bundle2onlyserver | |
1125 | searching for changes |
|
1125 | searching for changes | |
1126 | remote: abort: incompatible Mercurial client; bundle2 required |
|
1126 | remote: abort: incompatible Mercurial client; bundle2 required | |
1127 | remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1127 | remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1128 | [1] |
|
1128 | [1] | |
1129 |
|
1129 | |||
1130 | $ hg push |
|
1130 | $ hg push | |
1131 | pushing to http://localhost:$HGPORT/ |
|
1131 | pushing to http://localhost:$HGPORT/ | |
1132 | searching for changes |
|
1132 | searching for changes | |
1133 | remote: adding changesets |
|
1133 | remote: adding changesets | |
1134 | remote: adding manifests |
|
1134 | remote: adding manifests | |
1135 | remote: adding file changes |
|
1135 | remote: adding file changes | |
1136 | remote: added 1 changesets with 1 changes to 1 files |
|
1136 | remote: added 1 changesets with 1 changes to 1 files |
@@ -1,260 +1,260 | |||||
1 | Create an extension to test bundle2 with multiple changegroups |
|
1 | Create an extension to test bundle2 with multiple changegroups | |
2 |
|
2 | |||
3 | $ cat > bundle2.py <<EOF |
|
3 | $ cat > bundle2.py <<EOF | |
4 | > """ |
|
4 | > """ | |
5 | > """ |
|
5 | > """ | |
6 | > from mercurial import changegroup, discovery, exchange |
|
6 | > from mercurial import changegroup, discovery, exchange | |
7 | > |
|
7 | > | |
8 | > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, |
|
8 | > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, | |
9 | > b2caps=None, heads=None, common=None, |
|
9 | > b2caps=None, heads=None, common=None, | |
10 | > **kwargs): |
|
10 | > **kwargs): | |
11 | > # Create two changegroups given the common changesets and heads for the |
|
11 | > # Create two changegroups given the common changesets and heads for the | |
12 | > # changegroup part we are being requested. Use the parent of each head |
|
12 | > # changegroup part we are being requested. Use the parent of each head | |
13 | > # in 'heads' as intermediate heads for the first changegroup. |
|
13 | > # in 'heads' as intermediate heads for the first changegroup. | |
14 | > intermediates = [repo[r].p1().node() for r in heads] |
|
14 | > intermediates = [repo[r].p1().node() for r in heads] | |
15 | > outgoing = discovery.outgoing(repo, common, intermediates) |
|
15 | > outgoing = discovery.outgoing(repo, common, intermediates) | |
16 | > cg = changegroup.getchangegroup(repo, source, outgoing, |
|
16 | > cg = changegroup.getchangegroup(repo, source, outgoing, | |
17 | > bundlecaps=bundlecaps) |
|
17 | > bundlecaps=bundlecaps) | |
18 | > bundler.newpart('output', data='changegroup1') |
|
18 | > bundler.newpart('output', data='changegroup1') | |
19 | > bundler.newpart('changegroup', data=cg.getchunks()) |
|
19 | > bundler.newpart('changegroup', data=cg.getchunks()) | |
20 | > outgoing = discovery.outgoing(repo, common + intermediates, heads) |
|
20 | > outgoing = discovery.outgoing(repo, common + intermediates, heads) | |
21 | > cg = changegroup.getchangegroup(repo, source, outgoing, |
|
21 | > cg = changegroup.getchangegroup(repo, source, outgoing, | |
22 | > bundlecaps=bundlecaps) |
|
22 | > bundlecaps=bundlecaps) | |
23 | > bundler.newpart('output', data='changegroup2') |
|
23 | > bundler.newpart('output', data='changegroup2') | |
24 | > bundler.newpart('changegroup', data=cg.getchunks()) |
|
24 | > bundler.newpart('changegroup', data=cg.getchunks()) | |
25 | > |
|
25 | > | |
26 | > def _pull(repo, *args, **kwargs): |
|
26 | > def _pull(repo, *args, **kwargs): | |
27 | > pullop = _orig_pull(repo, *args, **kwargs) |
|
27 | > pullop = _orig_pull(repo, *args, **kwargs) | |
28 | > repo.ui.write('pullop.cgresult is %d\n' % pullop.cgresult) |
|
28 | > repo.ui.write('pullop.cgresult is %d\n' % pullop.cgresult) | |
29 | > return pullop |
|
29 | > return pullop | |
30 | > |
|
30 | > | |
31 | > _orig_pull = exchange.pull |
|
31 | > _orig_pull = exchange.pull | |
32 | > exchange.pull = _pull |
|
32 | > exchange.pull = _pull | |
33 | > exchange.getbundle2partsmapping['changegroup'] = _getbundlechangegrouppart |
|
33 | > exchange.getbundle2partsmapping['changegroup'] = _getbundlechangegrouppart | |
34 | > EOF |
|
34 | > EOF | |
35 |
|
35 | |||
36 | $ cat >> $HGRCPATH << EOF |
|
36 | $ cat >> $HGRCPATH << EOF | |
37 | > [ui] |
|
37 | > [ui] | |
38 | > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} |
|
38 | > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} | |
39 | > EOF |
|
39 | > EOF | |
40 |
|
40 | |||
41 | Start with a simple repository with a single commit |
|
41 | Start with a simple repository with a single commit | |
42 |
|
42 | |||
43 | $ hg init repo |
|
43 | $ hg init repo | |
44 | $ cd repo |
|
44 | $ cd repo | |
45 | $ cat > .hg/hgrc << EOF |
|
45 | $ cat > .hg/hgrc << EOF | |
46 | > [extensions] |
|
46 | > [extensions] | |
47 | > bundle2=$TESTTMP/bundle2.py |
|
47 | > bundle2=$TESTTMP/bundle2.py | |
48 | > EOF |
|
48 | > EOF | |
49 |
|
49 | |||
50 | $ echo A > A |
|
50 | $ echo A > A | |
51 | $ hg commit -A -m A -q |
|
51 | $ hg commit -A -m A -q | |
52 | $ cd .. |
|
52 | $ cd .. | |
53 |
|
53 | |||
54 | Clone |
|
54 | Clone | |
55 |
|
55 | |||
56 | $ hg clone -q repo clone |
|
56 | $ hg clone -q repo clone | |
57 |
|
57 | |||
58 | Add two linear commits |
|
58 | Add two linear commits | |
59 |
|
59 | |||
60 | $ cd repo |
|
60 | $ cd repo | |
61 | $ echo B > B |
|
61 | $ echo B > B | |
62 | $ hg commit -A -m B -q |
|
62 | $ hg commit -A -m B -q | |
63 | $ echo C > C |
|
63 | $ echo C > C | |
64 | $ hg commit -A -m C -q |
|
64 | $ hg commit -A -m C -q | |
65 |
|
65 | |||
66 | $ cd ../clone |
|
66 | $ cd ../clone | |
67 | $ cat >> .hg/hgrc <<EOF |
|
67 | $ cat >> .hg/hgrc <<EOF | |
68 | > [hooks] |
|
68 | > [hooks] | |
69 | > pretxnchangegroup = sh -c "printenv.py pretxnchangegroup" |
|
69 | > pretxnchangegroup = sh -c "printenv.py pretxnchangegroup" | |
70 | > changegroup = sh -c "printenv.py changegroup" |
|
70 | > changegroup = sh -c "printenv.py changegroup" | |
71 | > incoming = sh -c "printenv.py incoming" |
|
71 | > incoming = sh -c "printenv.py incoming" | |
72 | > EOF |
|
72 | > EOF | |
73 |
|
73 | |||
74 | Pull the new commits in the clone |
|
74 | Pull the new commits in the clone | |
75 |
|
75 | |||
76 | $ hg pull |
|
76 | $ hg pull | |
77 | pulling from $TESTTMP/repo (glob) |
|
77 | pulling from $TESTTMP/repo (glob) | |
78 | searching for changes |
|
78 | searching for changes | |
79 | remote: changegroup1 |
|
79 | remote: changegroup1 | |
80 | adding changesets |
|
80 | adding changesets | |
81 | adding manifests |
|
81 | adding manifests | |
82 | adding file changes |
|
82 | adding file changes | |
83 | added 1 changesets with 1 changes to 1 files |
|
83 | added 1 changesets with 1 changes to 1 files | |
84 | pretxnchangegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
84 | pretxnchangegroup hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
85 | remote: changegroup2 |
|
85 | remote: changegroup2 | |
86 | adding changesets |
|
86 | adding changesets | |
87 | adding manifests |
|
87 | adding manifests | |
88 | adding file changes |
|
88 | adding file changes | |
89 | added 1 changesets with 1 changes to 1 files |
|
89 | added 1 changesets with 1 changes to 1 files | |
90 | pretxnchangegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
90 | pretxnchangegroup hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
91 | changegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
91 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
92 | incoming hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
92 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
93 | changegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
93 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
94 | incoming hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
94 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
95 | pullop.cgresult is 1 |
|
95 | pullop.cgresult is 1 | |
96 | (run 'hg update' to get a working copy) |
|
96 | (run 'hg update' to get a working copy) | |
97 | $ hg update |
|
97 | $ hg update | |
98 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
98 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
99 | $ hg log -G |
|
99 | $ hg log -G | |
100 | @ 2:f838bfaca5c7 public test C |
|
100 | @ 2:f838bfaca5c7 public test C | |
101 | | |
|
101 | | | |
102 | o 1:27547f69f254 public test B |
|
102 | o 1:27547f69f254 public test B | |
103 | | |
|
103 | | | |
104 | o 0:4a2df7238c3b public test A |
|
104 | o 0:4a2df7238c3b public test A | |
105 |
|
105 | |||
106 | Add more changesets with multiple heads to the original repository |
|
106 | Add more changesets with multiple heads to the original repository | |
107 |
|
107 | |||
108 | $ cd ../repo |
|
108 | $ cd ../repo | |
109 | $ echo D > D |
|
109 | $ echo D > D | |
110 | $ hg commit -A -m D -q |
|
110 | $ hg commit -A -m D -q | |
111 | $ hg up -r 1 |
|
111 | $ hg up -r 1 | |
112 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
112 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
113 | $ echo E > E |
|
113 | $ echo E > E | |
114 | $ hg commit -A -m E -q |
|
114 | $ hg commit -A -m E -q | |
115 | $ echo F > F |
|
115 | $ echo F > F | |
116 | $ hg commit -A -m F -q |
|
116 | $ hg commit -A -m F -q | |
117 | $ hg up -r 1 |
|
117 | $ hg up -r 1 | |
118 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
118 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
119 | $ echo G > G |
|
119 | $ echo G > G | |
120 | $ hg commit -A -m G -q |
|
120 | $ hg commit -A -m G -q | |
121 | $ hg up -r 3 |
|
121 | $ hg up -r 3 | |
122 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
122 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
123 | $ echo H > H |
|
123 | $ echo H > H | |
124 | $ hg commit -A -m H -q |
|
124 | $ hg commit -A -m H -q | |
125 | $ hg log -G |
|
125 | $ hg log -G | |
126 | @ 7:5cd59d311f65 draft test H |
|
126 | @ 7:5cd59d311f65 draft test H | |
127 | | |
|
127 | | | |
128 | | o 6:1d14c3ce6ac0 draft test G |
|
128 | | o 6:1d14c3ce6ac0 draft test G | |
129 | | | |
|
129 | | | | |
130 | | | o 5:7f219660301f draft test F |
|
130 | | | o 5:7f219660301f draft test F | |
131 | | | | |
|
131 | | | | | |
132 | | | o 4:8a5212ebc852 draft test E |
|
132 | | | o 4:8a5212ebc852 draft test E | |
133 | | |/ |
|
133 | | |/ | |
134 | o | 3:b3325c91a4d9 draft test D |
|
134 | o | 3:b3325c91a4d9 draft test D | |
135 | | | |
|
135 | | | | |
136 | o | 2:f838bfaca5c7 draft test C |
|
136 | o | 2:f838bfaca5c7 draft test C | |
137 | |/ |
|
137 | |/ | |
138 | o 1:27547f69f254 draft test B |
|
138 | o 1:27547f69f254 draft test B | |
139 | | |
|
139 | | | |
140 | o 0:4a2df7238c3b draft test A |
|
140 | o 0:4a2df7238c3b draft test A | |
141 |
|
141 | |||
142 | New heads are reported during transfer and properly accounted for in |
|
142 | New heads are reported during transfer and properly accounted for in | |
143 | pullop.cgresult |
|
143 | pullop.cgresult | |
144 |
|
144 | |||
145 | $ cd ../clone |
|
145 | $ cd ../clone | |
146 | $ hg pull |
|
146 | $ hg pull | |
147 | pulling from $TESTTMP/repo (glob) |
|
147 | pulling from $TESTTMP/repo (glob) | |
148 | searching for changes |
|
148 | searching for changes | |
149 | remote: changegroup1 |
|
149 | remote: changegroup1 | |
150 | adding changesets |
|
150 | adding changesets | |
151 | adding manifests |
|
151 | adding manifests | |
152 | adding file changes |
|
152 | adding file changes | |
153 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
153 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
154 | pretxnchangegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
154 | pretxnchangegroup hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
155 | remote: changegroup2 |
|
155 | remote: changegroup2 | |
156 | adding changesets |
|
156 | adding changesets | |
157 | adding manifests |
|
157 | adding manifests | |
158 | adding file changes |
|
158 | adding file changes | |
159 | added 3 changesets with 3 changes to 3 files (+1 heads) |
|
159 | added 3 changesets with 3 changes to 3 files (+1 heads) | |
160 | pretxnchangegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
160 | pretxnchangegroup hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
161 | changegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
161 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
162 | incoming hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
162 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
163 | incoming hook: HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
163 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
164 | changegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
164 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
165 | incoming hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
165 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
166 | incoming hook: HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
166 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
167 | incoming hook: HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
167 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
168 | pullop.cgresult is 3 |
|
168 | pullop.cgresult is 3 | |
169 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
169 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
170 | $ hg log -G |
|
170 | $ hg log -G | |
171 | o 7:5cd59d311f65 public test H |
|
171 | o 7:5cd59d311f65 public test H | |
172 | | |
|
172 | | | |
173 | | o 6:1d14c3ce6ac0 public test G |
|
173 | | o 6:1d14c3ce6ac0 public test G | |
174 | | | |
|
174 | | | | |
175 | | | o 5:7f219660301f public test F |
|
175 | | | o 5:7f219660301f public test F | |
176 | | | | |
|
176 | | | | | |
177 | | | o 4:8a5212ebc852 public test E |
|
177 | | | o 4:8a5212ebc852 public test E | |
178 | | |/ |
|
178 | | |/ | |
179 | o | 3:b3325c91a4d9 public test D |
|
179 | o | 3:b3325c91a4d9 public test D | |
180 | | | |
|
180 | | | | |
181 | @ | 2:f838bfaca5c7 public test C |
|
181 | @ | 2:f838bfaca5c7 public test C | |
182 | |/ |
|
182 | |/ | |
183 | o 1:27547f69f254 public test B |
|
183 | o 1:27547f69f254 public test B | |
184 | | |
|
184 | | | |
185 | o 0:4a2df7238c3b public test A |
|
185 | o 0:4a2df7238c3b public test A | |
186 |
|
186 | |||
187 | Removing a head from the original repository by merging it |
|
187 | Removing a head from the original repository by merging it | |
188 |
|
188 | |||
189 | $ cd ../repo |
|
189 | $ cd ../repo | |
190 | $ hg merge -r 6 -q |
|
190 | $ hg merge -r 6 -q | |
191 | $ hg commit -m Merge |
|
191 | $ hg commit -m Merge | |
192 | $ echo I > I |
|
192 | $ echo I > I | |
193 | $ hg commit -A -m H -q |
|
193 | $ hg commit -A -m H -q | |
194 | $ hg log -G |
|
194 | $ hg log -G | |
195 | @ 9:9d18e5bd9ab0 draft test H |
|
195 | @ 9:9d18e5bd9ab0 draft test H | |
196 | | |
|
196 | | | |
197 | o 8:71bd7b46de72 draft test Merge |
|
197 | o 8:71bd7b46de72 draft test Merge | |
198 | |\ |
|
198 | |\ | |
199 | | o 7:5cd59d311f65 draft test H |
|
199 | | o 7:5cd59d311f65 draft test H | |
200 | | | |
|
200 | | | | |
201 | o | 6:1d14c3ce6ac0 draft test G |
|
201 | o | 6:1d14c3ce6ac0 draft test G | |
202 | | | |
|
202 | | | | |
203 | | | o 5:7f219660301f draft test F |
|
203 | | | o 5:7f219660301f draft test F | |
204 | | | | |
|
204 | | | | | |
205 | +---o 4:8a5212ebc852 draft test E |
|
205 | +---o 4:8a5212ebc852 draft test E | |
206 | | | |
|
206 | | | | |
207 | | o 3:b3325c91a4d9 draft test D |
|
207 | | o 3:b3325c91a4d9 draft test D | |
208 | | | |
|
208 | | | | |
209 | | o 2:f838bfaca5c7 draft test C |
|
209 | | o 2:f838bfaca5c7 draft test C | |
210 | |/ |
|
210 | |/ | |
211 | o 1:27547f69f254 draft test B |
|
211 | o 1:27547f69f254 draft test B | |
212 | | |
|
212 | | | |
213 | o 0:4a2df7238c3b draft test A |
|
213 | o 0:4a2df7238c3b draft test A | |
214 |
|
214 | |||
215 | Removed heads are reported during transfer and properly accounted for in |
|
215 | Removed heads are reported during transfer and properly accounted for in | |
216 | pullop.cgresult |
|
216 | pullop.cgresult | |
217 |
|
217 | |||
218 | $ cd ../clone |
|
218 | $ cd ../clone | |
219 | $ hg pull |
|
219 | $ hg pull | |
220 | pulling from $TESTTMP/repo (glob) |
|
220 | pulling from $TESTTMP/repo (glob) | |
221 | searching for changes |
|
221 | searching for changes | |
222 | remote: changegroup1 |
|
222 | remote: changegroup1 | |
223 | adding changesets |
|
223 | adding changesets | |
224 | adding manifests |
|
224 | adding manifests | |
225 | adding file changes |
|
225 | adding file changes | |
226 | added 1 changesets with 0 changes to 0 files (-1 heads) |
|
226 | added 1 changesets with 0 changes to 0 files (-1 heads) | |
227 | pretxnchangegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
227 | pretxnchangegroup hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
228 | remote: changegroup2 |
|
228 | remote: changegroup2 | |
229 | adding changesets |
|
229 | adding changesets | |
230 | adding manifests |
|
230 | adding manifests | |
231 | adding file changes |
|
231 | adding file changes | |
232 | added 1 changesets with 1 changes to 1 files |
|
232 | added 1 changesets with 1 changes to 1 files | |
233 | pretxnchangegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
233 | pretxnchangegroup hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
234 | changegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
234 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
235 | incoming hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
235 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
236 | changegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
236 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
237 | incoming hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo |
|
237 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo | |
238 | pullop.cgresult is -2 |
|
238 | pullop.cgresult is -2 | |
239 | (run 'hg update' to get a working copy) |
|
239 | (run 'hg update' to get a working copy) | |
240 | $ hg log -G |
|
240 | $ hg log -G | |
241 | o 9:9d18e5bd9ab0 public test H |
|
241 | o 9:9d18e5bd9ab0 public test H | |
242 | | |
|
242 | | | |
243 | o 8:71bd7b46de72 public test Merge |
|
243 | o 8:71bd7b46de72 public test Merge | |
244 | |\ |
|
244 | |\ | |
245 | | o 7:5cd59d311f65 public test H |
|
245 | | o 7:5cd59d311f65 public test H | |
246 | | | |
|
246 | | | | |
247 | o | 6:1d14c3ce6ac0 public test G |
|
247 | o | 6:1d14c3ce6ac0 public test G | |
248 | | | |
|
248 | | | | |
249 | | | o 5:7f219660301f public test F |
|
249 | | | o 5:7f219660301f public test F | |
250 | | | | |
|
250 | | | | | |
251 | +---o 4:8a5212ebc852 public test E |
|
251 | +---o 4:8a5212ebc852 public test E | |
252 | | | |
|
252 | | | | |
253 | | o 3:b3325c91a4d9 public test D |
|
253 | | o 3:b3325c91a4d9 public test D | |
254 | | | |
|
254 | | | | |
255 | | @ 2:f838bfaca5c7 public test C |
|
255 | | @ 2:f838bfaca5c7 public test C | |
256 | |/ |
|
256 | |/ | |
257 | o 1:27547f69f254 public test B |
|
257 | o 1:27547f69f254 public test B | |
258 | | |
|
258 | | | |
259 | o 0:4a2df7238c3b public test A |
|
259 | o 0:4a2df7238c3b public test A | |
260 |
|
260 |
@@ -1,935 +1,935 | |||||
1 | commit hooks can see env vars |
|
1 | commit hooks can see env vars | |
2 | (and post-transaction one are run unlocked) |
|
2 | (and post-transaction one are run unlocked) | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | $ cat > $TESTTMP/txnabort.checkargs.py <<EOF |
|
5 | $ cat > $TESTTMP/txnabort.checkargs.py <<EOF | |
6 | > def showargs(ui, repo, hooktype, **kwargs): |
|
6 | > def showargs(ui, repo, hooktype, **kwargs): | |
7 | > ui.write('%s python hook: %s\n' % (hooktype, ','.join(sorted(kwargs)))) |
|
7 | > ui.write('%s python hook: %s\n' % (hooktype, ','.join(sorted(kwargs)))) | |
8 | > EOF |
|
8 | > EOF | |
9 |
|
9 | |||
10 | $ hg init a |
|
10 | $ hg init a | |
11 | $ cd a |
|
11 | $ cd a | |
12 | $ cat > .hg/hgrc <<EOF |
|
12 | $ cat > .hg/hgrc <<EOF | |
13 | > [hooks] |
|
13 | > [hooks] | |
14 | > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit" |
|
14 | > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit" | |
15 | > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b" |
|
15 | > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b" | |
16 | > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit" |
|
16 | > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit" | |
17 | > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit" |
|
17 | > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit" | |
18 | > pretxncommit.tip = hg -q tip |
|
18 | > pretxncommit.tip = hg -q tip | |
19 | > pre-identify = sh -c "printenv.py pre-identify 1" |
|
19 | > pre-identify = sh -c "printenv.py pre-identify 1" | |
20 | > pre-cat = sh -c "printenv.py pre-cat" |
|
20 | > pre-cat = sh -c "printenv.py pre-cat" | |
21 | > post-cat = sh -c "printenv.py post-cat" |
|
21 | > post-cat = sh -c "printenv.py post-cat" | |
22 | > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen" |
|
22 | > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen" | |
23 | > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose" |
|
23 | > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose" | |
24 | > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose" |
|
24 | > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose" | |
25 | > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs |
|
25 | > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs | |
26 | > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort" |
|
26 | > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort" | |
27 | > txnclose.checklock = sh -c "hg debuglock > /dev/null" |
|
27 | > txnclose.checklock = sh -c "hg debuglock > /dev/null" | |
28 | > EOF |
|
28 | > EOF | |
29 | $ echo a > a |
|
29 | $ echo a > a | |
30 | $ hg add a |
|
30 | $ hg add a | |
31 | $ hg commit -m a |
|
31 | $ hg commit -m a | |
32 | precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 |
|
32 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=0000000000000000000000000000000000000000 | |
33 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
33 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
34 | pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a |
|
34 | pretxncommit hook: HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a | |
35 | 0:cb9a9f314b8b |
|
35 | 0:cb9a9f314b8b | |
36 | pretxnclose hook: HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
36 | pretxnclose hook: HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
37 | txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
37 | txnclose hook: HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
38 | commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
|
38 | commit hook: HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 | |
39 | commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
|
39 | commit.b hook: HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 | |
40 |
|
40 | |||
41 | $ hg clone . ../b |
|
41 | $ hg clone . ../b | |
42 | updating to branch default |
|
42 | updating to branch default | |
43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
44 | $ cd ../b |
|
44 | $ cd ../b | |
45 |
|
45 | |||
46 | changegroup hooks can see env vars |
|
46 | changegroup hooks can see env vars | |
47 |
|
47 | |||
48 | $ cat > .hg/hgrc <<EOF |
|
48 | $ cat > .hg/hgrc <<EOF | |
49 | > [hooks] |
|
49 | > [hooks] | |
50 | > prechangegroup = sh -c "printenv.py prechangegroup" |
|
50 | > prechangegroup = sh -c "printenv.py prechangegroup" | |
51 | > changegroup = sh -c "printenv.py changegroup" |
|
51 | > changegroup = sh -c "printenv.py changegroup" | |
52 | > incoming = sh -c "printenv.py incoming" |
|
52 | > incoming = sh -c "printenv.py incoming" | |
53 | > EOF |
|
53 | > EOF | |
54 |
|
54 | |||
55 | pretxncommit and commit hooks can see both parents of merge |
|
55 | pretxncommit and commit hooks can see both parents of merge | |
56 |
|
56 | |||
57 | $ cd ../a |
|
57 | $ cd ../a | |
58 | $ echo b >> a |
|
58 | $ echo b >> a | |
59 | $ hg commit -m a1 -d "1 0" |
|
59 | $ hg commit -m a1 -d "1 0" | |
60 | precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
60 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
61 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
61 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
62 | pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
|
62 | pretxncommit hook: HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a | |
63 | 1:ab228980c14d |
|
63 | 1:ab228980c14d | |
64 | pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
64 | pretxnclose hook: HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
65 | txnclose hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
65 | txnclose hook: HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
66 | commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
66 | commit hook: HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
67 | commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
67 | commit.b hook: HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
68 | $ hg update -C 0 |
|
68 | $ hg update -C 0 | |
69 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
70 | $ echo b > b |
|
70 | $ echo b > b | |
71 | $ hg add b |
|
71 | $ hg add b | |
72 | $ hg commit -m b -d '1 0' |
|
72 | $ hg commit -m b -d '1 0' | |
73 | precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
73 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
74 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
74 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
75 | pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
|
75 | pretxncommit hook: HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a | |
76 | 2:ee9deb46ab31 |
|
76 | 2:ee9deb46ab31 | |
77 | pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
77 | pretxnclose hook: HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
78 | created new head |
|
78 | created new head | |
79 | txnclose hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
79 | txnclose hook: HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
80 | commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
80 | commit hook: HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
81 | commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
81 | commit.b hook: HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
82 | $ hg merge 1 |
|
82 | $ hg merge 1 | |
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
84 | (branch merge, don't forget to commit) |
|
84 | (branch merge, don't forget to commit) | |
85 | $ hg commit -m merge -d '2 0' |
|
85 | $ hg commit -m merge -d '2 0' | |
86 | precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
|
86 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |
87 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
87 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
88 | pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a |
|
88 | pretxncommit hook: HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a | |
89 | 3:07f3376c1e65 |
|
89 | 3:07f3376c1e65 | |
90 | pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
90 | pretxnclose hook: HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
91 | txnclose hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
91 | txnclose hook: HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
92 | commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
|
92 | commit hook: HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |
93 | commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
|
93 | commit.b hook: HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd | |
94 |
|
94 | |||
95 | test generic hooks |
|
95 | test generic hooks | |
96 |
|
96 | |||
97 | $ hg id |
|
97 | $ hg id | |
98 | pre-identify hook: HG_ARGS=id HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None} HG_PATS=[] |
|
98 | pre-identify hook: HG_ARGS=id HG_HOOKTYPE=pre-identify HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None} HG_PATS=[] | |
99 | abort: pre-identify hook exited with status 1 |
|
99 | abort: pre-identify hook exited with status 1 | |
100 | [255] |
|
100 | [255] | |
101 | $ hg cat b |
|
101 | $ hg cat b | |
102 | pre-cat hook: HG_ARGS=cat b HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': ''} HG_PATS=['b'] |
|
102 | pre-cat hook: HG_ARGS=cat b HG_HOOKTYPE=pre-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': ''} HG_PATS=['b'] | |
103 | b |
|
103 | b | |
104 | post-cat hook: HG_ARGS=cat b HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': ''} HG_PATS=['b'] HG_RESULT=0 |
|
104 | post-cat hook: HG_ARGS=cat b HG_HOOKTYPE=post-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': ''} HG_PATS=['b'] HG_RESULT=0 | |
105 |
|
105 | |||
106 | $ cd ../b |
|
106 | $ cd ../b | |
107 | $ hg pull ../a |
|
107 | $ hg pull ../a | |
108 | pulling from ../a |
|
108 | pulling from ../a | |
109 | searching for changes |
|
109 | searching for changes | |
110 | prechangegroup hook: HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
110 | prechangegroup hook: HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
111 | adding changesets |
|
111 | adding changesets | |
112 | adding manifests |
|
112 | adding manifests | |
113 | adding file changes |
|
113 | adding file changes | |
114 | added 3 changesets with 2 changes to 2 files |
|
114 | added 3 changesets with 2 changes to 2 files | |
115 | changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
115 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
116 | incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
116 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
117 | incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
117 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
118 | incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
118 | incoming hook: HG_HOOKTYPE=incoming HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
119 | (run 'hg update' to get a working copy) |
|
119 | (run 'hg update' to get a working copy) | |
120 |
|
120 | |||
121 | tag hooks can see env vars |
|
121 | tag hooks can see env vars | |
122 |
|
122 | |||
123 | $ cd ../a |
|
123 | $ cd ../a | |
124 | $ cat >> .hg/hgrc <<EOF |
|
124 | $ cat >> .hg/hgrc <<EOF | |
125 | > pretag = sh -c "printenv.py pretag" |
|
125 | > pretag = sh -c "printenv.py pretag" | |
126 | > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag" |
|
126 | > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag" | |
127 | > EOF |
|
127 | > EOF | |
128 | $ hg tag -d '3 0' a |
|
128 | $ hg tag -d '3 0' a | |
129 | pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
|
129 | pretag hook: HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a | |
130 | precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
|
130 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |
131 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
131 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
132 | pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a |
|
132 | pretxncommit hook: HG_HOOKTYPE=pretxncommit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a | |
133 | 4:539e4b31b6dc |
|
133 | 4:539e4b31b6dc | |
134 | pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
134 | pretxnclose hook: HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
135 | tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
|
135 | tag hook: HG_HOOKTYPE=tag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a | |
136 | txnclose hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
136 | txnclose hook: HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
137 | commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
|
137 | commit hook: HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |
138 | commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
|
138 | commit.b hook: HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 | |
139 | $ hg tag -l la |
|
139 | $ hg tag -l la | |
140 | pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
|
140 | pretag hook: HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la | |
141 | tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
|
141 | tag hook: HG_HOOKTYPE=tag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la | |
142 |
|
142 | |||
143 | pretag hook can forbid tagging |
|
143 | pretag hook can forbid tagging | |
144 |
|
144 | |||
145 | $ cat >> .hg/hgrc <<EOF |
|
145 | $ cat >> .hg/hgrc <<EOF | |
146 | > pretag.forbid = sh -c "printenv.py pretag.forbid 1" |
|
146 | > pretag.forbid = sh -c "printenv.py pretag.forbid 1" | |
147 | > EOF |
|
147 | > EOF | |
148 | $ hg tag -d '4 0' fa |
|
148 | $ hg tag -d '4 0' fa | |
149 | pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa |
|
149 | pretag hook: HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa | |
150 | pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa |
|
150 | pretag.forbid hook: HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa | |
151 | abort: pretag.forbid hook exited with status 1 |
|
151 | abort: pretag.forbid hook exited with status 1 | |
152 | [255] |
|
152 | [255] | |
153 | $ hg tag -l fla |
|
153 | $ hg tag -l fla | |
154 | pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla |
|
154 | pretag hook: HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla | |
155 | pretag.forbid hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla |
|
155 | pretag.forbid hook: HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla | |
156 | abort: pretag.forbid hook exited with status 1 |
|
156 | abort: pretag.forbid hook exited with status 1 | |
157 | [255] |
|
157 | [255] | |
158 |
|
158 | |||
159 | pretxncommit hook can see changeset, can roll back txn, changeset no |
|
159 | pretxncommit hook can see changeset, can roll back txn, changeset no | |
160 | more there after |
|
160 | more there after | |
161 |
|
161 | |||
162 | $ cat >> .hg/hgrc <<EOF |
|
162 | $ cat >> .hg/hgrc <<EOF | |
163 | > pretxncommit.forbid0 = sh -c "hg tip -q" |
|
163 | > pretxncommit.forbid0 = sh -c "hg tip -q" | |
164 | > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1" |
|
164 | > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1" | |
165 | > EOF |
|
165 | > EOF | |
166 | $ echo z > z |
|
166 | $ echo z > z | |
167 | $ hg add z |
|
167 | $ hg add z | |
168 | $ hg -q tip |
|
168 | $ hg -q tip | |
169 | 4:539e4b31b6dc |
|
169 | 4:539e4b31b6dc | |
170 | $ hg commit -m 'fail' -d '4 0' |
|
170 | $ hg commit -m 'fail' -d '4 0' | |
171 | precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
|
171 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |
172 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
172 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
173 | pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
|
173 | pretxncommit hook: HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a | |
174 | 5:6f611f8018c1 |
|
174 | 5:6f611f8018c1 | |
175 | 5:6f611f8018c1 |
|
175 | 5:6f611f8018c1 | |
176 | pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
|
176 | pretxncommit.forbid hook: HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a | |
177 | transaction abort! |
|
177 | transaction abort! | |
178 | txnabort python hook: txnid,txnname |
|
178 | txnabort python hook: txnid,txnname | |
179 | txnabort hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=commit |
|
179 | txnabort hook: HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit | |
180 | rollback completed |
|
180 | rollback completed | |
181 | abort: pretxncommit.forbid1 hook exited with status 1 |
|
181 | abort: pretxncommit.forbid1 hook exited with status 1 | |
182 | [255] |
|
182 | [255] | |
183 | $ hg -q tip |
|
183 | $ hg -q tip | |
184 | 4:539e4b31b6dc |
|
184 | 4:539e4b31b6dc | |
185 |
|
185 | |||
186 | (Check that no 'changelog.i.a' file were left behind) |
|
186 | (Check that no 'changelog.i.a' file were left behind) | |
187 |
|
187 | |||
188 | $ ls -1 .hg/store/ |
|
188 | $ ls -1 .hg/store/ | |
189 | 00changelog.i |
|
189 | 00changelog.i | |
190 | 00manifest.i |
|
190 | 00manifest.i | |
191 | data |
|
191 | data | |
192 | fncache |
|
192 | fncache | |
193 | journal.phaseroots |
|
193 | journal.phaseroots | |
194 | phaseroots |
|
194 | phaseroots | |
195 | undo |
|
195 | undo | |
196 | undo.backup.fncache |
|
196 | undo.backup.fncache | |
197 | undo.backupfiles |
|
197 | undo.backupfiles | |
198 | undo.phaseroots |
|
198 | undo.phaseroots | |
199 |
|
199 | |||
200 |
|
200 | |||
201 | precommit hook can prevent commit |
|
201 | precommit hook can prevent commit | |
202 |
|
202 | |||
203 | $ cat >> .hg/hgrc <<EOF |
|
203 | $ cat >> .hg/hgrc <<EOF | |
204 | > precommit.forbid = sh -c "printenv.py precommit.forbid 1" |
|
204 | > precommit.forbid = sh -c "printenv.py precommit.forbid 1" | |
205 | > EOF |
|
205 | > EOF | |
206 | $ hg commit -m 'fail' -d '4 0' |
|
206 | $ hg commit -m 'fail' -d '4 0' | |
207 | precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
|
207 | precommit hook: HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |
208 | precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
|
208 | precommit.forbid hook: HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 | |
209 | abort: precommit.forbid hook exited with status 1 |
|
209 | abort: precommit.forbid hook exited with status 1 | |
210 | [255] |
|
210 | [255] | |
211 | $ hg -q tip |
|
211 | $ hg -q tip | |
212 | 4:539e4b31b6dc |
|
212 | 4:539e4b31b6dc | |
213 |
|
213 | |||
214 | preupdate hook can prevent update |
|
214 | preupdate hook can prevent update | |
215 |
|
215 | |||
216 | $ cat >> .hg/hgrc <<EOF |
|
216 | $ cat >> .hg/hgrc <<EOF | |
217 | > preupdate = sh -c "printenv.py preupdate" |
|
217 | > preupdate = sh -c "printenv.py preupdate" | |
218 | > EOF |
|
218 | > EOF | |
219 | $ hg update 1 |
|
219 | $ hg update 1 | |
220 | preupdate hook: HG_PARENT1=ab228980c14d |
|
220 | preupdate hook: HG_HOOKTYPE=preupdate HG_PARENT1=ab228980c14d | |
221 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
221 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
222 |
|
222 | |||
223 | update hook |
|
223 | update hook | |
224 |
|
224 | |||
225 | $ cat >> .hg/hgrc <<EOF |
|
225 | $ cat >> .hg/hgrc <<EOF | |
226 | > update = sh -c "printenv.py update" |
|
226 | > update = sh -c "printenv.py update" | |
227 | > EOF |
|
227 | > EOF | |
228 | $ hg update |
|
228 | $ hg update | |
229 | preupdate hook: HG_PARENT1=539e4b31b6dc |
|
229 | preupdate hook: HG_HOOKTYPE=preupdate HG_PARENT1=539e4b31b6dc | |
230 | update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc |
|
230 | update hook: HG_ERROR=0 HG_HOOKTYPE=update HG_PARENT1=539e4b31b6dc | |
231 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
231 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
232 |
|
232 | |||
233 | pushkey hook |
|
233 | pushkey hook | |
234 |
|
234 | |||
235 | $ cat >> .hg/hgrc <<EOF |
|
235 | $ cat >> .hg/hgrc <<EOF | |
236 | > pushkey = sh -c "printenv.py pushkey" |
|
236 | > pushkey = sh -c "printenv.py pushkey" | |
237 | > EOF |
|
237 | > EOF | |
238 | $ cd ../b |
|
238 | $ cd ../b | |
239 | $ hg bookmark -r null foo |
|
239 | $ hg bookmark -r null foo | |
240 | $ hg push -B foo ../a |
|
240 | $ hg push -B foo ../a | |
241 | pushing to ../a |
|
241 | pushing to ../a | |
242 | searching for changes |
|
242 | searching for changes | |
243 | no changes found |
|
243 | no changes found | |
244 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=push |
|
244 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push | |
245 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a |
|
245 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a | |
246 | pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1 |
|
246 | pushkey hook: HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1 | |
247 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a |
|
247 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a | |
248 | exporting bookmark foo |
|
248 | exporting bookmark foo | |
249 | [1] |
|
249 | [1] | |
250 | $ cd ../a |
|
250 | $ cd ../a | |
251 |
|
251 | |||
252 | listkeys hook |
|
252 | listkeys hook | |
253 |
|
253 | |||
254 | $ cat >> .hg/hgrc <<EOF |
|
254 | $ cat >> .hg/hgrc <<EOF | |
255 | > listkeys = sh -c "printenv.py listkeys" |
|
255 | > listkeys = sh -c "printenv.py listkeys" | |
256 | > EOF |
|
256 | > EOF | |
257 | $ hg bookmark -r null bar |
|
257 | $ hg bookmark -r null bar | |
258 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
258 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
259 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
259 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
260 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
260 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
261 | $ cd ../b |
|
261 | $ cd ../b | |
262 | $ hg pull -B bar ../a |
|
262 | $ hg pull -B bar ../a | |
263 | pulling from ../a |
|
263 | pulling from ../a | |
264 | listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
|
264 | listkeys hook: HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} | |
265 | no changes found |
|
265 | no changes found | |
266 | listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} |
|
266 | listkeys hook: HG_HOOKTYPE=listkeys HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} | |
267 | adding remote bookmark bar |
|
267 | adding remote bookmark bar | |
268 | $ cd ../a |
|
268 | $ cd ../a | |
269 |
|
269 | |||
270 | test that prepushkey can prevent incoming keys |
|
270 | test that prepushkey can prevent incoming keys | |
271 |
|
271 | |||
272 | $ cat >> .hg/hgrc <<EOF |
|
272 | $ cat >> .hg/hgrc <<EOF | |
273 | > prepushkey = sh -c "printenv.py prepushkey.forbid 1" |
|
273 | > prepushkey = sh -c "printenv.py prepushkey.forbid 1" | |
274 | > EOF |
|
274 | > EOF | |
275 | $ cd ../b |
|
275 | $ cd ../b | |
276 | $ hg bookmark -r null baz |
|
276 | $ hg bookmark -r null baz | |
277 | $ hg push -B baz ../a |
|
277 | $ hg push -B baz ../a | |
278 | pushing to ../a |
|
278 | pushing to ../a | |
279 | searching for changes |
|
279 | searching for changes | |
280 | listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} |
|
280 | listkeys hook: HG_HOOKTYPE=listkeys HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} | |
281 | listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
|
281 | listkeys hook: HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} | |
282 | no changes found |
|
282 | no changes found | |
283 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=push |
|
283 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push | |
284 | prepushkey.forbid hook: HG_BUNDLE2=1 HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
284 | prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
285 | pushkey-abort: prepushkey hook exited with status 1 |
|
285 | pushkey-abort: prepushkey hook exited with status 1 | |
286 | abort: exporting bookmark baz failed! |
|
286 | abort: exporting bookmark baz failed! | |
287 | [255] |
|
287 | [255] | |
288 | $ cd ../a |
|
288 | $ cd ../a | |
289 |
|
289 | |||
290 | test that prelistkeys can prevent listing keys |
|
290 | test that prelistkeys can prevent listing keys | |
291 |
|
291 | |||
292 | $ cat >> .hg/hgrc <<EOF |
|
292 | $ cat >> .hg/hgrc <<EOF | |
293 | > prelistkeys = sh -c "printenv.py prelistkeys.forbid 1" |
|
293 | > prelistkeys = sh -c "printenv.py prelistkeys.forbid 1" | |
294 | > EOF |
|
294 | > EOF | |
295 | $ hg bookmark -r null quux |
|
295 | $ hg bookmark -r null quux | |
296 | pretxnopen hook: HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
296 | pretxnopen hook: HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
297 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
297 | pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
298 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark |
|
298 | txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark | |
299 | $ cd ../b |
|
299 | $ cd ../b | |
300 | $ hg pull -B quux ../a |
|
300 | $ hg pull -B quux ../a | |
301 | pulling from ../a |
|
301 | pulling from ../a | |
302 | prelistkeys.forbid hook: HG_NAMESPACE=bookmarks |
|
302 | prelistkeys.forbid hook: HG_HOOKTYPE=prelistkeys HG_NAMESPACE=bookmarks | |
303 | abort: prelistkeys hook exited with status 1 |
|
303 | abort: prelistkeys hook exited with status 1 | |
304 | [255] |
|
304 | [255] | |
305 | $ cd ../a |
|
305 | $ cd ../a | |
306 | $ rm .hg/hgrc |
|
306 | $ rm .hg/hgrc | |
307 |
|
307 | |||
308 | prechangegroup hook can prevent incoming changes |
|
308 | prechangegroup hook can prevent incoming changes | |
309 |
|
309 | |||
310 | $ cd ../b |
|
310 | $ cd ../b | |
311 | $ hg -q tip |
|
311 | $ hg -q tip | |
312 | 3:07f3376c1e65 |
|
312 | 3:07f3376c1e65 | |
313 | $ cat > .hg/hgrc <<EOF |
|
313 | $ cat > .hg/hgrc <<EOF | |
314 | > [hooks] |
|
314 | > [hooks] | |
315 | > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1" |
|
315 | > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1" | |
316 | > EOF |
|
316 | > EOF | |
317 | $ hg pull ../a |
|
317 | $ hg pull ../a | |
318 | pulling from ../a |
|
318 | pulling from ../a | |
319 | searching for changes |
|
319 | searching for changes | |
320 | prechangegroup.forbid hook: HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
320 | prechangegroup.forbid hook: HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
321 | abort: prechangegroup.forbid hook exited with status 1 |
|
321 | abort: prechangegroup.forbid hook exited with status 1 | |
322 | [255] |
|
322 | [255] | |
323 |
|
323 | |||
324 | pretxnchangegroup hook can see incoming changes, can roll back txn, |
|
324 | pretxnchangegroup hook can see incoming changes, can roll back txn, | |
325 | incoming changes no longer there after |
|
325 | incoming changes no longer there after | |
326 |
|
326 | |||
327 | $ cat > .hg/hgrc <<EOF |
|
327 | $ cat > .hg/hgrc <<EOF | |
328 | > [hooks] |
|
328 | > [hooks] | |
329 | > pretxnchangegroup.forbid0 = hg tip -q |
|
329 | > pretxnchangegroup.forbid0 = hg tip -q | |
330 | > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1" |
|
330 | > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1" | |
331 | > EOF |
|
331 | > EOF | |
332 | $ hg pull ../a |
|
332 | $ hg pull ../a | |
333 | pulling from ../a |
|
333 | pulling from ../a | |
334 | searching for changes |
|
334 | searching for changes | |
335 | adding changesets |
|
335 | adding changesets | |
336 | adding manifests |
|
336 | adding manifests | |
337 | adding file changes |
|
337 | adding file changes | |
338 | added 1 changesets with 1 changes to 1 files |
|
338 | added 1 changesets with 1 changes to 1 files | |
339 | 4:539e4b31b6dc |
|
339 | 4:539e4b31b6dc | |
340 | pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a |
|
340 | pretxnchangegroup.forbid hook: HG_HOOKTYPE=pretxnchangegroup HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a | |
341 | transaction abort! |
|
341 | transaction abort! | |
342 | rollback completed |
|
342 | rollback completed | |
343 | abort: pretxnchangegroup.forbid1 hook exited with status 1 |
|
343 | abort: pretxnchangegroup.forbid1 hook exited with status 1 | |
344 | [255] |
|
344 | [255] | |
345 | $ hg -q tip |
|
345 | $ hg -q tip | |
346 | 3:07f3376c1e65 |
|
346 | 3:07f3376c1e65 | |
347 |
|
347 | |||
348 | outgoing hooks can see env vars |
|
348 | outgoing hooks can see env vars | |
349 |
|
349 | |||
350 | $ rm .hg/hgrc |
|
350 | $ rm .hg/hgrc | |
351 | $ cat > ../a/.hg/hgrc <<EOF |
|
351 | $ cat > ../a/.hg/hgrc <<EOF | |
352 | > [hooks] |
|
352 | > [hooks] | |
353 | > preoutgoing = sh -c "printenv.py preoutgoing" |
|
353 | > preoutgoing = sh -c "printenv.py preoutgoing" | |
354 | > outgoing = sh -c "printenv.py outgoing" |
|
354 | > outgoing = sh -c "printenv.py outgoing" | |
355 | > EOF |
|
355 | > EOF | |
356 | $ hg pull ../a |
|
356 | $ hg pull ../a | |
357 | pulling from ../a |
|
357 | pulling from ../a | |
358 | searching for changes |
|
358 | searching for changes | |
359 | preoutgoing hook: HG_SOURCE=pull |
|
359 | preoutgoing hook: HG_HOOKTYPE=preoutgoing HG_SOURCE=pull | |
360 | outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull |
|
360 | outgoing hook: HG_HOOKTYPE=outgoing HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull | |
361 | adding changesets |
|
361 | adding changesets | |
362 | adding manifests |
|
362 | adding manifests | |
363 | adding file changes |
|
363 | adding file changes | |
364 | added 1 changesets with 1 changes to 1 files |
|
364 | added 1 changesets with 1 changes to 1 files | |
365 | adding remote bookmark quux |
|
365 | adding remote bookmark quux | |
366 | (run 'hg update' to get a working copy) |
|
366 | (run 'hg update' to get a working copy) | |
367 | $ hg rollback |
|
367 | $ hg rollback | |
368 | repository tip rolled back to revision 3 (undo pull) |
|
368 | repository tip rolled back to revision 3 (undo pull) | |
369 |
|
369 | |||
370 | preoutgoing hook can prevent outgoing changes |
|
370 | preoutgoing hook can prevent outgoing changes | |
371 |
|
371 | |||
372 | $ cat >> ../a/.hg/hgrc <<EOF |
|
372 | $ cat >> ../a/.hg/hgrc <<EOF | |
373 | > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" |
|
373 | > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" | |
374 | > EOF |
|
374 | > EOF | |
375 | $ hg pull ../a |
|
375 | $ hg pull ../a | |
376 | pulling from ../a |
|
376 | pulling from ../a | |
377 | searching for changes |
|
377 | searching for changes | |
378 | preoutgoing hook: HG_SOURCE=pull |
|
378 | preoutgoing hook: HG_HOOKTYPE=preoutgoing HG_SOURCE=pull | |
379 | preoutgoing.forbid hook: HG_SOURCE=pull |
|
379 | preoutgoing.forbid hook: HG_HOOKTYPE=preoutgoing HG_SOURCE=pull | |
380 | abort: preoutgoing.forbid hook exited with status 1 |
|
380 | abort: preoutgoing.forbid hook exited with status 1 | |
381 | [255] |
|
381 | [255] | |
382 |
|
382 | |||
383 | outgoing hooks work for local clones |
|
383 | outgoing hooks work for local clones | |
384 |
|
384 | |||
385 | $ cd .. |
|
385 | $ cd .. | |
386 | $ cat > a/.hg/hgrc <<EOF |
|
386 | $ cat > a/.hg/hgrc <<EOF | |
387 | > [hooks] |
|
387 | > [hooks] | |
388 | > preoutgoing = sh -c "printenv.py preoutgoing" |
|
388 | > preoutgoing = sh -c "printenv.py preoutgoing" | |
389 | > outgoing = sh -c "printenv.py outgoing" |
|
389 | > outgoing = sh -c "printenv.py outgoing" | |
390 | > EOF |
|
390 | > EOF | |
391 | $ hg clone a c |
|
391 | $ hg clone a c | |
392 | preoutgoing hook: HG_SOURCE=clone |
|
392 | preoutgoing hook: HG_HOOKTYPE=preoutgoing HG_SOURCE=clone | |
393 | outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone |
|
393 | outgoing hook: HG_HOOKTYPE=outgoing HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone | |
394 | updating to branch default |
|
394 | updating to branch default | |
395 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
395 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
396 | $ rm -rf c |
|
396 | $ rm -rf c | |
397 |
|
397 | |||
398 | preoutgoing hook can prevent outgoing changes for local clones |
|
398 | preoutgoing hook can prevent outgoing changes for local clones | |
399 |
|
399 | |||
400 | $ cat >> a/.hg/hgrc <<EOF |
|
400 | $ cat >> a/.hg/hgrc <<EOF | |
401 | > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" |
|
401 | > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" | |
402 | > EOF |
|
402 | > EOF | |
403 | $ hg clone a zzz |
|
403 | $ hg clone a zzz | |
404 | preoutgoing hook: HG_SOURCE=clone |
|
404 | preoutgoing hook: HG_HOOKTYPE=preoutgoing HG_SOURCE=clone | |
405 | preoutgoing.forbid hook: HG_SOURCE=clone |
|
405 | preoutgoing.forbid hook: HG_HOOKTYPE=preoutgoing HG_SOURCE=clone | |
406 | abort: preoutgoing.forbid hook exited with status 1 |
|
406 | abort: preoutgoing.forbid hook exited with status 1 | |
407 | [255] |
|
407 | [255] | |
408 |
|
408 | |||
409 | $ cd "$TESTTMP/b" |
|
409 | $ cd "$TESTTMP/b" | |
410 |
|
410 | |||
411 | $ cat > hooktests.py <<EOF |
|
411 | $ cat > hooktests.py <<EOF | |
412 | > from mercurial import error |
|
412 | > from mercurial import error | |
413 | > |
|
413 | > | |
414 | > uncallable = 0 |
|
414 | > uncallable = 0 | |
415 | > |
|
415 | > | |
416 | > def printargs(args): |
|
416 | > def printargs(args): | |
417 | > args.pop('ui', None) |
|
417 | > args.pop('ui', None) | |
418 | > args.pop('repo', None) |
|
418 | > args.pop('repo', None) | |
419 | > a = list(args.items()) |
|
419 | > a = list(args.items()) | |
420 | > a.sort() |
|
420 | > a.sort() | |
421 | > print 'hook args:' |
|
421 | > print 'hook args:' | |
422 | > for k, v in a: |
|
422 | > for k, v in a: | |
423 | > print ' ', k, v |
|
423 | > print ' ', k, v | |
424 | > |
|
424 | > | |
425 | > def passhook(**args): |
|
425 | > def passhook(**args): | |
426 | > printargs(args) |
|
426 | > printargs(args) | |
427 | > |
|
427 | > | |
428 | > def failhook(**args): |
|
428 | > def failhook(**args): | |
429 | > printargs(args) |
|
429 | > printargs(args) | |
430 | > return True |
|
430 | > return True | |
431 | > |
|
431 | > | |
432 | > class LocalException(Exception): |
|
432 | > class LocalException(Exception): | |
433 | > pass |
|
433 | > pass | |
434 | > |
|
434 | > | |
435 | > def raisehook(**args): |
|
435 | > def raisehook(**args): | |
436 | > raise LocalException('exception from hook') |
|
436 | > raise LocalException('exception from hook') | |
437 | > |
|
437 | > | |
438 | > def aborthook(**args): |
|
438 | > def aborthook(**args): | |
439 | > raise error.Abort('raise abort from hook') |
|
439 | > raise error.Abort('raise abort from hook') | |
440 | > |
|
440 | > | |
441 | > def brokenhook(**args): |
|
441 | > def brokenhook(**args): | |
442 | > return 1 + {} |
|
442 | > return 1 + {} | |
443 | > |
|
443 | > | |
444 | > def verbosehook(ui, **args): |
|
444 | > def verbosehook(ui, **args): | |
445 | > ui.note('verbose output from hook\n') |
|
445 | > ui.note('verbose output from hook\n') | |
446 | > |
|
446 | > | |
447 | > def printtags(ui, repo, **args): |
|
447 | > def printtags(ui, repo, **args): | |
448 | > print sorted(repo.tags()) |
|
448 | > print sorted(repo.tags()) | |
449 | > |
|
449 | > | |
450 | > class container: |
|
450 | > class container: | |
451 | > unreachable = 1 |
|
451 | > unreachable = 1 | |
452 | > EOF |
|
452 | > EOF | |
453 |
|
453 | |||
454 | $ cat > syntaxerror.py << EOF |
|
454 | $ cat > syntaxerror.py << EOF | |
455 | > (foo |
|
455 | > (foo | |
456 | > EOF |
|
456 | > EOF | |
457 |
|
457 | |||
458 | test python hooks |
|
458 | test python hooks | |
459 |
|
459 | |||
460 | #if windows |
|
460 | #if windows | |
461 | $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH" |
|
461 | $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH" | |
462 | #else |
|
462 | #else | |
463 | $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH" |
|
463 | $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH" | |
464 | #endif |
|
464 | #endif | |
465 | $ export PYTHONPATH |
|
465 | $ export PYTHONPATH | |
466 |
|
466 | |||
467 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
467 | $ echo '[hooks]' > ../a/.hg/hgrc | |
468 | $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc |
|
468 | $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc | |
469 | $ hg pull ../a 2>&1 | grep 'raised an exception' |
|
469 | $ hg pull ../a 2>&1 | grep 'raised an exception' | |
470 | error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' |
|
470 | error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' | |
471 |
|
471 | |||
472 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
472 | $ echo '[hooks]' > ../a/.hg/hgrc | |
473 | $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc |
|
473 | $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc | |
474 | $ hg pull ../a 2>&1 | grep 'raised an exception' |
|
474 | $ hg pull ../a 2>&1 | grep 'raised an exception' | |
475 | error: preoutgoing.raise hook raised an exception: exception from hook |
|
475 | error: preoutgoing.raise hook raised an exception: exception from hook | |
476 |
|
476 | |||
477 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
477 | $ echo '[hooks]' > ../a/.hg/hgrc | |
478 | $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc |
|
478 | $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc | |
479 | $ hg pull ../a |
|
479 | $ hg pull ../a | |
480 | pulling from ../a |
|
480 | pulling from ../a | |
481 | searching for changes |
|
481 | searching for changes | |
482 | error: preoutgoing.abort hook failed: raise abort from hook |
|
482 | error: preoutgoing.abort hook failed: raise abort from hook | |
483 | abort: raise abort from hook |
|
483 | abort: raise abort from hook | |
484 | [255] |
|
484 | [255] | |
485 |
|
485 | |||
486 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
486 | $ echo '[hooks]' > ../a/.hg/hgrc | |
487 | $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc |
|
487 | $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc | |
488 | $ hg pull ../a |
|
488 | $ hg pull ../a | |
489 | pulling from ../a |
|
489 | pulling from ../a | |
490 | searching for changes |
|
490 | searching for changes | |
491 | hook args: |
|
491 | hook args: | |
492 | hooktype preoutgoing |
|
492 | hooktype preoutgoing | |
493 | source pull |
|
493 | source pull | |
494 | abort: preoutgoing.fail hook failed |
|
494 | abort: preoutgoing.fail hook failed | |
495 | [255] |
|
495 | [255] | |
496 |
|
496 | |||
497 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
497 | $ echo '[hooks]' > ../a/.hg/hgrc | |
498 | $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc |
|
498 | $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc | |
499 | $ hg pull ../a |
|
499 | $ hg pull ../a | |
500 | pulling from ../a |
|
500 | pulling from ../a | |
501 | searching for changes |
|
501 | searching for changes | |
502 | abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable |
|
502 | abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable | |
503 | [255] |
|
503 | [255] | |
504 |
|
504 | |||
505 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
505 | $ echo '[hooks]' > ../a/.hg/hgrc | |
506 | $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc |
|
506 | $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc | |
507 | $ hg pull ../a |
|
507 | $ hg pull ../a | |
508 | pulling from ../a |
|
508 | pulling from ../a | |
509 | searching for changes |
|
509 | searching for changes | |
510 | abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined |
|
510 | abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined | |
511 | [255] |
|
511 | [255] | |
512 |
|
512 | |||
513 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
513 | $ echo '[hooks]' > ../a/.hg/hgrc | |
514 | $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc |
|
514 | $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc | |
515 | $ hg pull ../a |
|
515 | $ hg pull ../a | |
516 | pulling from ../a |
|
516 | pulling from ../a | |
517 | searching for changes |
|
517 | searching for changes | |
518 | abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module |
|
518 | abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module | |
519 | [255] |
|
519 | [255] | |
520 |
|
520 | |||
521 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
521 | $ echo '[hooks]' > ../a/.hg/hgrc | |
522 | $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc |
|
522 | $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc | |
523 | $ hg pull ../a |
|
523 | $ hg pull ../a | |
524 | pulling from ../a |
|
524 | pulling from ../a | |
525 | searching for changes |
|
525 | searching for changes | |
526 | abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed |
|
526 | abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed | |
527 | (run with --traceback for stack trace) |
|
527 | (run with --traceback for stack trace) | |
528 | [255] |
|
528 | [255] | |
529 |
|
529 | |||
530 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
530 | $ echo '[hooks]' > ../a/.hg/hgrc | |
531 | $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc |
|
531 | $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc | |
532 | $ hg pull ../a |
|
532 | $ hg pull ../a | |
533 | pulling from ../a |
|
533 | pulling from ../a | |
534 | searching for changes |
|
534 | searching for changes | |
535 | abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed |
|
535 | abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed | |
536 | (run with --traceback for stack trace) |
|
536 | (run with --traceback for stack trace) | |
537 | [255] |
|
537 | [255] | |
538 |
|
538 | |||
539 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
539 | $ echo '[hooks]' > ../a/.hg/hgrc | |
540 | $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc |
|
540 | $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc | |
541 | $ hg pull ../a |
|
541 | $ hg pull ../a | |
542 | pulling from ../a |
|
542 | pulling from ../a | |
543 | searching for changes |
|
543 | searching for changes | |
544 | abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed |
|
544 | abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed | |
545 | (run with --traceback for stack trace) |
|
545 | (run with --traceback for stack trace) | |
546 | [255] |
|
546 | [255] | |
547 |
|
547 | |||
548 | The second egrep is to filter out lines like ' ^', which are slightly |
|
548 | The second egrep is to filter out lines like ' ^', which are slightly | |
549 | different between Python 2.6 and Python 2.7. |
|
549 | different between Python 2.6 and Python 2.7. | |
550 | $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File| [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$' |
|
550 | $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File| [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$' | |
551 | pulling from ../a |
|
551 | pulling from ../a | |
552 | searching for changes |
|
552 | searching for changes | |
553 | exception from first failed import attempt: |
|
553 | exception from first failed import attempt: | |
554 | Traceback (most recent call last): |
|
554 | Traceback (most recent call last): | |
555 | SyntaxError: * (glob) |
|
555 | SyntaxError: * (glob) | |
556 | exception from second failed import attempt: |
|
556 | exception from second failed import attempt: | |
557 | Traceback (most recent call last): |
|
557 | Traceback (most recent call last): | |
558 | ImportError: No module named hgext_syntaxerror |
|
558 | ImportError: No module named hgext_syntaxerror | |
559 | Traceback (most recent call last): |
|
559 | Traceback (most recent call last): | |
560 | HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed |
|
560 | HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed | |
561 | abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed |
|
561 | abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed | |
562 |
|
562 | |||
563 | $ echo '[hooks]' > ../a/.hg/hgrc |
|
563 | $ echo '[hooks]' > ../a/.hg/hgrc | |
564 | $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc |
|
564 | $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc | |
565 | $ hg pull ../a |
|
565 | $ hg pull ../a | |
566 | pulling from ../a |
|
566 | pulling from ../a | |
567 | searching for changes |
|
567 | searching for changes | |
568 | hook args: |
|
568 | hook args: | |
569 | hooktype preoutgoing |
|
569 | hooktype preoutgoing | |
570 | source pull |
|
570 | source pull | |
571 | adding changesets |
|
571 | adding changesets | |
572 | adding manifests |
|
572 | adding manifests | |
573 | adding file changes |
|
573 | adding file changes | |
574 | added 1 changesets with 1 changes to 1 files |
|
574 | added 1 changesets with 1 changes to 1 files | |
575 | adding remote bookmark quux |
|
575 | adding remote bookmark quux | |
576 | (run 'hg update' to get a working copy) |
|
576 | (run 'hg update' to get a working copy) | |
577 |
|
577 | |||
578 | post- python hooks that fail to *run* don't cause an abort |
|
578 | post- python hooks that fail to *run* don't cause an abort | |
579 | $ rm ../a/.hg/hgrc |
|
579 | $ rm ../a/.hg/hgrc | |
580 | $ echo '[hooks]' > .hg/hgrc |
|
580 | $ echo '[hooks]' > .hg/hgrc | |
581 | $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc |
|
581 | $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc | |
582 | $ hg pull ../a |
|
582 | $ hg pull ../a | |
583 | pulling from ../a |
|
583 | pulling from ../a | |
584 | searching for changes |
|
584 | searching for changes | |
585 | no changes found |
|
585 | no changes found | |
586 | error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' |
|
586 | error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' | |
587 | (run with --traceback for stack trace) |
|
587 | (run with --traceback for stack trace) | |
588 |
|
588 | |||
589 | but post- python hooks that fail to *load* do |
|
589 | but post- python hooks that fail to *load* do | |
590 | $ echo '[hooks]' > .hg/hgrc |
|
590 | $ echo '[hooks]' > .hg/hgrc | |
591 | $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc |
|
591 | $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc | |
592 | $ hg pull ../a |
|
592 | $ hg pull ../a | |
593 | pulling from ../a |
|
593 | pulling from ../a | |
594 | searching for changes |
|
594 | searching for changes | |
595 | no changes found |
|
595 | no changes found | |
596 | abort: post-pull.nomodule hook is invalid: "nomodule" not in a module |
|
596 | abort: post-pull.nomodule hook is invalid: "nomodule" not in a module | |
597 | [255] |
|
597 | [255] | |
598 |
|
598 | |||
599 | $ echo '[hooks]' > .hg/hgrc |
|
599 | $ echo '[hooks]' > .hg/hgrc | |
600 | $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc |
|
600 | $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc | |
601 | $ hg pull ../a |
|
601 | $ hg pull ../a | |
602 | pulling from ../a |
|
602 | pulling from ../a | |
603 | searching for changes |
|
603 | searching for changes | |
604 | no changes found |
|
604 | no changes found | |
605 | abort: post-pull.badmodule hook is invalid: import of "nomodule" failed |
|
605 | abort: post-pull.badmodule hook is invalid: import of "nomodule" failed | |
606 | (run with --traceback for stack trace) |
|
606 | (run with --traceback for stack trace) | |
607 | [255] |
|
607 | [255] | |
608 |
|
608 | |||
609 | $ echo '[hooks]' > .hg/hgrc |
|
609 | $ echo '[hooks]' > .hg/hgrc | |
610 | $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc |
|
610 | $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc | |
611 | $ hg pull ../a |
|
611 | $ hg pull ../a | |
612 | pulling from ../a |
|
612 | pulling from ../a | |
613 | searching for changes |
|
613 | searching for changes | |
614 | no changes found |
|
614 | no changes found | |
615 | abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined |
|
615 | abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined | |
616 | [255] |
|
616 | [255] | |
617 |
|
617 | |||
618 | make sure --traceback works |
|
618 | make sure --traceback works | |
619 |
|
619 | |||
620 | $ echo '[hooks]' > .hg/hgrc |
|
620 | $ echo '[hooks]' > .hg/hgrc | |
621 | $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc |
|
621 | $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc | |
622 |
|
622 | |||
623 | $ echo aa > a |
|
623 | $ echo aa > a | |
624 | $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback' |
|
624 | $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback' | |
625 | Traceback (most recent call last): |
|
625 | Traceback (most recent call last): | |
626 |
|
626 | |||
627 | $ cd .. |
|
627 | $ cd .. | |
628 | $ hg init c |
|
628 | $ hg init c | |
629 | $ cd c |
|
629 | $ cd c | |
630 |
|
630 | |||
631 | $ cat > hookext.py <<EOF |
|
631 | $ cat > hookext.py <<EOF | |
632 | > def autohook(**args): |
|
632 | > def autohook(**args): | |
633 | > print "Automatically installed hook" |
|
633 | > print "Automatically installed hook" | |
634 | > |
|
634 | > | |
635 | > def reposetup(ui, repo): |
|
635 | > def reposetup(ui, repo): | |
636 | > repo.ui.setconfig("hooks", "commit.auto", autohook) |
|
636 | > repo.ui.setconfig("hooks", "commit.auto", autohook) | |
637 | > EOF |
|
637 | > EOF | |
638 | $ echo '[extensions]' >> .hg/hgrc |
|
638 | $ echo '[extensions]' >> .hg/hgrc | |
639 | $ echo 'hookext = hookext.py' >> .hg/hgrc |
|
639 | $ echo 'hookext = hookext.py' >> .hg/hgrc | |
640 |
|
640 | |||
641 | $ touch foo |
|
641 | $ touch foo | |
642 | $ hg add foo |
|
642 | $ hg add foo | |
643 | $ hg ci -d '0 0' -m 'add foo' |
|
643 | $ hg ci -d '0 0' -m 'add foo' | |
644 | Automatically installed hook |
|
644 | Automatically installed hook | |
645 | $ echo >> foo |
|
645 | $ echo >> foo | |
646 | $ hg ci --debug -d '0 0' -m 'change foo' |
|
646 | $ hg ci --debug -d '0 0' -m 'change foo' | |
647 | committing files: |
|
647 | committing files: | |
648 | foo |
|
648 | foo | |
649 | committing manifest |
|
649 | committing manifest | |
650 | committing changelog |
|
650 | committing changelog | |
651 | committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708 |
|
651 | committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708 | |
652 | calling hook commit.auto: hgext_hookext.autohook |
|
652 | calling hook commit.auto: hgext_hookext.autohook | |
653 | Automatically installed hook |
|
653 | Automatically installed hook | |
654 |
|
654 | |||
655 | $ hg showconfig hooks |
|
655 | $ hg showconfig hooks | |
656 | hooks.commit.auto=<function autohook at *> (glob) |
|
656 | hooks.commit.auto=<function autohook at *> (glob) | |
657 |
|
657 | |||
658 | test python hook configured with python:[file]:[hook] syntax |
|
658 | test python hook configured with python:[file]:[hook] syntax | |
659 |
|
659 | |||
660 | $ cd .. |
|
660 | $ cd .. | |
661 | $ mkdir d |
|
661 | $ mkdir d | |
662 | $ cd d |
|
662 | $ cd d | |
663 | $ hg init repo |
|
663 | $ hg init repo | |
664 | $ mkdir hooks |
|
664 | $ mkdir hooks | |
665 |
|
665 | |||
666 | $ cd hooks |
|
666 | $ cd hooks | |
667 | $ cat > testhooks.py <<EOF |
|
667 | $ cat > testhooks.py <<EOF | |
668 | > def testhook(**args): |
|
668 | > def testhook(**args): | |
669 | > print 'hook works' |
|
669 | > print 'hook works' | |
670 | > EOF |
|
670 | > EOF | |
671 | $ echo '[hooks]' > ../repo/.hg/hgrc |
|
671 | $ echo '[hooks]' > ../repo/.hg/hgrc | |
672 | $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc |
|
672 | $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc | |
673 |
|
673 | |||
674 | $ cd ../repo |
|
674 | $ cd ../repo | |
675 | $ hg commit -d '0 0' |
|
675 | $ hg commit -d '0 0' | |
676 | hook works |
|
676 | hook works | |
677 | nothing changed |
|
677 | nothing changed | |
678 | [1] |
|
678 | [1] | |
679 |
|
679 | |||
680 | $ echo '[hooks]' > .hg/hgrc |
|
680 | $ echo '[hooks]' > .hg/hgrc | |
681 | $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc |
|
681 | $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc | |
682 | $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc |
|
682 | $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc | |
683 |
|
683 | |||
684 | $ hg up null |
|
684 | $ hg up null | |
685 | loading update.ne hook failed: |
|
685 | loading update.ne hook failed: | |
686 | abort: No such file or directory: $TESTTMP/d/repo/nonexistent.py |
|
686 | abort: No such file or directory: $TESTTMP/d/repo/nonexistent.py | |
687 | [255] |
|
687 | [255] | |
688 |
|
688 | |||
689 | $ hg id |
|
689 | $ hg id | |
690 | loading pre-identify.npmd hook failed: |
|
690 | loading pre-identify.npmd hook failed: | |
691 | abort: No module named repo! |
|
691 | abort: No module named repo! | |
692 | [255] |
|
692 | [255] | |
693 |
|
693 | |||
694 | $ cd ../../b |
|
694 | $ cd ../../b | |
695 |
|
695 | |||
696 | make sure --traceback works on hook import failure |
|
696 | make sure --traceback works on hook import failure | |
697 |
|
697 | |||
698 | $ cat > importfail.py <<EOF |
|
698 | $ cat > importfail.py <<EOF | |
699 | > import somebogusmodule |
|
699 | > import somebogusmodule | |
700 | > # dereference something in the module to force demandimport to load it |
|
700 | > # dereference something in the module to force demandimport to load it | |
701 | > somebogusmodule.whatever |
|
701 | > somebogusmodule.whatever | |
702 | > EOF |
|
702 | > EOF | |
703 |
|
703 | |||
704 | $ echo '[hooks]' > .hg/hgrc |
|
704 | $ echo '[hooks]' > .hg/hgrc | |
705 | $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc |
|
705 | $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc | |
706 |
|
706 | |||
707 | $ echo a >> a |
|
707 | $ echo a >> a | |
708 | $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File| [a-zA-Z(])' |
|
708 | $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File| [a-zA-Z(])' | |
709 | exception from first failed import attempt: |
|
709 | exception from first failed import attempt: | |
710 | Traceback (most recent call last): |
|
710 | Traceback (most recent call last): | |
711 | ImportError: No module named somebogusmodule |
|
711 | ImportError: No module named somebogusmodule | |
712 | exception from second failed import attempt: |
|
712 | exception from second failed import attempt: | |
713 | Traceback (most recent call last): |
|
713 | Traceback (most recent call last): | |
714 | ImportError: No module named hgext_importfail |
|
714 | ImportError: No module named hgext_importfail | |
715 | Traceback (most recent call last): |
|
715 | Traceback (most recent call last): | |
716 | HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed |
|
716 | HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed | |
717 | abort: precommit.importfail hook is invalid: import of "importfail" failed |
|
717 | abort: precommit.importfail hook is invalid: import of "importfail" failed | |
718 |
|
718 | |||
719 | Issue1827: Hooks Update & Commit not completely post operation |
|
719 | Issue1827: Hooks Update & Commit not completely post operation | |
720 |
|
720 | |||
721 | commit and update hooks should run after command completion. The largefiles |
|
721 | commit and update hooks should run after command completion. The largefiles | |
722 | use demonstrates a recursive wlock, showing the hook doesn't run until the |
|
722 | use demonstrates a recursive wlock, showing the hook doesn't run until the | |
723 | final release (and dirstate flush). |
|
723 | final release (and dirstate flush). | |
724 |
|
724 | |||
725 | $ echo '[hooks]' > .hg/hgrc |
|
725 | $ echo '[hooks]' > .hg/hgrc | |
726 | $ echo 'commit = hg id' >> .hg/hgrc |
|
726 | $ echo 'commit = hg id' >> .hg/hgrc | |
727 | $ echo 'update = hg id' >> .hg/hgrc |
|
727 | $ echo 'update = hg id' >> .hg/hgrc | |
728 | $ echo bb > a |
|
728 | $ echo bb > a | |
729 | $ hg ci -ma |
|
729 | $ hg ci -ma | |
730 | 223eafe2750c tip |
|
730 | 223eafe2750c tip | |
731 | $ hg up 0 --config extensions.largefiles= |
|
731 | $ hg up 0 --config extensions.largefiles= | |
732 | cb9a9f314b8b |
|
732 | cb9a9f314b8b | |
733 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
733 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
734 |
|
734 | |||
735 | make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui |
|
735 | make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui | |
736 | that is passed to pre/post hooks |
|
736 | that is passed to pre/post hooks | |
737 |
|
737 | |||
738 | $ echo '[hooks]' > .hg/hgrc |
|
738 | $ echo '[hooks]' > .hg/hgrc | |
739 | $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc |
|
739 | $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc | |
740 | $ hg id |
|
740 | $ hg id | |
741 | cb9a9f314b8b |
|
741 | cb9a9f314b8b | |
742 | $ hg id --verbose |
|
742 | $ hg id --verbose | |
743 | calling hook pre-identify: hooktests.verbosehook |
|
743 | calling hook pre-identify: hooktests.verbosehook | |
744 | verbose output from hook |
|
744 | verbose output from hook | |
745 | cb9a9f314b8b |
|
745 | cb9a9f314b8b | |
746 |
|
746 | |||
747 | Ensure hooks can be prioritized |
|
747 | Ensure hooks can be prioritized | |
748 |
|
748 | |||
749 | $ echo '[hooks]' > .hg/hgrc |
|
749 | $ echo '[hooks]' > .hg/hgrc | |
750 | $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc |
|
750 | $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc | |
751 | $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc |
|
751 | $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc | |
752 | $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc |
|
752 | $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc | |
753 | $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc |
|
753 | $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc | |
754 | $ hg id --verbose |
|
754 | $ hg id --verbose | |
755 | calling hook pre-identify.b: hooktests.verbosehook |
|
755 | calling hook pre-identify.b: hooktests.verbosehook | |
756 | verbose output from hook |
|
756 | verbose output from hook | |
757 | calling hook pre-identify.a: hooktests.verbosehook |
|
757 | calling hook pre-identify.a: hooktests.verbosehook | |
758 | verbose output from hook |
|
758 | verbose output from hook | |
759 | calling hook pre-identify.c: hooktests.verbosehook |
|
759 | calling hook pre-identify.c: hooktests.verbosehook | |
760 | verbose output from hook |
|
760 | verbose output from hook | |
761 | cb9a9f314b8b |
|
761 | cb9a9f314b8b | |
762 |
|
762 | |||
763 | new tags must be visible in pretxncommit (issue3210) |
|
763 | new tags must be visible in pretxncommit (issue3210) | |
764 |
|
764 | |||
765 | $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc |
|
765 | $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc | |
766 | $ hg tag -f foo |
|
766 | $ hg tag -f foo | |
767 | ['a', 'foo', 'tip'] |
|
767 | ['a', 'foo', 'tip'] | |
768 |
|
768 | |||
769 | post-init hooks must not crash (issue4983) |
|
769 | post-init hooks must not crash (issue4983) | |
770 | This also creates the `to` repo for the next test block. |
|
770 | This also creates the `to` repo for the next test block. | |
771 |
|
771 | |||
772 | $ cd .. |
|
772 | $ cd .. | |
773 | $ cat << EOF >> hgrc-with-post-init-hook |
|
773 | $ cat << EOF >> hgrc-with-post-init-hook | |
774 | > [hooks] |
|
774 | > [hooks] | |
775 | > post-init = sh -c "printenv.py post-init" |
|
775 | > post-init = sh -c "printenv.py post-init" | |
776 | > EOF |
|
776 | > EOF | |
777 | $ HGRCPATH=hgrc-with-post-init-hook hg init to |
|
777 | $ HGRCPATH=hgrc-with-post-init-hook hg init to | |
778 | post-init hook: HG_ARGS=init to HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} HG_PATS=['to'] HG_RESULT=0 |
|
778 | post-init hook: HG_ARGS=init to HG_HOOKTYPE=post-init HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} HG_PATS=['to'] HG_RESULT=0 | |
779 |
|
779 | |||
780 | new commits must be visible in pretxnchangegroup (issue3428) |
|
780 | new commits must be visible in pretxnchangegroup (issue3428) | |
781 |
|
781 | |||
782 | $ echo '[hooks]' >> to/.hg/hgrc |
|
782 | $ echo '[hooks]' >> to/.hg/hgrc | |
783 | $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc |
|
783 | $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc | |
784 | $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc |
|
784 | $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc | |
785 | $ echo a >> to/a |
|
785 | $ echo a >> to/a | |
786 | $ hg --cwd to ci -Ama |
|
786 | $ hg --cwd to ci -Ama | |
787 | adding a |
|
787 | adding a | |
788 | $ hg clone to from |
|
788 | $ hg clone to from | |
789 | updating to branch default |
|
789 | updating to branch default | |
790 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
790 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
791 | $ echo aa >> from/a |
|
791 | $ echo aa >> from/a | |
792 | $ hg --cwd from ci -mb |
|
792 | $ hg --cwd from ci -mb | |
793 | $ hg --cwd from push |
|
793 | $ hg --cwd from push | |
794 | pushing to $TESTTMP/to (glob) |
|
794 | pushing to $TESTTMP/to (glob) | |
795 | searching for changes |
|
795 | searching for changes | |
796 | changeset: 0:cb9a9f314b8b |
|
796 | changeset: 0:cb9a9f314b8b | |
797 | tag: tip |
|
797 | tag: tip | |
798 | user: test |
|
798 | user: test | |
799 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
799 | date: Thu Jan 01 00:00:00 1970 +0000 | |
800 | summary: a |
|
800 | summary: a | |
801 |
|
801 | |||
802 | adding changesets |
|
802 | adding changesets | |
803 | adding manifests |
|
803 | adding manifests | |
804 | adding file changes |
|
804 | adding file changes | |
805 | added 1 changesets with 1 changes to 1 files |
|
805 | added 1 changesets with 1 changes to 1 files | |
806 | changeset: 1:9836a07b9b9d |
|
806 | changeset: 1:9836a07b9b9d | |
807 | tag: tip |
|
807 | tag: tip | |
808 | user: test |
|
808 | user: test | |
809 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
809 | date: Thu Jan 01 00:00:00 1970 +0000 | |
810 | summary: b |
|
810 | summary: b | |
811 |
|
811 | |||
812 |
|
812 | |||
813 | pretxnclose hook failure should abort the transaction |
|
813 | pretxnclose hook failure should abort the transaction | |
814 |
|
814 | |||
815 | $ hg init txnfailure |
|
815 | $ hg init txnfailure | |
816 | $ cd txnfailure |
|
816 | $ cd txnfailure | |
817 | $ touch a && hg commit -Aqm a |
|
817 | $ touch a && hg commit -Aqm a | |
818 | $ cat >> .hg/hgrc <<EOF |
|
818 | $ cat >> .hg/hgrc <<EOF | |
819 | > [hooks] |
|
819 | > [hooks] | |
820 | > pretxnclose.error = exit 1 |
|
820 | > pretxnclose.error = exit 1 | |
821 | > EOF |
|
821 | > EOF | |
822 | $ hg strip -r 0 --config extensions.strip= |
|
822 | $ hg strip -r 0 --config extensions.strip= | |
823 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
823 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
824 | saved backup bundle to * (glob) |
|
824 | saved backup bundle to * (glob) | |
825 | transaction abort! |
|
825 | transaction abort! | |
826 | rollback completed |
|
826 | rollback completed | |
827 | strip failed, backup bundle stored in * (glob) |
|
827 | strip failed, backup bundle stored in * (glob) | |
828 | abort: pretxnclose.error hook exited with status 1 |
|
828 | abort: pretxnclose.error hook exited with status 1 | |
829 | [255] |
|
829 | [255] | |
830 | $ hg recover |
|
830 | $ hg recover | |
831 | no interrupted transaction available |
|
831 | no interrupted transaction available | |
832 | [1] |
|
832 | [1] | |
833 | $ cd .. |
|
833 | $ cd .. | |
834 |
|
834 | |||
835 | check whether HG_PENDING makes pending changes only in related |
|
835 | check whether HG_PENDING makes pending changes only in related | |
836 | repositories visible to an external hook. |
|
836 | repositories visible to an external hook. | |
837 |
|
837 | |||
838 | (emulate a transaction running concurrently by copied |
|
838 | (emulate a transaction running concurrently by copied | |
839 | .hg/store/00changelog.i.a in subsequent test) |
|
839 | .hg/store/00changelog.i.a in subsequent test) | |
840 |
|
840 | |||
841 | $ cat > $TESTTMP/savepending.sh <<EOF |
|
841 | $ cat > $TESTTMP/savepending.sh <<EOF | |
842 | > cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved |
|
842 | > cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved | |
843 | > exit 1 # to avoid adding new revision for subsequent tests |
|
843 | > exit 1 # to avoid adding new revision for subsequent tests | |
844 | > EOF |
|
844 | > EOF | |
845 | $ cd a |
|
845 | $ cd a | |
846 | $ hg tip -q |
|
846 | $ hg tip -q | |
847 | 4:539e4b31b6dc |
|
847 | 4:539e4b31b6dc | |
848 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible" |
|
848 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible" | |
849 | transaction abort! |
|
849 | transaction abort! | |
850 | rollback completed |
|
850 | rollback completed | |
851 | abort: pretxnclose hook exited with status 1 |
|
851 | abort: pretxnclose hook exited with status 1 | |
852 | [255] |
|
852 | [255] | |
853 | $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a |
|
853 | $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a | |
854 |
|
854 | |||
855 | (check (in)visibility of new changeset while transaction running in |
|
855 | (check (in)visibility of new changeset while transaction running in | |
856 | repo) |
|
856 | repo) | |
857 |
|
857 | |||
858 | $ cat > $TESTTMP/checkpending.sh <<EOF |
|
858 | $ cat > $TESTTMP/checkpending.sh <<EOF | |
859 | > echo '@a' |
|
859 | > echo '@a' | |
860 | > hg -R $TESTTMP/a tip -q |
|
860 | > hg -R $TESTTMP/a tip -q | |
861 | > echo '@a/nested' |
|
861 | > echo '@a/nested' | |
862 | > hg -R $TESTTMP/a/nested tip -q |
|
862 | > hg -R $TESTTMP/a/nested tip -q | |
863 | > exit 1 # to avoid adding new revision for subsequent tests |
|
863 | > exit 1 # to avoid adding new revision for subsequent tests | |
864 | > EOF |
|
864 | > EOF | |
865 | $ hg init nested |
|
865 | $ hg init nested | |
866 | $ cd nested |
|
866 | $ cd nested | |
867 | $ echo a > a |
|
867 | $ echo a > a | |
868 | $ hg add a |
|
868 | $ hg add a | |
869 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0' |
|
869 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0' | |
870 | @a |
|
870 | @a | |
871 | 4:539e4b31b6dc |
|
871 | 4:539e4b31b6dc | |
872 | @a/nested |
|
872 | @a/nested | |
873 | 0:bf5e395ced2c |
|
873 | 0:bf5e395ced2c | |
874 | transaction abort! |
|
874 | transaction abort! | |
875 | rollback completed |
|
875 | rollback completed | |
876 | abort: pretxnclose hook exited with status 1 |
|
876 | abort: pretxnclose hook exited with status 1 | |
877 | [255] |
|
877 | [255] | |
878 |
|
878 | |||
879 | Hook from untrusted hgrc are reported as failure |
|
879 | Hook from untrusted hgrc are reported as failure | |
880 | ================================================ |
|
880 | ================================================ | |
881 |
|
881 | |||
882 | $ cat << EOF > $TESTTMP/untrusted.py |
|
882 | $ cat << EOF > $TESTTMP/untrusted.py | |
883 | > from mercurial import scmutil, util |
|
883 | > from mercurial import scmutil, util | |
884 | > def uisetup(ui): |
|
884 | > def uisetup(ui): | |
885 | > class untrustedui(ui.__class__): |
|
885 | > class untrustedui(ui.__class__): | |
886 | > def _trusted(self, fp, f): |
|
886 | > def _trusted(self, fp, f): | |
887 | > if util.normpath(fp.name).endswith('untrusted/.hg/hgrc'): |
|
887 | > if util.normpath(fp.name).endswith('untrusted/.hg/hgrc'): | |
888 | > return False |
|
888 | > return False | |
889 | > return super(untrustedui, self)._trusted(fp, f) |
|
889 | > return super(untrustedui, self)._trusted(fp, f) | |
890 | > ui.__class__ = untrustedui |
|
890 | > ui.__class__ = untrustedui | |
891 | > EOF |
|
891 | > EOF | |
892 | $ cat << EOF >> $HGRCPATH |
|
892 | $ cat << EOF >> $HGRCPATH | |
893 | > [extensions] |
|
893 | > [extensions] | |
894 | > untrusted=$TESTTMP/untrusted.py |
|
894 | > untrusted=$TESTTMP/untrusted.py | |
895 | > EOF |
|
895 | > EOF | |
896 | $ hg init untrusted |
|
896 | $ hg init untrusted | |
897 | $ cd untrusted |
|
897 | $ cd untrusted | |
898 |
|
898 | |||
899 | Non-blocking hook |
|
899 | Non-blocking hook | |
900 | ----------------- |
|
900 | ----------------- | |
901 |
|
901 | |||
902 | $ cat << EOF >> .hg/hgrc |
|
902 | $ cat << EOF >> .hg/hgrc | |
903 | > [hooks] |
|
903 | > [hooks] | |
904 | > txnclose.testing=echo txnclose hook called |
|
904 | > txnclose.testing=echo txnclose hook called | |
905 | > EOF |
|
905 | > EOF | |
906 | $ touch a && hg commit -Aqm a |
|
906 | $ touch a && hg commit -Aqm a | |
907 | warning: untrusted hook txnclose.testing not executed |
|
907 | warning: untrusted hook txnclose.testing not executed | |
908 | $ hg log |
|
908 | $ hg log | |
909 | changeset: 0:3903775176ed |
|
909 | changeset: 0:3903775176ed | |
910 | tag: tip |
|
910 | tag: tip | |
911 | user: test |
|
911 | user: test | |
912 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
912 | date: Thu Jan 01 00:00:00 1970 +0000 | |
913 | summary: a |
|
913 | summary: a | |
914 |
|
914 | |||
915 |
|
915 | |||
916 | Non-blocking hook |
|
916 | Non-blocking hook | |
917 | ----------------- |
|
917 | ----------------- | |
918 |
|
918 | |||
919 | $ cat << EOF >> .hg/hgrc |
|
919 | $ cat << EOF >> .hg/hgrc | |
920 | > [hooks] |
|
920 | > [hooks] | |
921 | > pretxnclose.testing=echo pre-txnclose hook called |
|
921 | > pretxnclose.testing=echo pre-txnclose hook called | |
922 | > EOF |
|
922 | > EOF | |
923 | $ touch b && hg commit -Aqm a |
|
923 | $ touch b && hg commit -Aqm a | |
924 | transaction abort! |
|
924 | transaction abort! | |
925 | rollback completed |
|
925 | rollback completed | |
926 | abort: untrusted hook pretxnclose.testing not executed |
|
926 | abort: untrusted hook pretxnclose.testing not executed | |
927 | (see 'hg help config.trusted') |
|
927 | (see 'hg help config.trusted') | |
928 | [255] |
|
928 | [255] | |
929 | $ hg log |
|
929 | $ hg log | |
930 | changeset: 0:3903775176ed |
|
930 | changeset: 0:3903775176ed | |
931 | tag: tip |
|
931 | tag: tip | |
932 | user: test |
|
932 | user: test | |
933 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
933 | date: Thu Jan 01 00:00:00 1970 +0000 | |
934 | summary: a |
|
934 | summary: a | |
935 |
|
935 |
@@ -1,347 +1,347 | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | This test is a duplicate of 'test-http.t', feel free to factor out |
|
3 | This test is a duplicate of 'test-http.t', feel free to factor out | |
4 | parts that are not bundle1/bundle2 specific. |
|
4 | parts that are not bundle1/bundle2 specific. | |
5 |
|
5 | |||
6 | $ cat << EOF >> $HGRCPATH |
|
6 | $ cat << EOF >> $HGRCPATH | |
7 | > [devel] |
|
7 | > [devel] | |
8 | > # This test is dedicated to interaction through old bundle |
|
8 | > # This test is dedicated to interaction through old bundle | |
9 | > legacy.exchange = bundle1 |
|
9 | > legacy.exchange = bundle1 | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 | $ hg init test |
|
12 | $ hg init test | |
13 | $ cd test |
|
13 | $ cd test | |
14 | $ echo foo>foo |
|
14 | $ echo foo>foo | |
15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg | |
16 | $ echo foo>foo.d/foo |
|
16 | $ echo foo>foo.d/foo | |
17 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
17 | $ echo bar>foo.d/bAr.hg.d/BaR | |
18 | $ echo bar>foo.d/baR.d.hg/bAR |
|
18 | $ echo bar>foo.d/baR.d.hg/bAR | |
19 | $ hg commit -A -m 1 |
|
19 | $ hg commit -A -m 1 | |
20 | adding foo |
|
20 | adding foo | |
21 | adding foo.d/bAr.hg.d/BaR |
|
21 | adding foo.d/bAr.hg.d/BaR | |
22 | adding foo.d/baR.d.hg/bAR |
|
22 | adding foo.d/baR.d.hg/bAR | |
23 | adding foo.d/foo |
|
23 | adding foo.d/foo | |
24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log | |
25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid | |
26 |
|
26 | |||
27 | Test server address cannot be reused |
|
27 | Test server address cannot be reused | |
28 |
|
28 | |||
29 | #if windows |
|
29 | #if windows | |
30 | $ hg serve -p $HGPORT1 2>&1 |
|
30 | $ hg serve -p $HGPORT1 2>&1 | |
31 | abort: cannot start server at 'localhost:$HGPORT1': * (glob) |
|
31 | abort: cannot start server at 'localhost:$HGPORT1': * (glob) | |
32 | [255] |
|
32 | [255] | |
33 | #else |
|
33 | #else | |
34 | $ hg serve -p $HGPORT1 2>&1 |
|
34 | $ hg serve -p $HGPORT1 2>&1 | |
35 | abort: cannot start server at 'localhost:$HGPORT1': Address already in use |
|
35 | abort: cannot start server at 'localhost:$HGPORT1': Address already in use | |
36 | [255] |
|
36 | [255] | |
37 | #endif |
|
37 | #endif | |
38 | $ cd .. |
|
38 | $ cd .. | |
39 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
39 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS | |
40 |
|
40 | |||
41 | clone via stream |
|
41 | clone via stream | |
42 |
|
42 | |||
43 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
43 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | |
44 | streaming all changes |
|
44 | streaming all changes | |
45 | 6 files to transfer, 606 bytes of data |
|
45 | 6 files to transfer, 606 bytes of data | |
46 | transferred * bytes in * seconds (*/sec) (glob) |
|
46 | transferred * bytes in * seconds (*/sec) (glob) | |
47 | searching for changes |
|
47 | searching for changes | |
48 | no changes found |
|
48 | no changes found | |
49 | updating to branch default |
|
49 | updating to branch default | |
50 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
50 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
51 | $ hg verify -R copy |
|
51 | $ hg verify -R copy | |
52 | checking changesets |
|
52 | checking changesets | |
53 | checking manifests |
|
53 | checking manifests | |
54 | crosschecking files in changesets and manifests |
|
54 | crosschecking files in changesets and manifests | |
55 | checking files |
|
55 | checking files | |
56 | 4 files, 1 changesets, 4 total revisions |
|
56 | 4 files, 1 changesets, 4 total revisions | |
57 |
|
57 | |||
58 | try to clone via stream, should use pull instead |
|
58 | try to clone via stream, should use pull instead | |
59 |
|
59 | |||
60 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
60 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 | |
61 | requesting all changes |
|
61 | requesting all changes | |
62 | adding changesets |
|
62 | adding changesets | |
63 | adding manifests |
|
63 | adding manifests | |
64 | adding file changes |
|
64 | adding file changes | |
65 | added 1 changesets with 4 changes to 4 files |
|
65 | added 1 changesets with 4 changes to 4 files | |
66 | updating to branch default |
|
66 | updating to branch default | |
67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
68 |
|
68 | |||
69 | clone via pull |
|
69 | clone via pull | |
70 |
|
70 | |||
71 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
71 | $ hg clone http://localhost:$HGPORT1/ copy-pull | |
72 | requesting all changes |
|
72 | requesting all changes | |
73 | adding changesets |
|
73 | adding changesets | |
74 | adding manifests |
|
74 | adding manifests | |
75 | adding file changes |
|
75 | adding file changes | |
76 | added 1 changesets with 4 changes to 4 files |
|
76 | added 1 changesets with 4 changes to 4 files | |
77 | updating to branch default |
|
77 | updating to branch default | |
78 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
79 | $ hg verify -R copy-pull |
|
79 | $ hg verify -R copy-pull | |
80 | checking changesets |
|
80 | checking changesets | |
81 | checking manifests |
|
81 | checking manifests | |
82 | crosschecking files in changesets and manifests |
|
82 | crosschecking files in changesets and manifests | |
83 | checking files |
|
83 | checking files | |
84 | 4 files, 1 changesets, 4 total revisions |
|
84 | 4 files, 1 changesets, 4 total revisions | |
85 | $ cd test |
|
85 | $ cd test | |
86 | $ echo bar > bar |
|
86 | $ echo bar > bar | |
87 | $ hg commit -A -d '1 0' -m 2 |
|
87 | $ hg commit -A -d '1 0' -m 2 | |
88 | adding bar |
|
88 | adding bar | |
89 | $ cd .. |
|
89 | $ cd .. | |
90 |
|
90 | |||
91 | clone over http with --update |
|
91 | clone over http with --update | |
92 |
|
92 | |||
93 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
93 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 | |
94 | requesting all changes |
|
94 | requesting all changes | |
95 | adding changesets |
|
95 | adding changesets | |
96 | adding manifests |
|
96 | adding manifests | |
97 | adding file changes |
|
97 | adding file changes | |
98 | added 2 changesets with 5 changes to 5 files |
|
98 | added 2 changesets with 5 changes to 5 files | |
99 | updating to branch default |
|
99 | updating to branch default | |
100 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
101 | $ hg log -r . -R updated |
|
101 | $ hg log -r . -R updated | |
102 | changeset: 0:8b6053c928fe |
|
102 | changeset: 0:8b6053c928fe | |
103 | user: test |
|
103 | user: test | |
104 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
104 | date: Thu Jan 01 00:00:00 1970 +0000 | |
105 | summary: 1 |
|
105 | summary: 1 | |
106 |
|
106 | |||
107 | $ rm -rf updated |
|
107 | $ rm -rf updated | |
108 |
|
108 | |||
109 | incoming via HTTP |
|
109 | incoming via HTTP | |
110 |
|
110 | |||
111 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
111 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial | |
112 | adding changesets |
|
112 | adding changesets | |
113 | adding manifests |
|
113 | adding manifests | |
114 | adding file changes |
|
114 | adding file changes | |
115 | added 1 changesets with 4 changes to 4 files |
|
115 | added 1 changesets with 4 changes to 4 files | |
116 | updating to branch default |
|
116 | updating to branch default | |
117 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
117 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 | $ cd partial |
|
118 | $ cd partial | |
119 | $ touch LOCAL |
|
119 | $ touch LOCAL | |
120 | $ hg ci -qAm LOCAL |
|
120 | $ hg ci -qAm LOCAL | |
121 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
121 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' | |
122 | comparing with http://localhost:$HGPORT1/ |
|
122 | comparing with http://localhost:$HGPORT1/ | |
123 | searching for changes |
|
123 | searching for changes | |
124 | 2 |
|
124 | 2 | |
125 | $ cd .. |
|
125 | $ cd .. | |
126 |
|
126 | |||
127 | pull |
|
127 | pull | |
128 |
|
128 | |||
129 | $ cd copy-pull |
|
129 | $ cd copy-pull | |
130 | $ cat >> .hg/hgrc <<EOF |
|
130 | $ cat >> .hg/hgrc <<EOF | |
131 | > [hooks] |
|
131 | > [hooks] | |
132 | > changegroup = sh -c "printenv.py changegroup" |
|
132 | > changegroup = sh -c "printenv.py changegroup" | |
133 | > EOF |
|
133 | > EOF | |
134 | $ hg pull |
|
134 | $ hg pull | |
135 | pulling from http://localhost:$HGPORT1/ |
|
135 | pulling from http://localhost:$HGPORT1/ | |
136 | searching for changes |
|
136 | searching for changes | |
137 | adding changesets |
|
137 | adding changesets | |
138 | adding manifests |
|
138 | adding manifests | |
139 | adding file changes |
|
139 | adding file changes | |
140 | added 1 changesets with 1 changes to 1 files |
|
140 | added 1 changesets with 1 changes to 1 files | |
141 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ |
|
141 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ | |
142 | (run 'hg update' to get a working copy) |
|
142 | (run 'hg update' to get a working copy) | |
143 | $ cd .. |
|
143 | $ cd .. | |
144 |
|
144 | |||
145 | clone from invalid URL |
|
145 | clone from invalid URL | |
146 |
|
146 | |||
147 | $ hg clone http://localhost:$HGPORT/bad |
|
147 | $ hg clone http://localhost:$HGPORT/bad | |
148 | abort: HTTP Error 404: Not Found |
|
148 | abort: HTTP Error 404: Not Found | |
149 | [255] |
|
149 | [255] | |
150 |
|
150 | |||
151 | test http authentication |
|
151 | test http authentication | |
152 | + use the same server to test server side streaming preference |
|
152 | + use the same server to test server side streaming preference | |
153 |
|
153 | |||
154 | $ cd test |
|
154 | $ cd test | |
155 | $ cat << EOT > userpass.py |
|
155 | $ cat << EOT > userpass.py | |
156 | > import base64 |
|
156 | > import base64 | |
157 | > from mercurial.hgweb import common |
|
157 | > from mercurial.hgweb import common | |
158 | > def perform_authentication(hgweb, req, op): |
|
158 | > def perform_authentication(hgweb, req, op): | |
159 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
159 | > auth = req.env.get('HTTP_AUTHORIZATION') | |
160 | > if not auth: |
|
160 | > if not auth: | |
161 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
161 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', | |
162 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
162 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) | |
163 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
163 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: | |
164 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
164 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') | |
165 | > def extsetup(): |
|
165 | > def extsetup(): | |
166 | > common.permhooks.insert(0, perform_authentication) |
|
166 | > common.permhooks.insert(0, perform_authentication) | |
167 | > EOT |
|
167 | > EOT | |
168 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
168 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ | |
169 | > --config server.preferuncompressed=True \ |
|
169 | > --config server.preferuncompressed=True \ | |
170 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
170 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log | |
171 | $ cat pid >> $DAEMON_PIDS |
|
171 | $ cat pid >> $DAEMON_PIDS | |
172 |
|
172 | |||
173 | $ cat << EOF > get_pass.py |
|
173 | $ cat << EOF > get_pass.py | |
174 | > import getpass |
|
174 | > import getpass | |
175 | > def newgetpass(arg): |
|
175 | > def newgetpass(arg): | |
176 | > return "pass" |
|
176 | > return "pass" | |
177 | > getpass.getpass = newgetpass |
|
177 | > getpass.getpass = newgetpass | |
178 | > EOF |
|
178 | > EOF | |
179 |
|
179 | |||
180 | $ hg id http://localhost:$HGPORT2/ |
|
180 | $ hg id http://localhost:$HGPORT2/ | |
181 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
181 | abort: http authorization required for http://localhost:$HGPORT2/ | |
182 | [255] |
|
182 | [255] | |
183 | $ hg id http://localhost:$HGPORT2/ |
|
183 | $ hg id http://localhost:$HGPORT2/ | |
184 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
184 | abort: http authorization required for http://localhost:$HGPORT2/ | |
185 | [255] |
|
185 | [255] | |
186 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
186 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
187 | http authorization required for http://localhost:$HGPORT2/ |
|
187 | http authorization required for http://localhost:$HGPORT2/ | |
188 | realm: mercurial |
|
188 | realm: mercurial | |
189 | user: user |
|
189 | user: user | |
190 | password: 5fed3813f7f5 |
|
190 | password: 5fed3813f7f5 | |
191 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
191 | $ hg id http://user:pass@localhost:$HGPORT2/ | |
192 | 5fed3813f7f5 |
|
192 | 5fed3813f7f5 | |
193 | $ echo '[auth]' >> .hg/hgrc |
|
193 | $ echo '[auth]' >> .hg/hgrc | |
194 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
194 | $ echo 'l.schemes=http' >> .hg/hgrc | |
195 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
195 | $ echo 'l.prefix=lo' >> .hg/hgrc | |
196 | $ echo 'l.username=user' >> .hg/hgrc |
|
196 | $ echo 'l.username=user' >> .hg/hgrc | |
197 | $ echo 'l.password=pass' >> .hg/hgrc |
|
197 | $ echo 'l.password=pass' >> .hg/hgrc | |
198 | $ hg id http://localhost:$HGPORT2/ |
|
198 | $ hg id http://localhost:$HGPORT2/ | |
199 | 5fed3813f7f5 |
|
199 | 5fed3813f7f5 | |
200 | $ hg id http://localhost:$HGPORT2/ |
|
200 | $ hg id http://localhost:$HGPORT2/ | |
201 | 5fed3813f7f5 |
|
201 | 5fed3813f7f5 | |
202 | $ hg id http://user@localhost:$HGPORT2/ |
|
202 | $ hg id http://user@localhost:$HGPORT2/ | |
203 | 5fed3813f7f5 |
|
203 | 5fed3813f7f5 | |
204 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
204 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 | |
205 | streaming all changes |
|
205 | streaming all changes | |
206 | 7 files to transfer, 916 bytes of data |
|
206 | 7 files to transfer, 916 bytes of data | |
207 | transferred * bytes in * seconds (*/sec) (glob) |
|
207 | transferred * bytes in * seconds (*/sec) (glob) | |
208 | searching for changes |
|
208 | searching for changes | |
209 | no changes found |
|
209 | no changes found | |
210 | updating to branch default |
|
210 | updating to branch default | |
211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
212 | --pull should override server's preferuncompressed |
|
212 | --pull should override server's preferuncompressed | |
213 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
213 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 | |
214 | requesting all changes |
|
214 | requesting all changes | |
215 | adding changesets |
|
215 | adding changesets | |
216 | adding manifests |
|
216 | adding manifests | |
217 | adding file changes |
|
217 | adding file changes | |
218 | added 2 changesets with 5 changes to 5 files |
|
218 | added 2 changesets with 5 changes to 5 files | |
219 | updating to branch default |
|
219 | updating to branch default | |
220 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
220 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
221 |
|
221 | |||
222 | $ hg id http://user2@localhost:$HGPORT2/ |
|
222 | $ hg id http://user2@localhost:$HGPORT2/ | |
223 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
223 | abort: http authorization required for http://localhost:$HGPORT2/ | |
224 | [255] |
|
224 | [255] | |
225 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
225 | $ hg id http://user:pass2@localhost:$HGPORT2/ | |
226 | abort: HTTP Error 403: no |
|
226 | abort: HTTP Error 403: no | |
227 | [255] |
|
227 | [255] | |
228 |
|
228 | |||
229 | $ hg -R dest tag -r tip top |
|
229 | $ hg -R dest tag -r tip top | |
230 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
230 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ | |
231 | pushing to http://user:***@localhost:$HGPORT2/ |
|
231 | pushing to http://user:***@localhost:$HGPORT2/ | |
232 | searching for changes |
|
232 | searching for changes | |
233 | remote: adding changesets |
|
233 | remote: adding changesets | |
234 | remote: adding manifests |
|
234 | remote: adding manifests | |
235 | remote: adding file changes |
|
235 | remote: adding file changes | |
236 | remote: added 1 changesets with 1 changes to 1 files |
|
236 | remote: added 1 changesets with 1 changes to 1 files | |
237 | $ hg rollback -q |
|
237 | $ hg rollback -q | |
238 |
|
238 | |||
239 | $ sed 's/.*] "/"/' < ../access.log |
|
239 | $ sed 's/.*] "/"/' < ../access.log | |
240 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
240 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
241 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
241 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
242 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
242 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
243 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
243 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
244 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
244 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
245 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
246 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
246 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
247 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
247 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
248 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
248 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
249 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
251 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
251 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
252 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
252 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
253 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
253 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
254 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
256 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
256 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
257 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
257 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
258 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
258 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
259 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
261 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
261 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
262 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
262 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
263 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
263 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
264 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
264 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
265 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
265 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
266 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
266 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
267 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
267 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
268 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
268 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
269 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
269 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
270 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
270 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
271 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
271 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
272 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
272 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
273 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
273 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
274 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
274 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
276 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
276 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
277 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
278 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
278 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
279 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
279 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
280 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
280 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
281 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
281 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
282 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
282 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
284 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
284 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
285 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
285 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
286 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
287 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
287 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
288 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
288 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
289 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
289 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
290 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
290 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
291 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
291 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
292 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
292 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
293 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
293 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
294 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
294 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
295 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
295 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
296 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
296 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
297 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
297 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
299 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) |
|
299 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) | |
300 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
300 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
301 |
|
301 | |||
302 | $ cd .. |
|
302 | $ cd .. | |
303 |
|
303 | |||
304 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
304 | clone of serve with repo in root and unserved subrepo (issue2970) | |
305 |
|
305 | |||
306 | $ hg --cwd test init sub |
|
306 | $ hg --cwd test init sub | |
307 | $ echo empty > test/sub/empty |
|
307 | $ echo empty > test/sub/empty | |
308 | $ hg --cwd test/sub add empty |
|
308 | $ hg --cwd test/sub add empty | |
309 | $ hg --cwd test/sub commit -qm 'add empty' |
|
309 | $ hg --cwd test/sub commit -qm 'add empty' | |
310 | $ hg --cwd test/sub tag -r 0 something |
|
310 | $ hg --cwd test/sub tag -r 0 something | |
311 | $ echo sub = sub > test/.hgsub |
|
311 | $ echo sub = sub > test/.hgsub | |
312 | $ hg --cwd test add .hgsub |
|
312 | $ hg --cwd test add .hgsub | |
313 | $ hg --cwd test commit -qm 'add subrepo' |
|
313 | $ hg --cwd test commit -qm 'add subrepo' | |
314 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
314 | $ hg clone http://localhost:$HGPORT noslash-clone | |
315 | requesting all changes |
|
315 | requesting all changes | |
316 | adding changesets |
|
316 | adding changesets | |
317 | adding manifests |
|
317 | adding manifests | |
318 | adding file changes |
|
318 | adding file changes | |
319 | added 3 changesets with 7 changes to 7 files |
|
319 | added 3 changesets with 7 changes to 7 files | |
320 | updating to branch default |
|
320 | updating to branch default | |
321 | abort: HTTP Error 404: Not Found |
|
321 | abort: HTTP Error 404: Not Found | |
322 | [255] |
|
322 | [255] | |
323 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
323 | $ hg clone http://localhost:$HGPORT/ slash-clone | |
324 | requesting all changes |
|
324 | requesting all changes | |
325 | adding changesets |
|
325 | adding changesets | |
326 | adding manifests |
|
326 | adding manifests | |
327 | adding file changes |
|
327 | adding file changes | |
328 | added 3 changesets with 7 changes to 7 files |
|
328 | added 3 changesets with 7 changes to 7 files | |
329 | updating to branch default |
|
329 | updating to branch default | |
330 | abort: HTTP Error 404: Not Found |
|
330 | abort: HTTP Error 404: Not Found | |
331 | [255] |
|
331 | [255] | |
332 |
|
332 | |||
333 | check error log |
|
333 | check error log | |
334 |
|
334 | |||
335 | $ cat error.log |
|
335 | $ cat error.log | |
336 |
|
336 | |||
337 | Check error reporting while pulling/cloning |
|
337 | Check error reporting while pulling/cloning | |
338 |
|
338 | |||
339 | $ $RUNTESTDIR/killdaemons.py |
|
339 | $ $RUNTESTDIR/killdaemons.py | |
340 | $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py |
|
340 | $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py | |
341 | $ cat hg3.pid >> $DAEMON_PIDS |
|
341 | $ cat hg3.pid >> $DAEMON_PIDS | |
342 | $ hg clone http://localhost:$HGPORT/ abort-clone |
|
342 | $ hg clone http://localhost:$HGPORT/ abort-clone | |
343 | requesting all changes |
|
343 | requesting all changes | |
344 | abort: remote error: |
|
344 | abort: remote error: | |
345 | this is an exercise |
|
345 | this is an exercise | |
346 | [255] |
|
346 | [255] | |
347 | $ cat error.log |
|
347 | $ cat error.log |
@@ -1,335 +1,335 | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo foo>foo |
|
5 | $ echo foo>foo | |
6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg | |
7 | $ echo foo>foo.d/foo |
|
7 | $ echo foo>foo.d/foo | |
8 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
8 | $ echo bar>foo.d/bAr.hg.d/BaR | |
9 | $ echo bar>foo.d/baR.d.hg/bAR |
|
9 | $ echo bar>foo.d/baR.d.hg/bAR | |
10 | $ hg commit -A -m 1 |
|
10 | $ hg commit -A -m 1 | |
11 | adding foo |
|
11 | adding foo | |
12 | adding foo.d/bAr.hg.d/BaR |
|
12 | adding foo.d/bAr.hg.d/BaR | |
13 | adding foo.d/baR.d.hg/bAR |
|
13 | adding foo.d/baR.d.hg/bAR | |
14 | adding foo.d/foo |
|
14 | adding foo.d/foo | |
15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log | |
16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid | |
17 |
|
17 | |||
18 | Test server address cannot be reused |
|
18 | Test server address cannot be reused | |
19 |
|
19 | |||
20 | #if windows |
|
20 | #if windows | |
21 | $ hg serve -p $HGPORT1 2>&1 |
|
21 | $ hg serve -p $HGPORT1 2>&1 | |
22 | abort: cannot start server at ':$HGPORT1': * (glob) |
|
22 | abort: cannot start server at ':$HGPORT1': * (glob) | |
23 | [255] |
|
23 | [255] | |
24 | #else |
|
24 | #else | |
25 | $ hg serve -p $HGPORT1 2>&1 |
|
25 | $ hg serve -p $HGPORT1 2>&1 | |
26 | abort: cannot start server at 'localhost:$HGPORT1': Address already in use |
|
26 | abort: cannot start server at 'localhost:$HGPORT1': Address already in use | |
27 | [255] |
|
27 | [255] | |
28 | #endif |
|
28 | #endif | |
29 | $ cd .. |
|
29 | $ cd .. | |
30 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
30 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS | |
31 |
|
31 | |||
32 | clone via stream |
|
32 | clone via stream | |
33 |
|
33 | |||
34 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
34 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | |
35 | streaming all changes |
|
35 | streaming all changes | |
36 | 6 files to transfer, 606 bytes of data |
|
36 | 6 files to transfer, 606 bytes of data | |
37 | transferred * bytes in * seconds (*/sec) (glob) |
|
37 | transferred * bytes in * seconds (*/sec) (glob) | |
38 | searching for changes |
|
38 | searching for changes | |
39 | no changes found |
|
39 | no changes found | |
40 | updating to branch default |
|
40 | updating to branch default | |
41 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | $ hg verify -R copy |
|
42 | $ hg verify -R copy | |
43 | checking changesets |
|
43 | checking changesets | |
44 | checking manifests |
|
44 | checking manifests | |
45 | crosschecking files in changesets and manifests |
|
45 | crosschecking files in changesets and manifests | |
46 | checking files |
|
46 | checking files | |
47 | 4 files, 1 changesets, 4 total revisions |
|
47 | 4 files, 1 changesets, 4 total revisions | |
48 |
|
48 | |||
49 | try to clone via stream, should use pull instead |
|
49 | try to clone via stream, should use pull instead | |
50 |
|
50 | |||
51 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
51 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 | |
52 | requesting all changes |
|
52 | requesting all changes | |
53 | adding changesets |
|
53 | adding changesets | |
54 | adding manifests |
|
54 | adding manifests | |
55 | adding file changes |
|
55 | adding file changes | |
56 | added 1 changesets with 4 changes to 4 files |
|
56 | added 1 changesets with 4 changes to 4 files | |
57 | updating to branch default |
|
57 | updating to branch default | |
58 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
58 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
59 |
|
59 | |||
60 | clone via pull |
|
60 | clone via pull | |
61 |
|
61 | |||
62 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
62 | $ hg clone http://localhost:$HGPORT1/ copy-pull | |
63 | requesting all changes |
|
63 | requesting all changes | |
64 | adding changesets |
|
64 | adding changesets | |
65 | adding manifests |
|
65 | adding manifests | |
66 | adding file changes |
|
66 | adding file changes | |
67 | added 1 changesets with 4 changes to 4 files |
|
67 | added 1 changesets with 4 changes to 4 files | |
68 | updating to branch default |
|
68 | updating to branch default | |
69 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
70 | $ hg verify -R copy-pull |
|
70 | $ hg verify -R copy-pull | |
71 | checking changesets |
|
71 | checking changesets | |
72 | checking manifests |
|
72 | checking manifests | |
73 | crosschecking files in changesets and manifests |
|
73 | crosschecking files in changesets and manifests | |
74 | checking files |
|
74 | checking files | |
75 | 4 files, 1 changesets, 4 total revisions |
|
75 | 4 files, 1 changesets, 4 total revisions | |
76 | $ cd test |
|
76 | $ cd test | |
77 | $ echo bar > bar |
|
77 | $ echo bar > bar | |
78 | $ hg commit -A -d '1 0' -m 2 |
|
78 | $ hg commit -A -d '1 0' -m 2 | |
79 | adding bar |
|
79 | adding bar | |
80 | $ cd .. |
|
80 | $ cd .. | |
81 |
|
81 | |||
82 | clone over http with --update |
|
82 | clone over http with --update | |
83 |
|
83 | |||
84 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
84 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 | |
85 | requesting all changes |
|
85 | requesting all changes | |
86 | adding changesets |
|
86 | adding changesets | |
87 | adding manifests |
|
87 | adding manifests | |
88 | adding file changes |
|
88 | adding file changes | |
89 | added 2 changesets with 5 changes to 5 files |
|
89 | added 2 changesets with 5 changes to 5 files | |
90 | updating to branch default |
|
90 | updating to branch default | |
91 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
92 | $ hg log -r . -R updated |
|
92 | $ hg log -r . -R updated | |
93 | changeset: 0:8b6053c928fe |
|
93 | changeset: 0:8b6053c928fe | |
94 | user: test |
|
94 | user: test | |
95 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
95 | date: Thu Jan 01 00:00:00 1970 +0000 | |
96 | summary: 1 |
|
96 | summary: 1 | |
97 |
|
97 | |||
98 | $ rm -rf updated |
|
98 | $ rm -rf updated | |
99 |
|
99 | |||
100 | incoming via HTTP |
|
100 | incoming via HTTP | |
101 |
|
101 | |||
102 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
102 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial | |
103 | adding changesets |
|
103 | adding changesets | |
104 | adding manifests |
|
104 | adding manifests | |
105 | adding file changes |
|
105 | adding file changes | |
106 | added 1 changesets with 4 changes to 4 files |
|
106 | added 1 changesets with 4 changes to 4 files | |
107 | updating to branch default |
|
107 | updating to branch default | |
108 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
108 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
109 | $ cd partial |
|
109 | $ cd partial | |
110 | $ touch LOCAL |
|
110 | $ touch LOCAL | |
111 | $ hg ci -qAm LOCAL |
|
111 | $ hg ci -qAm LOCAL | |
112 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
112 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' | |
113 | comparing with http://localhost:$HGPORT1/ |
|
113 | comparing with http://localhost:$HGPORT1/ | |
114 | searching for changes |
|
114 | searching for changes | |
115 | 2 |
|
115 | 2 | |
116 | $ cd .. |
|
116 | $ cd .. | |
117 |
|
117 | |||
118 | pull |
|
118 | pull | |
119 |
|
119 | |||
120 | $ cd copy-pull |
|
120 | $ cd copy-pull | |
121 | $ cat >> .hg/hgrc <<EOF |
|
121 | $ cat >> .hg/hgrc <<EOF | |
122 | > [hooks] |
|
122 | > [hooks] | |
123 | > changegroup = sh -c "printenv.py changegroup" |
|
123 | > changegroup = sh -c "printenv.py changegroup" | |
124 | > EOF |
|
124 | > EOF | |
125 | $ hg pull |
|
125 | $ hg pull | |
126 | pulling from http://localhost:$HGPORT1/ |
|
126 | pulling from http://localhost:$HGPORT1/ | |
127 | searching for changes |
|
127 | searching for changes | |
128 | adding changesets |
|
128 | adding changesets | |
129 | adding manifests |
|
129 | adding manifests | |
130 | adding file changes |
|
130 | adding file changes | |
131 | added 1 changesets with 1 changes to 1 files |
|
131 | added 1 changesets with 1 changes to 1 files | |
132 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ |
|
132 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ | |
133 | (run 'hg update' to get a working copy) |
|
133 | (run 'hg update' to get a working copy) | |
134 | $ cd .. |
|
134 | $ cd .. | |
135 |
|
135 | |||
136 | clone from invalid URL |
|
136 | clone from invalid URL | |
137 |
|
137 | |||
138 | $ hg clone http://localhost:$HGPORT/bad |
|
138 | $ hg clone http://localhost:$HGPORT/bad | |
139 | abort: HTTP Error 404: Not Found |
|
139 | abort: HTTP Error 404: Not Found | |
140 | [255] |
|
140 | [255] | |
141 |
|
141 | |||
142 | test http authentication |
|
142 | test http authentication | |
143 | + use the same server to test server side streaming preference |
|
143 | + use the same server to test server side streaming preference | |
144 |
|
144 | |||
145 | $ cd test |
|
145 | $ cd test | |
146 | $ cat << EOT > userpass.py |
|
146 | $ cat << EOT > userpass.py | |
147 | > import base64 |
|
147 | > import base64 | |
148 | > from mercurial.hgweb import common |
|
148 | > from mercurial.hgweb import common | |
149 | > def perform_authentication(hgweb, req, op): |
|
149 | > def perform_authentication(hgweb, req, op): | |
150 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
150 | > auth = req.env.get('HTTP_AUTHORIZATION') | |
151 | > if not auth: |
|
151 | > if not auth: | |
152 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
152 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', | |
153 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
153 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) | |
154 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
154 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: | |
155 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
155 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') | |
156 | > def extsetup(): |
|
156 | > def extsetup(): | |
157 | > common.permhooks.insert(0, perform_authentication) |
|
157 | > common.permhooks.insert(0, perform_authentication) | |
158 | > EOT |
|
158 | > EOT | |
159 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
159 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ | |
160 | > --config server.preferuncompressed=True \ |
|
160 | > --config server.preferuncompressed=True \ | |
161 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
161 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log | |
162 | $ cat pid >> $DAEMON_PIDS |
|
162 | $ cat pid >> $DAEMON_PIDS | |
163 |
|
163 | |||
164 | $ cat << EOF > get_pass.py |
|
164 | $ cat << EOF > get_pass.py | |
165 | > import getpass |
|
165 | > import getpass | |
166 | > def newgetpass(arg): |
|
166 | > def newgetpass(arg): | |
167 | > return "pass" |
|
167 | > return "pass" | |
168 | > getpass.getpass = newgetpass |
|
168 | > getpass.getpass = newgetpass | |
169 | > EOF |
|
169 | > EOF | |
170 |
|
170 | |||
171 | $ hg id http://localhost:$HGPORT2/ |
|
171 | $ hg id http://localhost:$HGPORT2/ | |
172 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
172 | abort: http authorization required for http://localhost:$HGPORT2/ | |
173 | [255] |
|
173 | [255] | |
174 | $ hg id http://localhost:$HGPORT2/ |
|
174 | $ hg id http://localhost:$HGPORT2/ | |
175 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
175 | abort: http authorization required for http://localhost:$HGPORT2/ | |
176 | [255] |
|
176 | [255] | |
177 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
177 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
178 | http authorization required for http://localhost:$HGPORT2/ |
|
178 | http authorization required for http://localhost:$HGPORT2/ | |
179 | realm: mercurial |
|
179 | realm: mercurial | |
180 | user: user |
|
180 | user: user | |
181 | password: 5fed3813f7f5 |
|
181 | password: 5fed3813f7f5 | |
182 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
182 | $ hg id http://user:pass@localhost:$HGPORT2/ | |
183 | 5fed3813f7f5 |
|
183 | 5fed3813f7f5 | |
184 | $ echo '[auth]' >> .hg/hgrc |
|
184 | $ echo '[auth]' >> .hg/hgrc | |
185 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
185 | $ echo 'l.schemes=http' >> .hg/hgrc | |
186 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
186 | $ echo 'l.prefix=lo' >> .hg/hgrc | |
187 | $ echo 'l.username=user' >> .hg/hgrc |
|
187 | $ echo 'l.username=user' >> .hg/hgrc | |
188 | $ echo 'l.password=pass' >> .hg/hgrc |
|
188 | $ echo 'l.password=pass' >> .hg/hgrc | |
189 | $ hg id http://localhost:$HGPORT2/ |
|
189 | $ hg id http://localhost:$HGPORT2/ | |
190 | 5fed3813f7f5 |
|
190 | 5fed3813f7f5 | |
191 | $ hg id http://localhost:$HGPORT2/ |
|
191 | $ hg id http://localhost:$HGPORT2/ | |
192 | 5fed3813f7f5 |
|
192 | 5fed3813f7f5 | |
193 | $ hg id http://user@localhost:$HGPORT2/ |
|
193 | $ hg id http://user@localhost:$HGPORT2/ | |
194 | 5fed3813f7f5 |
|
194 | 5fed3813f7f5 | |
195 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
195 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 | |
196 | streaming all changes |
|
196 | streaming all changes | |
197 | 7 files to transfer, 916 bytes of data |
|
197 | 7 files to transfer, 916 bytes of data | |
198 | transferred * bytes in * seconds (*/sec) (glob) |
|
198 | transferred * bytes in * seconds (*/sec) (glob) | |
199 | searching for changes |
|
199 | searching for changes | |
200 | no changes found |
|
200 | no changes found | |
201 | updating to branch default |
|
201 | updating to branch default | |
202 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
202 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
203 | --pull should override server's preferuncompressed |
|
203 | --pull should override server's preferuncompressed | |
204 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
204 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 | |
205 | requesting all changes |
|
205 | requesting all changes | |
206 | adding changesets |
|
206 | adding changesets | |
207 | adding manifests |
|
207 | adding manifests | |
208 | adding file changes |
|
208 | adding file changes | |
209 | added 2 changesets with 5 changes to 5 files |
|
209 | added 2 changesets with 5 changes to 5 files | |
210 | updating to branch default |
|
210 | updating to branch default | |
211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
212 |
|
212 | |||
213 | $ hg id http://user2@localhost:$HGPORT2/ |
|
213 | $ hg id http://user2@localhost:$HGPORT2/ | |
214 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
214 | abort: http authorization required for http://localhost:$HGPORT2/ | |
215 | [255] |
|
215 | [255] | |
216 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
216 | $ hg id http://user:pass2@localhost:$HGPORT2/ | |
217 | abort: HTTP Error 403: no |
|
217 | abort: HTTP Error 403: no | |
218 | [255] |
|
218 | [255] | |
219 |
|
219 | |||
220 | $ hg -R dest tag -r tip top |
|
220 | $ hg -R dest tag -r tip top | |
221 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
221 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ | |
222 | pushing to http://user:***@localhost:$HGPORT2/ |
|
222 | pushing to http://user:***@localhost:$HGPORT2/ | |
223 | searching for changes |
|
223 | searching for changes | |
224 | remote: adding changesets |
|
224 | remote: adding changesets | |
225 | remote: adding manifests |
|
225 | remote: adding manifests | |
226 | remote: adding file changes |
|
226 | remote: adding file changes | |
227 | remote: added 1 changesets with 1 changes to 1 files |
|
227 | remote: added 1 changesets with 1 changes to 1 files | |
228 | $ hg rollback -q |
|
228 | $ hg rollback -q | |
229 |
|
229 | |||
230 | $ sed 's/.*] "/"/' < ../access.log |
|
230 | $ sed 's/.*] "/"/' < ../access.log | |
231 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
231 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
232 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
232 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
233 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
233 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
234 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
234 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
235 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
235 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
236 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
236 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
237 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
237 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
238 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
238 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
239 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
239 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
240 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
240 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
241 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
241 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
242 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
242 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
243 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
243 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
244 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
244 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
245 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
246 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
246 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
247 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
247 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
248 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
248 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
249 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
251 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
251 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
252 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
252 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
253 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
253 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
254 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
256 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
256 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
257 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
257 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
258 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
258 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
259 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
261 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
261 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
262 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
262 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
263 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
263 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
264 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
264 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
265 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
265 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
266 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
266 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
267 | "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=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
267 | "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=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
268 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
268 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
269 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
269 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
270 | "GET /?cmd=getbundle HTTP/1.1" 401 - 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=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
270 | "GET /?cmd=getbundle HTTP/1.1" 401 - 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=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
271 | "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=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
271 | "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=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
272 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
272 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
273 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
273 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
274 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
274 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
275 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
275 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
276 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
276 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
278 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
278 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
279 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
279 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
280 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
280 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
281 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
281 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
282 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
282 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
284 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
284 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
285 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
285 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
287 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) |
|
287 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) | |
288 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
288 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
289 |
|
289 | |||
290 | $ cd .. |
|
290 | $ cd .. | |
291 |
|
291 | |||
292 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
292 | clone of serve with repo in root and unserved subrepo (issue2970) | |
293 |
|
293 | |||
294 | $ hg --cwd test init sub |
|
294 | $ hg --cwd test init sub | |
295 | $ echo empty > test/sub/empty |
|
295 | $ echo empty > test/sub/empty | |
296 | $ hg --cwd test/sub add empty |
|
296 | $ hg --cwd test/sub add empty | |
297 | $ hg --cwd test/sub commit -qm 'add empty' |
|
297 | $ hg --cwd test/sub commit -qm 'add empty' | |
298 | $ hg --cwd test/sub tag -r 0 something |
|
298 | $ hg --cwd test/sub tag -r 0 something | |
299 | $ echo sub = sub > test/.hgsub |
|
299 | $ echo sub = sub > test/.hgsub | |
300 | $ hg --cwd test add .hgsub |
|
300 | $ hg --cwd test add .hgsub | |
301 | $ hg --cwd test commit -qm 'add subrepo' |
|
301 | $ hg --cwd test commit -qm 'add subrepo' | |
302 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
302 | $ hg clone http://localhost:$HGPORT noslash-clone | |
303 | requesting all changes |
|
303 | requesting all changes | |
304 | adding changesets |
|
304 | adding changesets | |
305 | adding manifests |
|
305 | adding manifests | |
306 | adding file changes |
|
306 | adding file changes | |
307 | added 3 changesets with 7 changes to 7 files |
|
307 | added 3 changesets with 7 changes to 7 files | |
308 | updating to branch default |
|
308 | updating to branch default | |
309 | abort: HTTP Error 404: Not Found |
|
309 | abort: HTTP Error 404: Not Found | |
310 | [255] |
|
310 | [255] | |
311 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
311 | $ hg clone http://localhost:$HGPORT/ slash-clone | |
312 | requesting all changes |
|
312 | requesting all changes | |
313 | adding changesets |
|
313 | adding changesets | |
314 | adding manifests |
|
314 | adding manifests | |
315 | adding file changes |
|
315 | adding file changes | |
316 | added 3 changesets with 7 changes to 7 files |
|
316 | added 3 changesets with 7 changes to 7 files | |
317 | updating to branch default |
|
317 | updating to branch default | |
318 | abort: HTTP Error 404: Not Found |
|
318 | abort: HTTP Error 404: Not Found | |
319 | [255] |
|
319 | [255] | |
320 |
|
320 | |||
321 | check error log |
|
321 | check error log | |
322 |
|
322 | |||
323 | $ cat error.log |
|
323 | $ cat error.log | |
324 |
|
324 | |||
325 | check abort error reporting while pulling/cloning |
|
325 | check abort error reporting while pulling/cloning | |
326 |
|
326 | |||
327 | $ $RUNTESTDIR/killdaemons.py |
|
327 | $ $RUNTESTDIR/killdaemons.py | |
328 | $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py |
|
328 | $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py | |
329 | $ cat hg3.pid >> $DAEMON_PIDS |
|
329 | $ cat hg3.pid >> $DAEMON_PIDS | |
330 | $ hg clone http://localhost:$HGPORT/ abort-clone |
|
330 | $ hg clone http://localhost:$HGPORT/ abort-clone | |
331 | requesting all changes |
|
331 | requesting all changes | |
332 | remote: abort: this is an exercise |
|
332 | remote: abort: this is an exercise | |
333 | abort: pull failed on remote |
|
333 | abort: pull failed on remote | |
334 | [255] |
|
334 | [255] | |
335 | $ cat error.log |
|
335 | $ cat error.log |
@@ -1,644 +1,644 | |||||
1 | #require serve ssl |
|
1 | #require serve ssl | |
2 |
|
2 | |||
3 | Proper https client requires the built-in ssl from Python 2.6. |
|
3 | Proper https client requires the built-in ssl from Python 2.6. | |
4 |
|
4 | |||
5 | Make server certificates: |
|
5 | Make server certificates: | |
6 |
|
6 | |||
7 | $ CERTSDIR="$TESTDIR/sslcerts" |
|
7 | $ CERTSDIR="$TESTDIR/sslcerts" | |
8 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem |
|
8 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem | |
9 | $ PRIV=`pwd`/server.pem |
|
9 | $ PRIV=`pwd`/server.pem | |
10 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem |
|
10 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem | |
11 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem |
|
11 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem | |
12 |
|
12 | |||
13 | $ hg init test |
|
13 | $ hg init test | |
14 | $ cd test |
|
14 | $ cd test | |
15 | $ echo foo>foo |
|
15 | $ echo foo>foo | |
16 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
16 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg | |
17 | $ echo foo>foo.d/foo |
|
17 | $ echo foo>foo.d/foo | |
18 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
18 | $ echo bar>foo.d/bAr.hg.d/BaR | |
19 | $ echo bar>foo.d/baR.d.hg/bAR |
|
19 | $ echo bar>foo.d/baR.d.hg/bAR | |
20 | $ hg commit -A -m 1 |
|
20 | $ hg commit -A -m 1 | |
21 | adding foo |
|
21 | adding foo | |
22 | adding foo.d/bAr.hg.d/BaR |
|
22 | adding foo.d/bAr.hg.d/BaR | |
23 | adding foo.d/baR.d.hg/bAR |
|
23 | adding foo.d/baR.d.hg/bAR | |
24 | adding foo.d/foo |
|
24 | adding foo.d/foo | |
25 | $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV |
|
25 | $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV | |
26 | $ cat ../hg0.pid >> $DAEMON_PIDS |
|
26 | $ cat ../hg0.pid >> $DAEMON_PIDS | |
27 |
|
27 | |||
28 | cacert not found |
|
28 | cacert not found | |
29 |
|
29 | |||
30 | $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/ |
|
30 | $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/ | |
31 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
31 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
32 | abort: could not find web.cacerts: no-such.pem |
|
32 | abort: could not find web.cacerts: no-such.pem | |
33 | [255] |
|
33 | [255] | |
34 |
|
34 | |||
35 | Test server address cannot be reused |
|
35 | Test server address cannot be reused | |
36 |
|
36 | |||
37 | #if windows |
|
37 | #if windows | |
38 | $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 |
|
38 | $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 | |
39 | abort: cannot start server at 'localhost:$HGPORT': |
|
39 | abort: cannot start server at 'localhost:$HGPORT': | |
40 | [255] |
|
40 | [255] | |
41 | #else |
|
41 | #else | |
42 | $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 |
|
42 | $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 | |
43 | abort: cannot start server at 'localhost:$HGPORT': Address already in use |
|
43 | abort: cannot start server at 'localhost:$HGPORT': Address already in use | |
44 | [255] |
|
44 | [255] | |
45 | #endif |
|
45 | #endif | |
46 | $ cd .. |
|
46 | $ cd .. | |
47 |
|
47 | |||
48 | Our test cert is not signed by a trusted CA. It should fail to verify if |
|
48 | Our test cert is not signed by a trusted CA. It should fail to verify if | |
49 | we are able to load CA certs. |
|
49 | we are able to load CA certs. | |
50 |
|
50 | |||
51 | #if sslcontext defaultcacerts no-defaultcacertsloaded |
|
51 | #if sslcontext defaultcacerts no-defaultcacertsloaded | |
52 | $ hg clone https://localhost:$HGPORT/ copy-pull |
|
52 | $ hg clone https://localhost:$HGPORT/ copy-pull | |
53 | (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) |
|
53 | (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) | |
54 | abort: error: *certificate verify failed* (glob) |
|
54 | abort: error: *certificate verify failed* (glob) | |
55 | [255] |
|
55 | [255] | |
56 | #endif |
|
56 | #endif | |
57 |
|
57 | |||
58 | #if no-sslcontext defaultcacerts |
|
58 | #if no-sslcontext defaultcacerts | |
59 | $ hg clone https://localhost:$HGPORT/ copy-pull |
|
59 | $ hg clone https://localhost:$HGPORT/ copy-pull | |
60 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
60 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
61 | (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) |
|
61 | (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) | |
62 | abort: error: *certificate verify failed* (glob) |
|
62 | abort: error: *certificate verify failed* (glob) | |
63 | [255] |
|
63 | [255] | |
64 | #endif |
|
64 | #endif | |
65 |
|
65 | |||
66 | #if no-sslcontext windows |
|
66 | #if no-sslcontext windows | |
67 | $ hg clone https://localhost:$HGPORT/ copy-pull |
|
67 | $ hg clone https://localhost:$HGPORT/ copy-pull | |
68 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info |
|
68 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info | |
69 | (unable to load Windows CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) |
|
69 | (unable to load Windows CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) | |
70 | abort: error: *certificate verify failed* (glob) |
|
70 | abort: error: *certificate verify failed* (glob) | |
71 | [255] |
|
71 | [255] | |
72 | #endif |
|
72 | #endif | |
73 |
|
73 | |||
74 | #if no-sslcontext osx |
|
74 | #if no-sslcontext osx | |
75 | $ hg clone https://localhost:$HGPORT/ copy-pull |
|
75 | $ hg clone https://localhost:$HGPORT/ copy-pull | |
76 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info |
|
76 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info | |
77 | (unable to load CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) |
|
77 | (unable to load CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) | |
78 | abort: localhost certificate error: no certificate received |
|
78 | abort: localhost certificate error: no certificate received | |
79 | (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) |
|
79 | (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) | |
80 | [255] |
|
80 | [255] | |
81 | #endif |
|
81 | #endif | |
82 |
|
82 | |||
83 | #if defaultcacertsloaded |
|
83 | #if defaultcacertsloaded | |
84 | $ hg clone https://localhost:$HGPORT/ copy-pull |
|
84 | $ hg clone https://localhost:$HGPORT/ copy-pull | |
85 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
85 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
86 | (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) |
|
86 | (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) | |
87 | abort: error: *certificate verify failed* (glob) |
|
87 | abort: error: *certificate verify failed* (glob) | |
88 | [255] |
|
88 | [255] | |
89 | #endif |
|
89 | #endif | |
90 |
|
90 | |||
91 | #if no-defaultcacerts |
|
91 | #if no-defaultcacerts | |
92 | $ hg clone https://localhost:$HGPORT/ copy-pull |
|
92 | $ hg clone https://localhost:$HGPORT/ copy-pull | |
93 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
93 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
94 | (unable to load * certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) |
|
94 | (unable to load * certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) | |
95 | abort: localhost certificate error: no certificate received |
|
95 | abort: localhost certificate error: no certificate received | |
96 | (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) |
|
96 | (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) | |
97 | [255] |
|
97 | [255] | |
98 | #endif |
|
98 | #endif | |
99 |
|
99 | |||
100 | Specifying a per-host certificate file that doesn't exist will abort |
|
100 | Specifying a per-host certificate file that doesn't exist will abort | |
101 |
|
101 | |||
102 | $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/ |
|
102 | $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/ | |
103 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
103 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
104 | abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: /does/not/exist |
|
104 | abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: /does/not/exist | |
105 | [255] |
|
105 | [255] | |
106 |
|
106 | |||
107 | A malformed per-host certificate file will raise an error |
|
107 | A malformed per-host certificate file will raise an error | |
108 |
|
108 | |||
109 | $ echo baddata > badca.pem |
|
109 | $ echo baddata > badca.pem | |
110 | #if sslcontext |
|
110 | #if sslcontext | |
111 | $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/ |
|
111 | $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/ | |
112 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
112 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
113 | abort: error loading CA file badca.pem: * (glob) |
|
113 | abort: error loading CA file badca.pem: * (glob) | |
114 | (file is empty or malformed?) |
|
114 | (file is empty or malformed?) | |
115 | [255] |
|
115 | [255] | |
116 | #else |
|
116 | #else | |
117 | $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/ |
|
117 | $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/ | |
118 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
118 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
119 | abort: error: * (glob) |
|
119 | abort: error: * (glob) | |
120 | [255] |
|
120 | [255] | |
121 | #endif |
|
121 | #endif | |
122 |
|
122 | |||
123 | A per-host certificate mismatching the server will fail verification |
|
123 | A per-host certificate mismatching the server will fail verification | |
124 |
|
124 | |||
125 | (modern ssl is able to discern whether the loaded cert is a CA cert) |
|
125 | (modern ssl is able to discern whether the loaded cert is a CA cert) | |
126 | #if sslcontext |
|
126 | #if sslcontext | |
127 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/ |
|
127 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/ | |
128 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
128 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
129 | (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) |
|
129 | (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) | |
130 | abort: error: *certificate verify failed* (glob) |
|
130 | abort: error: *certificate verify failed* (glob) | |
131 | [255] |
|
131 | [255] | |
132 | #else |
|
132 | #else | |
133 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/ |
|
133 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/ | |
134 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
134 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
135 | abort: error: *certificate verify failed* (glob) |
|
135 | abort: error: *certificate verify failed* (glob) | |
136 | [255] |
|
136 | [255] | |
137 | #endif |
|
137 | #endif | |
138 |
|
138 | |||
139 | A per-host certificate matching the server's cert will be accepted |
|
139 | A per-host certificate matching the server's cert will be accepted | |
140 |
|
140 | |||
141 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1 |
|
141 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1 | |
142 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
142 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
143 | requesting all changes |
|
143 | requesting all changes | |
144 | adding changesets |
|
144 | adding changesets | |
145 | adding manifests |
|
145 | adding manifests | |
146 | adding file changes |
|
146 | adding file changes | |
147 | added 1 changesets with 4 changes to 4 files |
|
147 | added 1 changesets with 4 changes to 4 files | |
148 |
|
148 | |||
149 | A per-host certificate with multiple certs and one matching will be accepted |
|
149 | A per-host certificate with multiple certs and one matching will be accepted | |
150 |
|
150 | |||
151 | $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem |
|
151 | $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem | |
152 | $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2 |
|
152 | $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2 | |
153 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
153 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
154 | requesting all changes |
|
154 | requesting all changes | |
155 | adding changesets |
|
155 | adding changesets | |
156 | adding manifests |
|
156 | adding manifests | |
157 | adding file changes |
|
157 | adding file changes | |
158 | added 1 changesets with 4 changes to 4 files |
|
158 | added 1 changesets with 4 changes to 4 files | |
159 |
|
159 | |||
160 | Defining both per-host certificate and a fingerprint will print a warning |
|
160 | Defining both per-host certificate and a fingerprint will print a warning | |
161 |
|
161 | |||
162 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning |
|
162 | $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning | |
163 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
163 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
164 | (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification) |
|
164 | (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification) | |
165 | requesting all changes |
|
165 | requesting all changes | |
166 | adding changesets |
|
166 | adding changesets | |
167 | adding manifests |
|
167 | adding manifests | |
168 | adding file changes |
|
168 | adding file changes | |
169 | added 1 changesets with 4 changes to 4 files |
|
169 | added 1 changesets with 4 changes to 4 files | |
170 |
|
170 | |||
171 | $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true" |
|
171 | $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true" | |
172 |
|
172 | |||
173 | Inability to verify peer certificate will result in abort |
|
173 | Inability to verify peer certificate will result in abort | |
174 |
|
174 | |||
175 | $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS |
|
175 | $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS | |
176 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
176 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
177 | abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect |
|
177 | abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect | |
178 | (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) |
|
178 | (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) | |
179 | [255] |
|
179 | [255] | |
180 |
|
180 | |||
181 | $ hg clone --insecure https://localhost:$HGPORT/ copy-pull |
|
181 | $ hg clone --insecure https://localhost:$HGPORT/ copy-pull | |
182 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
182 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
183 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
183 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
184 | requesting all changes |
|
184 | requesting all changes | |
185 | adding changesets |
|
185 | adding changesets | |
186 | adding manifests |
|
186 | adding manifests | |
187 | adding file changes |
|
187 | adding file changes | |
188 | added 1 changesets with 4 changes to 4 files |
|
188 | added 1 changesets with 4 changes to 4 files | |
189 | updating to branch default |
|
189 | updating to branch default | |
190 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
190 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
191 | $ hg verify -R copy-pull |
|
191 | $ hg verify -R copy-pull | |
192 | checking changesets |
|
192 | checking changesets | |
193 | checking manifests |
|
193 | checking manifests | |
194 | crosschecking files in changesets and manifests |
|
194 | crosschecking files in changesets and manifests | |
195 | checking files |
|
195 | checking files | |
196 | 4 files, 1 changesets, 4 total revisions |
|
196 | 4 files, 1 changesets, 4 total revisions | |
197 | $ cd test |
|
197 | $ cd test | |
198 | $ echo bar > bar |
|
198 | $ echo bar > bar | |
199 | $ hg commit -A -d '1 0' -m 2 |
|
199 | $ hg commit -A -d '1 0' -m 2 | |
200 | adding bar |
|
200 | adding bar | |
201 | $ cd .. |
|
201 | $ cd .. | |
202 |
|
202 | |||
203 | pull without cacert |
|
203 | pull without cacert | |
204 |
|
204 | |||
205 | $ cd copy-pull |
|
205 | $ cd copy-pull | |
206 | $ cat >> .hg/hgrc <<EOF |
|
206 | $ cat >> .hg/hgrc <<EOF | |
207 | > [hooks] |
|
207 | > [hooks] | |
208 | > changegroup = sh -c "printenv.py changegroup" |
|
208 | > changegroup = sh -c "printenv.py changegroup" | |
209 | > EOF |
|
209 | > EOF | |
210 | $ hg pull $DISABLECACERTS |
|
210 | $ hg pull $DISABLECACERTS | |
211 | pulling from https://localhost:$HGPORT/ |
|
211 | pulling from https://localhost:$HGPORT/ | |
212 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
212 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
213 | abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect |
|
213 | abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect | |
214 | (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) |
|
214 | (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) | |
215 | [255] |
|
215 | [255] | |
216 |
|
216 | |||
217 | $ hg pull --insecure |
|
217 | $ hg pull --insecure | |
218 | pulling from https://localhost:$HGPORT/ |
|
218 | pulling from https://localhost:$HGPORT/ | |
219 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
219 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
220 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
220 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
221 | searching for changes |
|
221 | searching for changes | |
222 | adding changesets |
|
222 | adding changesets | |
223 | adding manifests |
|
223 | adding manifests | |
224 | adding file changes |
|
224 | adding file changes | |
225 | added 1 changesets with 1 changes to 1 files |
|
225 | added 1 changesets with 1 changes to 1 files | |
226 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=https://localhost:$HGPORT/ |
|
226 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=https://localhost:$HGPORT/ | |
227 | (run 'hg update' to get a working copy) |
|
227 | (run 'hg update' to get a working copy) | |
228 | $ cd .. |
|
228 | $ cd .. | |
229 |
|
229 | |||
230 | cacert configured in local repo |
|
230 | cacert configured in local repo | |
231 |
|
231 | |||
232 | $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu |
|
232 | $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu | |
233 | $ echo "[web]" >> copy-pull/.hg/hgrc |
|
233 | $ echo "[web]" >> copy-pull/.hg/hgrc | |
234 | $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc |
|
234 | $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc | |
235 | $ hg -R copy-pull pull |
|
235 | $ hg -R copy-pull pull | |
236 | pulling from https://localhost:$HGPORT/ |
|
236 | pulling from https://localhost:$HGPORT/ | |
237 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
237 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
238 | searching for changes |
|
238 | searching for changes | |
239 | no changes found |
|
239 | no changes found | |
240 | $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc |
|
240 | $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc | |
241 |
|
241 | |||
242 | cacert configured globally, also testing expansion of environment |
|
242 | cacert configured globally, also testing expansion of environment | |
243 | variables in the filename |
|
243 | variables in the filename | |
244 |
|
244 | |||
245 | $ echo "[web]" >> $HGRCPATH |
|
245 | $ echo "[web]" >> $HGRCPATH | |
246 | $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH |
|
246 | $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH | |
247 | $ P="$CERTSDIR" hg -R copy-pull pull |
|
247 | $ P="$CERTSDIR" hg -R copy-pull pull | |
248 | pulling from https://localhost:$HGPORT/ |
|
248 | pulling from https://localhost:$HGPORT/ | |
249 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
249 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
250 | searching for changes |
|
250 | searching for changes | |
251 | no changes found |
|
251 | no changes found | |
252 | $ P="$CERTSDIR" hg -R copy-pull pull --insecure |
|
252 | $ P="$CERTSDIR" hg -R copy-pull pull --insecure | |
253 | pulling from https://localhost:$HGPORT/ |
|
253 | pulling from https://localhost:$HGPORT/ | |
254 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
254 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
255 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
255 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
256 | searching for changes |
|
256 | searching for changes | |
257 | no changes found |
|
257 | no changes found | |
258 |
|
258 | |||
259 | empty cacert file |
|
259 | empty cacert file | |
260 |
|
260 | |||
261 | $ touch emptycafile |
|
261 | $ touch emptycafile | |
262 |
|
262 | |||
263 | #if sslcontext |
|
263 | #if sslcontext | |
264 | $ hg --config web.cacerts=emptycafile -R copy-pull pull |
|
264 | $ hg --config web.cacerts=emptycafile -R copy-pull pull | |
265 | pulling from https://localhost:$HGPORT/ |
|
265 | pulling from https://localhost:$HGPORT/ | |
266 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
266 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
267 | abort: error loading CA file emptycafile: * (glob) |
|
267 | abort: error loading CA file emptycafile: * (glob) | |
268 | (file is empty or malformed?) |
|
268 | (file is empty or malformed?) | |
269 | [255] |
|
269 | [255] | |
270 | #else |
|
270 | #else | |
271 | $ hg --config web.cacerts=emptycafile -R copy-pull pull |
|
271 | $ hg --config web.cacerts=emptycafile -R copy-pull pull | |
272 | pulling from https://localhost:$HGPORT/ |
|
272 | pulling from https://localhost:$HGPORT/ | |
273 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
273 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
274 | abort: error: * (glob) |
|
274 | abort: error: * (glob) | |
275 | [255] |
|
275 | [255] | |
276 | #endif |
|
276 | #endif | |
277 |
|
277 | |||
278 | cacert mismatch |
|
278 | cacert mismatch | |
279 |
|
279 | |||
280 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \ |
|
280 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \ | |
281 | > https://$LOCALIP:$HGPORT/ |
|
281 | > https://$LOCALIP:$HGPORT/ | |
282 | pulling from https://*:$HGPORT/ (glob) |
|
282 | pulling from https://*:$HGPORT/ (glob) | |
283 | warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
283 | warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
284 | abort: $LOCALIP certificate error: certificate is for localhost |
|
284 | abort: $LOCALIP certificate error: certificate is for localhost | |
285 | (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) |
|
285 | (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) | |
286 | [255] |
|
286 | [255] | |
287 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \ |
|
287 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \ | |
288 | > https://$LOCALIP:$HGPORT/ --insecure |
|
288 | > https://$LOCALIP:$HGPORT/ --insecure | |
289 | pulling from https://*:$HGPORT/ (glob) |
|
289 | pulling from https://*:$HGPORT/ (glob) | |
290 | warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
290 | warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
291 | warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
291 | warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
292 | searching for changes |
|
292 | searching for changes | |
293 | no changes found |
|
293 | no changes found | |
294 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" |
|
294 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" | |
295 | pulling from https://localhost:$HGPORT/ |
|
295 | pulling from https://localhost:$HGPORT/ | |
296 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
296 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
297 | abort: error: *certificate verify failed* (glob) |
|
297 | abort: error: *certificate verify failed* (glob) | |
298 | [255] |
|
298 | [255] | |
299 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \ |
|
299 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \ | |
300 | > --insecure |
|
300 | > --insecure | |
301 | pulling from https://localhost:$HGPORT/ |
|
301 | pulling from https://localhost:$HGPORT/ | |
302 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
302 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
303 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
303 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
304 | searching for changes |
|
304 | searching for changes | |
305 | no changes found |
|
305 | no changes found | |
306 |
|
306 | |||
307 | Test server cert which isn't valid yet |
|
307 | Test server cert which isn't valid yet | |
308 |
|
308 | |||
309 | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem |
|
309 | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem | |
310 | $ cat hg1.pid >> $DAEMON_PIDS |
|
310 | $ cat hg1.pid >> $DAEMON_PIDS | |
311 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \ |
|
311 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \ | |
312 | > https://localhost:$HGPORT1/ |
|
312 | > https://localhost:$HGPORT1/ | |
313 | pulling from https://localhost:$HGPORT1/ |
|
313 | pulling from https://localhost:$HGPORT1/ | |
314 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
314 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
315 | abort: error: *certificate verify failed* (glob) |
|
315 | abort: error: *certificate verify failed* (glob) | |
316 | [255] |
|
316 | [255] | |
317 |
|
317 | |||
318 | Test server cert which no longer is valid |
|
318 | Test server cert which no longer is valid | |
319 |
|
319 | |||
320 | $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem |
|
320 | $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem | |
321 | $ cat hg2.pid >> $DAEMON_PIDS |
|
321 | $ cat hg2.pid >> $DAEMON_PIDS | |
322 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \ |
|
322 | $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \ | |
323 | > https://localhost:$HGPORT2/ |
|
323 | > https://localhost:$HGPORT2/ | |
324 | pulling from https://localhost:$HGPORT2/ |
|
324 | pulling from https://localhost:$HGPORT2/ | |
325 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
325 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
326 | abort: error: *certificate verify failed* (glob) |
|
326 | abort: error: *certificate verify failed* (glob) | |
327 | [255] |
|
327 | [255] | |
328 |
|
328 | |||
329 | Disabling the TLS 1.0 warning works |
|
329 | Disabling the TLS 1.0 warning works | |
330 | $ hg -R copy-pull id https://localhost:$HGPORT/ \ |
|
330 | $ hg -R copy-pull id https://localhost:$HGPORT/ \ | |
331 | > --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 \ |
|
331 | > --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 \ | |
332 | > --config hostsecurity.disabletls10warning=true |
|
332 | > --config hostsecurity.disabletls10warning=true | |
333 | 5fed3813f7f5 |
|
333 | 5fed3813f7f5 | |
334 |
|
334 | |||
335 | #if no-sslcontext no-py27+ |
|
335 | #if no-sslcontext no-py27+ | |
336 | Setting ciphers doesn't work in Python 2.6 |
|
336 | Setting ciphers doesn't work in Python 2.6 | |
337 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ |
|
337 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ | |
338 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info |
|
338 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info | |
339 | abort: setting ciphers in [hostsecurity] is not supported by this version of Python |
|
339 | abort: setting ciphers in [hostsecurity] is not supported by this version of Python | |
340 | (remove the config option or run Mercurial with a modern Python version (preferred)) |
|
340 | (remove the config option or run Mercurial with a modern Python version (preferred)) | |
341 | [255] |
|
341 | [255] | |
342 | #endif |
|
342 | #endif | |
343 |
|
343 | |||
344 | Setting ciphers works in Python 2.7+ but the error message is different on |
|
344 | Setting ciphers works in Python 2.7+ but the error message is different on | |
345 | legacy ssl. We test legacy once and do more feature checking on modern |
|
345 | legacy ssl. We test legacy once and do more feature checking on modern | |
346 | configs. |
|
346 | configs. | |
347 |
|
347 | |||
348 | #if py27+ no-sslcontext |
|
348 | #if py27+ no-sslcontext | |
349 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ |
|
349 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ | |
350 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info |
|
350 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info | |
351 | abort: *No cipher can be selected. (glob) |
|
351 | abort: *No cipher can be selected. (glob) | |
352 | [255] |
|
352 | [255] | |
353 |
|
353 | |||
354 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ |
|
354 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ | |
355 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info |
|
355 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info | |
356 | 5fed3813f7f5 |
|
356 | 5fed3813f7f5 | |
357 | #endif |
|
357 | #endif | |
358 |
|
358 | |||
359 | #if sslcontext |
|
359 | #if sslcontext | |
360 | Setting ciphers to an invalid value aborts |
|
360 | Setting ciphers to an invalid value aborts | |
361 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ |
|
361 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ | |
362 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
362 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
363 | abort: could not set ciphers: No cipher can be selected. |
|
363 | abort: could not set ciphers: No cipher can be selected. | |
364 | (change cipher string (invalid) in config) |
|
364 | (change cipher string (invalid) in config) | |
365 | [255] |
|
365 | [255] | |
366 |
|
366 | |||
367 | $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ |
|
367 | $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ | |
368 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
368 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
369 | abort: could not set ciphers: No cipher can be selected. |
|
369 | abort: could not set ciphers: No cipher can be selected. | |
370 | (change cipher string (invalid) in config) |
|
370 | (change cipher string (invalid) in config) | |
371 | [255] |
|
371 | [255] | |
372 |
|
372 | |||
373 | Changing the cipher string works |
|
373 | Changing the cipher string works | |
374 |
|
374 | |||
375 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ |
|
375 | $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ | |
376 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
376 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
377 | 5fed3813f7f5 |
|
377 | 5fed3813f7f5 | |
378 | #endif |
|
378 | #endif | |
379 |
|
379 | |||
380 | Fingerprints |
|
380 | Fingerprints | |
381 |
|
381 | |||
382 | - works without cacerts (hostfingerprints) |
|
382 | - works without cacerts (hostfingerprints) | |
383 | $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 |
|
383 | $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 | |
384 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
384 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
385 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) |
|
385 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) | |
386 | 5fed3813f7f5 |
|
386 | 5fed3813f7f5 | |
387 |
|
387 | |||
388 | - works without cacerts (hostsecurity) |
|
388 | - works without cacerts (hostsecurity) | |
389 | $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 |
|
389 | $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 | |
390 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
390 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
391 | 5fed3813f7f5 |
|
391 | 5fed3813f7f5 | |
392 |
|
392 | |||
393 | $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e |
|
393 | $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e | |
394 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
394 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
395 | 5fed3813f7f5 |
|
395 | 5fed3813f7f5 | |
396 |
|
396 | |||
397 | - multiple fingerprints specified and first matches |
|
397 | - multiple fingerprints specified and first matches | |
398 | $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure |
|
398 | $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure | |
399 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
399 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
400 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) |
|
400 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) | |
401 | 5fed3813f7f5 |
|
401 | 5fed3813f7f5 | |
402 |
|
402 | |||
403 | $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ |
|
403 | $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ | |
404 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
404 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
405 | 5fed3813f7f5 |
|
405 | 5fed3813f7f5 | |
406 |
|
406 | |||
407 | - multiple fingerprints specified and last matches |
|
407 | - multiple fingerprints specified and last matches | |
408 | $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure |
|
408 | $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure | |
409 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
409 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
410 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) |
|
410 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) | |
411 | 5fed3813f7f5 |
|
411 | 5fed3813f7f5 | |
412 |
|
412 | |||
413 | $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ |
|
413 | $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ | |
414 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
414 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
415 | 5fed3813f7f5 |
|
415 | 5fed3813f7f5 | |
416 |
|
416 | |||
417 | - multiple fingerprints specified and none match |
|
417 | - multiple fingerprints specified and none match | |
418 |
|
418 | |||
419 | $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure |
|
419 | $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure | |
420 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
420 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
421 | abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 |
|
421 | abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 | |
422 | (check hostfingerprint configuration) |
|
422 | (check hostfingerprint configuration) | |
423 | [255] |
|
423 | [255] | |
424 |
|
424 | |||
425 | $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ |
|
425 | $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ | |
426 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
426 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
427 | abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 |
|
427 | abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 | |
428 | (check hostsecurity configuration) |
|
428 | (check hostsecurity configuration) | |
429 | [255] |
|
429 | [255] | |
430 |
|
430 | |||
431 | - fails when cert doesn't match hostname (port is ignored) |
|
431 | - fails when cert doesn't match hostname (port is ignored) | |
432 | $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 |
|
432 | $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 | |
433 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
433 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
434 | abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84 |
|
434 | abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84 | |
435 | (check hostfingerprint configuration) |
|
435 | (check hostfingerprint configuration) | |
436 | [255] |
|
436 | [255] | |
437 |
|
437 | |||
438 |
|
438 | |||
439 | - ignores that certificate doesn't match hostname |
|
439 | - ignores that certificate doesn't match hostname | |
440 | $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 |
|
440 | $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 | |
441 | warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
441 | warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
442 | (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: $LOCALIP.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) |
|
442 | (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: $LOCALIP.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) | |
443 | 5fed3813f7f5 |
|
443 | 5fed3813f7f5 | |
444 |
|
444 | |||
445 | Ports used by next test. Kill servers. |
|
445 | Ports used by next test. Kill servers. | |
446 |
|
446 | |||
447 | $ killdaemons.py hg0.pid |
|
447 | $ killdaemons.py hg0.pid | |
448 | $ killdaemons.py hg1.pid |
|
448 | $ killdaemons.py hg1.pid | |
449 | $ killdaemons.py hg2.pid |
|
449 | $ killdaemons.py hg2.pid | |
450 |
|
450 | |||
451 | #if sslcontext tls1.2 |
|
451 | #if sslcontext tls1.2 | |
452 | Start servers running supported TLS versions |
|
452 | Start servers running supported TLS versions | |
453 |
|
453 | |||
454 | $ cd test |
|
454 | $ cd test | |
455 | $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \ |
|
455 | $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \ | |
456 | > --config devel.serverexactprotocol=tls1.0 |
|
456 | > --config devel.serverexactprotocol=tls1.0 | |
457 | $ cat ../hg0.pid >> $DAEMON_PIDS |
|
457 | $ cat ../hg0.pid >> $DAEMON_PIDS | |
458 | $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \ |
|
458 | $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \ | |
459 | > --config devel.serverexactprotocol=tls1.1 |
|
459 | > --config devel.serverexactprotocol=tls1.1 | |
460 | $ cat ../hg1.pid >> $DAEMON_PIDS |
|
460 | $ cat ../hg1.pid >> $DAEMON_PIDS | |
461 | $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \ |
|
461 | $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \ | |
462 | > --config devel.serverexactprotocol=tls1.2 |
|
462 | > --config devel.serverexactprotocol=tls1.2 | |
463 | $ cat ../hg2.pid >> $DAEMON_PIDS |
|
463 | $ cat ../hg2.pid >> $DAEMON_PIDS | |
464 | $ cd .. |
|
464 | $ cd .. | |
465 |
|
465 | |||
466 | Clients talking same TLS versions work |
|
466 | Clients talking same TLS versions work | |
467 |
|
467 | |||
468 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 id https://localhost:$HGPORT/ |
|
468 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 id https://localhost:$HGPORT/ | |
469 | 5fed3813f7f5 |
|
469 | 5fed3813f7f5 | |
470 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT1/ |
|
470 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT1/ | |
471 | 5fed3813f7f5 |
|
471 | 5fed3813f7f5 | |
472 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/ |
|
472 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/ | |
473 | 5fed3813f7f5 |
|
473 | 5fed3813f7f5 | |
474 |
|
474 | |||
475 | Clients requiring newer TLS version than what server supports fail |
|
475 | Clients requiring newer TLS version than what server supports fail | |
476 |
|
476 | |||
477 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ |
|
477 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ | |
478 | (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) |
|
478 | (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) | |
479 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) |
|
479 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) | |
480 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) |
|
480 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) | |
481 | abort: error: *unsupported protocol* (glob) |
|
481 | abort: error: *unsupported protocol* (glob) | |
482 | [255] |
|
482 | [255] | |
483 |
|
483 | |||
484 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/ |
|
484 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/ | |
485 | (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) |
|
485 | (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) | |
486 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) |
|
486 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) | |
487 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) |
|
487 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) | |
488 | abort: error: *unsupported protocol* (glob) |
|
488 | abort: error: *unsupported protocol* (glob) | |
489 | [255] |
|
489 | [255] | |
490 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/ |
|
490 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/ | |
491 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) |
|
491 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) | |
492 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) |
|
492 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) | |
493 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) |
|
493 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) | |
494 | abort: error: *unsupported protocol* (glob) |
|
494 | abort: error: *unsupported protocol* (glob) | |
495 | [255] |
|
495 | [255] | |
496 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/ |
|
496 | $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/ | |
497 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) |
|
497 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) | |
498 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) |
|
498 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) | |
499 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) |
|
499 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) | |
500 | abort: error: *unsupported protocol* (glob) |
|
500 | abort: error: *unsupported protocol* (glob) | |
501 | [255] |
|
501 | [255] | |
502 |
|
502 | |||
503 | --insecure will allow TLS 1.0 connections and override configs |
|
503 | --insecure will allow TLS 1.0 connections and override configs | |
504 |
|
504 | |||
505 | $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/ |
|
505 | $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/ | |
506 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
506 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
507 | 5fed3813f7f5 |
|
507 | 5fed3813f7f5 | |
508 |
|
508 | |||
509 | The per-host config option overrides the default |
|
509 | The per-host config option overrides the default | |
510 |
|
510 | |||
511 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ |
|
511 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ | |
512 | > --config hostsecurity.minimumprotocol=tls1.2 \ |
|
512 | > --config hostsecurity.minimumprotocol=tls1.2 \ | |
513 | > --config hostsecurity.localhost:minimumprotocol=tls1.0 |
|
513 | > --config hostsecurity.localhost:minimumprotocol=tls1.0 | |
514 | 5fed3813f7f5 |
|
514 | 5fed3813f7f5 | |
515 |
|
515 | |||
516 | The per-host config option by itself works |
|
516 | The per-host config option by itself works | |
517 |
|
517 | |||
518 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ |
|
518 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ | |
519 | > --config hostsecurity.localhost:minimumprotocol=tls1.2 |
|
519 | > --config hostsecurity.localhost:minimumprotocol=tls1.2 | |
520 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) |
|
520 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) | |
521 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) |
|
521 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) | |
522 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) |
|
522 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) | |
523 | abort: error: *unsupported protocol* (glob) |
|
523 | abort: error: *unsupported protocol* (glob) | |
524 | [255] |
|
524 | [255] | |
525 |
|
525 | |||
526 | .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305) |
|
526 | .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305) | |
527 |
|
527 | |||
528 | $ cat >> copy-pull/.hg/hgrc << EOF |
|
528 | $ cat >> copy-pull/.hg/hgrc << EOF | |
529 | > [hostsecurity] |
|
529 | > [hostsecurity] | |
530 | > localhost:minimumprotocol=tls1.2 |
|
530 | > localhost:minimumprotocol=tls1.2 | |
531 | > EOF |
|
531 | > EOF | |
532 | $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/ |
|
532 | $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/ | |
533 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) |
|
533 | (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) | |
534 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) |
|
534 | (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) | |
535 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) |
|
535 | (see https://mercurial-scm.org/wiki/SecureConnections for more info) | |
536 | abort: error: *unsupported protocol* (glob) |
|
536 | abort: error: *unsupported protocol* (glob) | |
537 | [255] |
|
537 | [255] | |
538 |
|
538 | |||
539 | $ killdaemons.py hg0.pid |
|
539 | $ killdaemons.py hg0.pid | |
540 | $ killdaemons.py hg1.pid |
|
540 | $ killdaemons.py hg1.pid | |
541 | $ killdaemons.py hg2.pid |
|
541 | $ killdaemons.py hg2.pid | |
542 | #endif |
|
542 | #endif | |
543 |
|
543 | |||
544 | Prepare for connecting through proxy |
|
544 | Prepare for connecting through proxy | |
545 |
|
545 | |||
546 | $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV |
|
546 | $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV | |
547 | $ cat hg0.pid >> $DAEMON_PIDS |
|
547 | $ cat hg0.pid >> $DAEMON_PIDS | |
548 | $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem |
|
548 | $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem | |
549 | $ cat hg2.pid >> $DAEMON_PIDS |
|
549 | $ cat hg2.pid >> $DAEMON_PIDS | |
550 | tinyproxy.py doesn't fully detach, so killing it may result in extra output |
|
550 | tinyproxy.py doesn't fully detach, so killing it may result in extra output | |
551 | from the shell. So don't kill it. |
|
551 | from the shell. So don't kill it. | |
552 | $ tinyproxy.py $HGPORT1 localhost >proxy.log </dev/null 2>&1 & |
|
552 | $ tinyproxy.py $HGPORT1 localhost >proxy.log </dev/null 2>&1 & | |
553 | $ while [ ! -f proxy.pid ]; do sleep 0; done |
|
553 | $ while [ ! -f proxy.pid ]; do sleep 0; done | |
554 | $ cat proxy.pid >> $DAEMON_PIDS |
|
554 | $ cat proxy.pid >> $DAEMON_PIDS | |
555 |
|
555 | |||
556 | $ echo "[http_proxy]" >> copy-pull/.hg/hgrc |
|
556 | $ echo "[http_proxy]" >> copy-pull/.hg/hgrc | |
557 | $ echo "always=True" >> copy-pull/.hg/hgrc |
|
557 | $ echo "always=True" >> copy-pull/.hg/hgrc | |
558 | $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc |
|
558 | $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc | |
559 | $ echo "localhost =" >> copy-pull/.hg/hgrc |
|
559 | $ echo "localhost =" >> copy-pull/.hg/hgrc | |
560 |
|
560 | |||
561 | Test unvalidated https through proxy |
|
561 | Test unvalidated https through proxy | |
562 |
|
562 | |||
563 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure |
|
563 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure | |
564 | pulling from https://localhost:$HGPORT/ |
|
564 | pulling from https://localhost:$HGPORT/ | |
565 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
565 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
566 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering |
|
566 | warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering | |
567 | searching for changes |
|
567 | searching for changes | |
568 | no changes found |
|
568 | no changes found | |
569 |
|
569 | |||
570 | Test https with cacert and fingerprint through proxy |
|
570 | Test https with cacert and fingerprint through proxy | |
571 |
|
571 | |||
572 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ |
|
572 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ | |
573 | > --config web.cacerts="$CERTSDIR/pub.pem" |
|
573 | > --config web.cacerts="$CERTSDIR/pub.pem" | |
574 | pulling from https://localhost:$HGPORT/ |
|
574 | pulling from https://localhost:$HGPORT/ | |
575 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
575 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
576 | searching for changes |
|
576 | searching for changes | |
577 | no changes found |
|
577 | no changes found | |
578 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace |
|
578 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace | |
579 | pulling from https://*:$HGPORT/ (glob) |
|
579 | pulling from https://*:$HGPORT/ (glob) | |
580 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
580 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
581 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) |
|
581 | (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, set the following config value in [hostsecurity] and remove the old one from [hostfingerprints] to upgrade to a more secure SHA-256 fingerprint: localhost.fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) | |
582 | searching for changes |
|
582 | searching for changes | |
583 | no changes found |
|
583 | no changes found | |
584 |
|
584 | |||
585 | Test https with cert problems through proxy |
|
585 | Test https with cert problems through proxy | |
586 |
|
586 | |||
587 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ |
|
587 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ | |
588 | > --config web.cacerts="$CERTSDIR/pub-other.pem" |
|
588 | > --config web.cacerts="$CERTSDIR/pub-other.pem" | |
589 | pulling from https://localhost:$HGPORT/ |
|
589 | pulling from https://localhost:$HGPORT/ | |
590 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
590 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
591 | abort: error: *certificate verify failed* (glob) |
|
591 | abort: error: *certificate verify failed* (glob) | |
592 | [255] |
|
592 | [255] | |
593 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ |
|
593 | $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ | |
594 | > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/ |
|
594 | > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/ | |
595 | pulling from https://localhost:$HGPORT2/ |
|
595 | pulling from https://localhost:$HGPORT2/ | |
596 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
596 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
597 | abort: error: *certificate verify failed* (glob) |
|
597 | abort: error: *certificate verify failed* (glob) | |
598 | [255] |
|
598 | [255] | |
599 |
|
599 | |||
600 |
|
600 | |||
601 | $ killdaemons.py hg0.pid |
|
601 | $ killdaemons.py hg0.pid | |
602 |
|
602 | |||
603 | #if sslcontext |
|
603 | #if sslcontext | |
604 |
|
604 | |||
605 | Start hgweb that requires client certificates: |
|
605 | Start hgweb that requires client certificates: | |
606 |
|
606 | |||
607 | $ cd test |
|
607 | $ cd test | |
608 | $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \ |
|
608 | $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \ | |
609 | > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true |
|
609 | > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true | |
610 | $ cat ../hg0.pid >> $DAEMON_PIDS |
|
610 | $ cat ../hg0.pid >> $DAEMON_PIDS | |
611 | $ cd .. |
|
611 | $ cd .. | |
612 |
|
612 | |||
613 | without client certificate: |
|
613 | without client certificate: | |
614 |
|
614 | |||
615 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ |
|
615 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ | |
616 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
616 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
617 | abort: error: *handshake failure* (glob) |
|
617 | abort: error: *handshake failure* (glob) | |
618 | [255] |
|
618 | [255] | |
619 |
|
619 | |||
620 | with client certificate: |
|
620 | with client certificate: | |
621 |
|
621 | |||
622 | $ cat << EOT >> $HGRCPATH |
|
622 | $ cat << EOT >> $HGRCPATH | |
623 | > [auth] |
|
623 | > [auth] | |
624 | > l.prefix = localhost |
|
624 | > l.prefix = localhost | |
625 | > l.cert = $CERTSDIR/client-cert.pem |
|
625 | > l.cert = $CERTSDIR/client-cert.pem | |
626 | > l.key = $CERTSDIR/client-key.pem |
|
626 | > l.key = $CERTSDIR/client-key.pem | |
627 | > EOT |
|
627 | > EOT | |
628 |
|
628 | |||
629 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ |
|
629 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ | |
630 | > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem" |
|
630 | > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem" | |
631 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
631 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
632 | 5fed3813f7f5 |
|
632 | 5fed3813f7f5 | |
633 |
|
633 | |||
634 | $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ |
|
634 | $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ | |
635 | > --config ui.interactive=True --config ui.nontty=True |
|
635 | > --config ui.interactive=True --config ui.nontty=True | |
636 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
636 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
637 | passphrase for */client-key.pem: 5fed3813f7f5 (glob) |
|
637 | passphrase for */client-key.pem: 5fed3813f7f5 (glob) | |
638 |
|
638 | |||
639 | $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/ |
|
639 | $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/ | |
640 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
640 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
641 | abort: error: * (glob) |
|
641 | abort: error: * (glob) | |
642 | [255] |
|
642 | [255] | |
643 |
|
643 | |||
644 | #endif |
|
644 | #endif |
@@ -1,203 +1,203 | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | This test checks behavior related to bundle1 that changed or is likely |
|
3 | This test checks behavior related to bundle1 that changed or is likely | |
4 | to change with bundle2. Feel free to factor out any part of the test |
|
4 | to change with bundle2. Feel free to factor out any part of the test | |
5 | which does not need to exist to keep bundle1 working. |
|
5 | which does not need to exist to keep bundle1 working. | |
6 |
|
6 | |||
7 | $ cat << EOF >> $HGRCPATH |
|
7 | $ cat << EOF >> $HGRCPATH | |
8 | > [devel] |
|
8 | > [devel] | |
9 | > # This test is dedicated to interaction through old bundle |
|
9 | > # This test is dedicated to interaction through old bundle | |
10 | > legacy.exchange = bundle1 |
|
10 | > legacy.exchange = bundle1 | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ hg init test |
|
13 | $ hg init test | |
14 | $ cd test |
|
14 | $ cd test | |
15 | $ echo a > a |
|
15 | $ echo a > a | |
16 | $ hg ci -Ama |
|
16 | $ hg ci -Ama | |
17 | adding a |
|
17 | adding a | |
18 | $ cd .. |
|
18 | $ cd .. | |
19 | $ hg clone test test2 |
|
19 | $ hg clone test test2 | |
20 | updating to branch default |
|
20 | updating to branch default | |
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | $ cd test2 |
|
22 | $ cd test2 | |
23 | $ echo a >> a |
|
23 | $ echo a >> a | |
24 | $ hg ci -mb |
|
24 | $ hg ci -mb | |
25 | $ req() { |
|
25 | $ req() { | |
26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
27 | > cat hg.pid >> $DAEMON_PIDS |
|
27 | > cat hg.pid >> $DAEMON_PIDS | |
28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
29 | > exitstatus=$? |
|
29 | > exitstatus=$? | |
30 | > killdaemons.py |
|
30 | > killdaemons.py | |
31 | > echo % serve errors |
|
31 | > echo % serve errors | |
32 | > cat errors.log |
|
32 | > cat errors.log | |
33 | > return $exitstatus |
|
33 | > return $exitstatus | |
34 | > } |
|
34 | > } | |
35 | $ cd ../test |
|
35 | $ cd ../test | |
36 |
|
36 | |||
37 | expect ssl error |
|
37 | expect ssl error | |
38 |
|
38 | |||
39 | $ req |
|
39 | $ req | |
40 | pushing to http://localhost:$HGPORT/ |
|
40 | pushing to http://localhost:$HGPORT/ | |
41 | searching for changes |
|
41 | searching for changes | |
42 | abort: HTTP Error 403: ssl required |
|
42 | abort: HTTP Error 403: ssl required | |
43 | % serve errors |
|
43 | % serve errors | |
44 | [255] |
|
44 | [255] | |
45 |
|
45 | |||
46 | expect authorization error |
|
46 | expect authorization error | |
47 |
|
47 | |||
48 | $ echo '[web]' > .hg/hgrc |
|
48 | $ echo '[web]' > .hg/hgrc | |
49 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
49 | $ echo 'push_ssl = false' >> .hg/hgrc | |
50 | $ req |
|
50 | $ req | |
51 | pushing to http://localhost:$HGPORT/ |
|
51 | pushing to http://localhost:$HGPORT/ | |
52 | searching for changes |
|
52 | searching for changes | |
53 | abort: authorization failed |
|
53 | abort: authorization failed | |
54 | % serve errors |
|
54 | % serve errors | |
55 | [255] |
|
55 | [255] | |
56 |
|
56 | |||
57 | expect authorization error: must have authorized user |
|
57 | expect authorization error: must have authorized user | |
58 |
|
58 | |||
59 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
59 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
60 | $ req |
|
60 | $ req | |
61 | pushing to http://localhost:$HGPORT/ |
|
61 | pushing to http://localhost:$HGPORT/ | |
62 | searching for changes |
|
62 | searching for changes | |
63 | abort: authorization failed |
|
63 | abort: authorization failed | |
64 | % serve errors |
|
64 | % serve errors | |
65 | [255] |
|
65 | [255] | |
66 |
|
66 | |||
67 | expect success |
|
67 | expect success | |
68 |
|
68 | |||
69 | $ cat >> .hg/hgrc <<EOF |
|
69 | $ cat >> .hg/hgrc <<EOF | |
70 | > allow_push = * |
|
70 | > allow_push = * | |
71 | > [hooks] |
|
71 | > [hooks] | |
72 | > changegroup = sh -c "printenv.py changegroup 0" |
|
72 | > changegroup = sh -c "printenv.py changegroup 0" | |
73 | > pushkey = sh -c "printenv.py pushkey 0" |
|
73 | > pushkey = sh -c "printenv.py pushkey 0" | |
74 | > EOF |
|
74 | > EOF | |
75 | $ req |
|
75 | $ req | |
76 | pushing to http://localhost:$HGPORT/ |
|
76 | pushing to http://localhost:$HGPORT/ | |
77 | searching for changes |
|
77 | searching for changes | |
78 | remote: adding changesets |
|
78 | remote: adding changesets | |
79 | remote: adding manifests |
|
79 | remote: adding manifests | |
80 | remote: adding file changes |
|
80 | remote: adding file changes | |
81 | remote: added 1 changesets with 1 changes to 1 files |
|
81 | remote: added 1 changesets with 1 changes to 1 files | |
82 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
82 | remote: changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
83 | % serve errors |
|
83 | % serve errors | |
84 | $ hg rollback |
|
84 | $ hg rollback | |
85 | repository tip rolled back to revision 0 (undo serve) |
|
85 | repository tip rolled back to revision 0 (undo serve) | |
86 |
|
86 | |||
87 | expect success, server lacks the httpheader capability |
|
87 | expect success, server lacks the httpheader capability | |
88 |
|
88 | |||
89 | $ CAP=httpheader |
|
89 | $ CAP=httpheader | |
90 | $ . "$TESTDIR/notcapable" |
|
90 | $ . "$TESTDIR/notcapable" | |
91 | $ req |
|
91 | $ req | |
92 | pushing to http://localhost:$HGPORT/ |
|
92 | pushing to http://localhost:$HGPORT/ | |
93 | searching for changes |
|
93 | searching for changes | |
94 | remote: adding changesets |
|
94 | remote: adding changesets | |
95 | remote: adding manifests |
|
95 | remote: adding manifests | |
96 | remote: adding file changes |
|
96 | remote: adding file changes | |
97 | remote: added 1 changesets with 1 changes to 1 files |
|
97 | remote: added 1 changesets with 1 changes to 1 files | |
98 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
98 | remote: changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
99 | % serve errors |
|
99 | % serve errors | |
100 | $ hg rollback |
|
100 | $ hg rollback | |
101 | repository tip rolled back to revision 0 (undo serve) |
|
101 | repository tip rolled back to revision 0 (undo serve) | |
102 |
|
102 | |||
103 | expect success, server lacks the unbundlehash capability |
|
103 | expect success, server lacks the unbundlehash capability | |
104 |
|
104 | |||
105 | $ CAP=unbundlehash |
|
105 | $ CAP=unbundlehash | |
106 | $ . "$TESTDIR/notcapable" |
|
106 | $ . "$TESTDIR/notcapable" | |
107 | $ req |
|
107 | $ req | |
108 | pushing to http://localhost:$HGPORT/ |
|
108 | pushing to http://localhost:$HGPORT/ | |
109 | searching for changes |
|
109 | searching for changes | |
110 | remote: adding changesets |
|
110 | remote: adding changesets | |
111 | remote: adding manifests |
|
111 | remote: adding manifests | |
112 | remote: adding file changes |
|
112 | remote: adding file changes | |
113 | remote: added 1 changesets with 1 changes to 1 files |
|
113 | remote: added 1 changesets with 1 changes to 1 files | |
114 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
114 | remote: changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
115 | % serve errors |
|
115 | % serve errors | |
116 | $ hg rollback |
|
116 | $ hg rollback | |
117 | repository tip rolled back to revision 0 (undo serve) |
|
117 | repository tip rolled back to revision 0 (undo serve) | |
118 |
|
118 | |||
119 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
119 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but | |
120 | has no parameter |
|
120 | has no parameter | |
121 |
|
121 | |||
122 | $ cat <<EOF > notcapable-unbundleparam.py |
|
122 | $ cat <<EOF > notcapable-unbundleparam.py | |
123 | > from mercurial import extensions, httppeer |
|
123 | > from mercurial import extensions, httppeer | |
124 | > def capable(orig, self, name): |
|
124 | > def capable(orig, self, name): | |
125 | > if name == 'unbundle': |
|
125 | > if name == 'unbundle': | |
126 | > return True |
|
126 | > return True | |
127 | > return orig(self, name) |
|
127 | > return orig(self, name) | |
128 | > def uisetup(ui): |
|
128 | > def uisetup(ui): | |
129 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
129 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) | |
130 | > EOF |
|
130 | > EOF | |
131 | $ cp $HGRCPATH $HGRCPATH.orig |
|
131 | $ cp $HGRCPATH $HGRCPATH.orig | |
132 | $ cat <<EOF >> $HGRCPATH |
|
132 | $ cat <<EOF >> $HGRCPATH | |
133 | > [extensions] |
|
133 | > [extensions] | |
134 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
134 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py | |
135 | > EOF |
|
135 | > EOF | |
136 | $ req |
|
136 | $ req | |
137 | pushing to http://localhost:$HGPORT/ |
|
137 | pushing to http://localhost:$HGPORT/ | |
138 | searching for changes |
|
138 | searching for changes | |
139 | remote: adding changesets |
|
139 | remote: adding changesets | |
140 | remote: adding manifests |
|
140 | remote: adding manifests | |
141 | remote: adding file changes |
|
141 | remote: adding file changes | |
142 | remote: added 1 changesets with 1 changes to 1 files |
|
142 | remote: added 1 changesets with 1 changes to 1 files | |
143 | remote: changegroup hook: * (glob) |
|
143 | remote: changegroup hook: * (glob) | |
144 | % serve errors |
|
144 | % serve errors | |
145 | $ hg rollback |
|
145 | $ hg rollback | |
146 | repository tip rolled back to revision 0 (undo serve) |
|
146 | repository tip rolled back to revision 0 (undo serve) | |
147 | $ mv $HGRCPATH.orig $HGRCPATH |
|
147 | $ mv $HGRCPATH.orig $HGRCPATH | |
148 |
|
148 | |||
149 | expect push success, phase change failure |
|
149 | expect push success, phase change failure | |
150 |
|
150 | |||
151 | $ cat > .hg/hgrc <<EOF |
|
151 | $ cat > .hg/hgrc <<EOF | |
152 | > [web] |
|
152 | > [web] | |
153 | > push_ssl = false |
|
153 | > push_ssl = false | |
154 | > allow_push = * |
|
154 | > allow_push = * | |
155 | > [hooks] |
|
155 | > [hooks] | |
156 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
156 | > prepushkey = sh -c "printenv.py prepushkey 1" | |
157 | > EOF |
|
157 | > EOF | |
158 | $ req |
|
158 | $ req | |
159 | pushing to http://localhost:$HGPORT/ |
|
159 | pushing to http://localhost:$HGPORT/ | |
160 | searching for changes |
|
160 | searching for changes | |
161 | remote: adding changesets |
|
161 | remote: adding changesets | |
162 | remote: adding manifests |
|
162 | remote: adding manifests | |
163 | remote: adding file changes |
|
163 | remote: adding file changes | |
164 | remote: added 1 changesets with 1 changes to 1 files |
|
164 | remote: added 1 changesets with 1 changes to 1 files | |
165 | % serve errors |
|
165 | % serve errors | |
166 |
|
166 | |||
167 | expect phase change success |
|
167 | expect phase change success | |
168 |
|
168 | |||
169 | $ cat >> .hg/hgrc <<EOF |
|
169 | $ cat >> .hg/hgrc <<EOF | |
170 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
170 | > prepushkey = sh -c "printenv.py prepushkey 0" | |
171 | > EOF |
|
171 | > EOF | |
172 | $ req |
|
172 | $ req | |
173 | pushing to http://localhost:$HGPORT/ |
|
173 | pushing to http://localhost:$HGPORT/ | |
174 | searching for changes |
|
174 | searching for changes | |
175 | no changes found |
|
175 | no changes found | |
176 | % serve errors |
|
176 | % serve errors | |
177 | [1] |
|
177 | [1] | |
178 | $ hg rollback |
|
178 | $ hg rollback | |
179 | repository tip rolled back to revision 0 (undo serve) |
|
179 | repository tip rolled back to revision 0 (undo serve) | |
180 |
|
180 | |||
181 | expect authorization error: all users denied |
|
181 | expect authorization error: all users denied | |
182 |
|
182 | |||
183 | $ echo '[web]' > .hg/hgrc |
|
183 | $ echo '[web]' > .hg/hgrc | |
184 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
184 | $ echo 'push_ssl = false' >> .hg/hgrc | |
185 | $ echo 'deny_push = *' >> .hg/hgrc |
|
185 | $ echo 'deny_push = *' >> .hg/hgrc | |
186 | $ req |
|
186 | $ req | |
187 | pushing to http://localhost:$HGPORT/ |
|
187 | pushing to http://localhost:$HGPORT/ | |
188 | searching for changes |
|
188 | searching for changes | |
189 | abort: authorization failed |
|
189 | abort: authorization failed | |
190 | % serve errors |
|
190 | % serve errors | |
191 | [255] |
|
191 | [255] | |
192 |
|
192 | |||
193 | expect authorization error: some users denied, users must be authenticated |
|
193 | expect authorization error: some users denied, users must be authenticated | |
194 |
|
194 | |||
195 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
195 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
196 | $ req |
|
196 | $ req | |
197 | pushing to http://localhost:$HGPORT/ |
|
197 | pushing to http://localhost:$HGPORT/ | |
198 | searching for changes |
|
198 | searching for changes | |
199 | abort: authorization failed |
|
199 | abort: authorization failed | |
200 | % serve errors |
|
200 | % serve errors | |
201 | [255] |
|
201 | [255] | |
202 |
|
202 | |||
203 | $ cd .. |
|
203 | $ cd .. |
@@ -1,175 +1,175 | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg ci -Ama |
|
6 | $ hg ci -Ama | |
7 | adding a |
|
7 | adding a | |
8 | $ cd .. |
|
8 | $ cd .. | |
9 | $ hg clone test test2 |
|
9 | $ hg clone test test2 | |
10 | updating to branch default |
|
10 | updating to branch default | |
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | $ cd test2 |
|
12 | $ cd test2 | |
13 | $ echo a >> a |
|
13 | $ echo a >> a | |
14 | $ hg ci -mb |
|
14 | $ hg ci -mb | |
15 | $ req() { |
|
15 | $ req() { | |
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
17 | > cat hg.pid >> $DAEMON_PIDS |
|
17 | > cat hg.pid >> $DAEMON_PIDS | |
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
19 | > exitstatus=$? |
|
19 | > exitstatus=$? | |
20 | > killdaemons.py |
|
20 | > killdaemons.py | |
21 | > echo % serve errors |
|
21 | > echo % serve errors | |
22 | > cat errors.log |
|
22 | > cat errors.log | |
23 | > return $exitstatus |
|
23 | > return $exitstatus | |
24 | > } |
|
24 | > } | |
25 | $ cd ../test |
|
25 | $ cd ../test | |
26 |
|
26 | |||
27 | expect ssl error |
|
27 | expect ssl error | |
28 |
|
28 | |||
29 | $ req |
|
29 | $ req | |
30 | pushing to http://localhost:$HGPORT/ |
|
30 | pushing to http://localhost:$HGPORT/ | |
31 | searching for changes |
|
31 | searching for changes | |
32 | abort: HTTP Error 403: ssl required |
|
32 | abort: HTTP Error 403: ssl required | |
33 | % serve errors |
|
33 | % serve errors | |
34 | [255] |
|
34 | [255] | |
35 |
|
35 | |||
36 | expect authorization error |
|
36 | expect authorization error | |
37 |
|
37 | |||
38 | $ echo '[web]' > .hg/hgrc |
|
38 | $ echo '[web]' > .hg/hgrc | |
39 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
39 | $ echo 'push_ssl = false' >> .hg/hgrc | |
40 | $ req |
|
40 | $ req | |
41 | pushing to http://localhost:$HGPORT/ |
|
41 | pushing to http://localhost:$HGPORT/ | |
42 | searching for changes |
|
42 | searching for changes | |
43 | abort: authorization failed |
|
43 | abort: authorization failed | |
44 | % serve errors |
|
44 | % serve errors | |
45 | [255] |
|
45 | [255] | |
46 |
|
46 | |||
47 | expect authorization error: must have authorized user |
|
47 | expect authorization error: must have authorized user | |
48 |
|
48 | |||
49 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
49 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
50 | $ req |
|
50 | $ req | |
51 | pushing to http://localhost:$HGPORT/ |
|
51 | pushing to http://localhost:$HGPORT/ | |
52 | searching for changes |
|
52 | searching for changes | |
53 | abort: authorization failed |
|
53 | abort: authorization failed | |
54 | % serve errors |
|
54 | % serve errors | |
55 | [255] |
|
55 | [255] | |
56 |
|
56 | |||
57 | expect success |
|
57 | expect success | |
58 |
|
58 | |||
59 | $ cat >> .hg/hgrc <<EOF |
|
59 | $ cat >> .hg/hgrc <<EOF | |
60 | > allow_push = * |
|
60 | > allow_push = * | |
61 | > [hooks] |
|
61 | > [hooks] | |
62 | > changegroup = sh -c "printenv.py changegroup 0" |
|
62 | > changegroup = sh -c "printenv.py changegroup 0" | |
63 | > pushkey = sh -c "printenv.py pushkey 0" |
|
63 | > pushkey = sh -c "printenv.py pushkey 0" | |
64 | > EOF |
|
64 | > EOF | |
65 | $ req |
|
65 | $ req | |
66 | pushing to http://localhost:$HGPORT/ |
|
66 | pushing to http://localhost:$HGPORT/ | |
67 | searching for changes |
|
67 | searching for changes | |
68 | remote: adding changesets |
|
68 | remote: adding changesets | |
69 | remote: adding manifests |
|
69 | remote: adding manifests | |
70 | remote: adding file changes |
|
70 | remote: adding file changes | |
71 | remote: added 1 changesets with 1 changes to 1 files |
|
71 | remote: added 1 changesets with 1 changes to 1 files | |
72 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 |
|
72 | remote: pushkey hook: HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
73 | remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
73 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
74 | % serve errors |
|
74 | % serve errors | |
75 | $ hg rollback |
|
75 | $ hg rollback | |
76 | repository tip rolled back to revision 0 (undo serve) |
|
76 | repository tip rolled back to revision 0 (undo serve) | |
77 |
|
77 | |||
78 | expect success, server lacks the httpheader capability |
|
78 | expect success, server lacks the httpheader capability | |
79 |
|
79 | |||
80 | $ CAP=httpheader |
|
80 | $ CAP=httpheader | |
81 | $ . "$TESTDIR/notcapable" |
|
81 | $ . "$TESTDIR/notcapable" | |
82 | $ req |
|
82 | $ req | |
83 | pushing to http://localhost:$HGPORT/ |
|
83 | pushing to http://localhost:$HGPORT/ | |
84 | searching for changes |
|
84 | searching for changes | |
85 | remote: adding changesets |
|
85 | remote: adding changesets | |
86 | remote: adding manifests |
|
86 | remote: adding manifests | |
87 | remote: adding file changes |
|
87 | remote: adding file changes | |
88 | remote: added 1 changesets with 1 changes to 1 files |
|
88 | remote: added 1 changesets with 1 changes to 1 files | |
89 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 |
|
89 | remote: pushkey hook: HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
90 | remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
90 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
91 | % serve errors |
|
91 | % serve errors | |
92 | $ hg rollback |
|
92 | $ hg rollback | |
93 | repository tip rolled back to revision 0 (undo serve) |
|
93 | repository tip rolled back to revision 0 (undo serve) | |
94 |
|
94 | |||
95 | expect success, server lacks the unbundlehash capability |
|
95 | expect success, server lacks the unbundlehash capability | |
96 |
|
96 | |||
97 | $ CAP=unbundlehash |
|
97 | $ CAP=unbundlehash | |
98 | $ . "$TESTDIR/notcapable" |
|
98 | $ . "$TESTDIR/notcapable" | |
99 | $ req |
|
99 | $ req | |
100 | pushing to http://localhost:$HGPORT/ |
|
100 | pushing to http://localhost:$HGPORT/ | |
101 | searching for changes |
|
101 | searching for changes | |
102 | remote: adding changesets |
|
102 | remote: adding changesets | |
103 | remote: adding manifests |
|
103 | remote: adding manifests | |
104 | remote: adding file changes |
|
104 | remote: adding file changes | |
105 | remote: added 1 changesets with 1 changes to 1 files |
|
105 | remote: added 1 changesets with 1 changes to 1 files | |
106 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 |
|
106 | remote: pushkey hook: HG_HOOKTYPE=pushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
107 | remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
107 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
108 | % serve errors |
|
108 | % serve errors | |
109 | $ hg rollback |
|
109 | $ hg rollback | |
110 | repository tip rolled back to revision 0 (undo serve) |
|
110 | repository tip rolled back to revision 0 (undo serve) | |
111 |
|
111 | |||
112 | expect push success, phase change failure |
|
112 | expect push success, phase change failure | |
113 |
|
113 | |||
114 | $ cat > .hg/hgrc <<EOF |
|
114 | $ cat > .hg/hgrc <<EOF | |
115 | > [web] |
|
115 | > [web] | |
116 | > push_ssl = false |
|
116 | > push_ssl = false | |
117 | > allow_push = * |
|
117 | > allow_push = * | |
118 | > [hooks] |
|
118 | > [hooks] | |
119 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
119 | > prepushkey = sh -c "printenv.py prepushkey 1" | |
120 | > EOF |
|
120 | > EOF | |
121 | $ req |
|
121 | $ req | |
122 | pushing to http://localhost:$HGPORT/ |
|
122 | pushing to http://localhost:$HGPORT/ | |
123 | searching for changes |
|
123 | searching for changes | |
124 | remote: adding changesets |
|
124 | remote: adding changesets | |
125 | remote: adding manifests |
|
125 | remote: adding manifests | |
126 | remote: adding file changes |
|
126 | remote: adding file changes | |
127 | remote: added 1 changesets with 1 changes to 1 files |
|
127 | remote: added 1 changesets with 1 changes to 1 files | |
128 | remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
128 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
129 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
129 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
130 | remote: transaction abort! |
|
130 | remote: transaction abort! | |
131 | remote: rollback completed |
|
131 | remote: rollback completed | |
132 | abort: updating ba677d0156c1 to public failed |
|
132 | abort: updating ba677d0156c1 to public failed | |
133 | % serve errors |
|
133 | % serve errors | |
134 | [255] |
|
134 | [255] | |
135 |
|
135 | |||
136 | expect phase change success |
|
136 | expect phase change success | |
137 |
|
137 | |||
138 | $ cat >> .hg/hgrc <<EOF |
|
138 | $ cat >> .hg/hgrc <<EOF | |
139 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
139 | > prepushkey = sh -c "printenv.py prepushkey 0" | |
140 | > EOF |
|
140 | > EOF | |
141 | $ req |
|
141 | $ req | |
142 | pushing to http://localhost:$HGPORT/ |
|
142 | pushing to http://localhost:$HGPORT/ | |
143 | searching for changes |
|
143 | searching for changes | |
144 | remote: adding changesets |
|
144 | remote: adding changesets | |
145 | remote: adding manifests |
|
145 | remote: adding manifests | |
146 | remote: adding file changes |
|
146 | remote: adding file changes | |
147 | remote: added 1 changesets with 1 changes to 1 files |
|
147 | remote: added 1 changesets with 1 changes to 1 files | |
148 | remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: |
|
148 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: | |
149 | % serve errors |
|
149 | % serve errors | |
150 | $ hg rollback |
|
150 | $ hg rollback | |
151 | repository tip rolled back to revision 0 (undo serve) |
|
151 | repository tip rolled back to revision 0 (undo serve) | |
152 |
|
152 | |||
153 | expect authorization error: all users denied |
|
153 | expect authorization error: all users denied | |
154 |
|
154 | |||
155 | $ echo '[web]' > .hg/hgrc |
|
155 | $ echo '[web]' > .hg/hgrc | |
156 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
156 | $ echo 'push_ssl = false' >> .hg/hgrc | |
157 | $ echo 'deny_push = *' >> .hg/hgrc |
|
157 | $ echo 'deny_push = *' >> .hg/hgrc | |
158 | $ req |
|
158 | $ req | |
159 | pushing to http://localhost:$HGPORT/ |
|
159 | pushing to http://localhost:$HGPORT/ | |
160 | searching for changes |
|
160 | searching for changes | |
161 | abort: authorization failed |
|
161 | abort: authorization failed | |
162 | % serve errors |
|
162 | % serve errors | |
163 | [255] |
|
163 | [255] | |
164 |
|
164 | |||
165 | expect authorization error: some users denied, users must be authenticated |
|
165 | expect authorization error: some users denied, users must be authenticated | |
166 |
|
166 | |||
167 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
167 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
168 | $ req |
|
168 | $ req | |
169 | pushing to http://localhost:$HGPORT/ |
|
169 | pushing to http://localhost:$HGPORT/ | |
170 | searching for changes |
|
170 | searching for changes | |
171 | abort: authorization failed |
|
171 | abort: authorization failed | |
172 | % serve errors |
|
172 | % serve errors | |
173 | [255] |
|
173 | [255] | |
174 |
|
174 | |||
175 | $ cd .. |
|
175 | $ cd .. |
@@ -1,562 +1,562 | |||||
1 | This test is a duplicate of 'test-http.t' feel free to factor out |
|
1 | This test is a duplicate of 'test-http.t' feel free to factor out | |
2 | parts that are not bundle1/bundle2 specific. |
|
2 | parts that are not bundle1/bundle2 specific. | |
3 |
|
3 | |||
4 | $ cat << EOF >> $HGRCPATH |
|
4 | $ cat << EOF >> $HGRCPATH | |
5 | > [devel] |
|
5 | > [devel] | |
6 | > # This test is dedicated to interaction through old bundle |
|
6 | > # This test is dedicated to interaction through old bundle | |
7 | > legacy.exchange = bundle1 |
|
7 | > legacy.exchange = bundle1 | |
8 | > [format] # temporary settings |
|
8 | > [format] # temporary settings | |
9 | > usegeneraldelta=yes |
|
9 | > usegeneraldelta=yes | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | This test tries to exercise the ssh functionality with a dummy script |
|
13 | This test tries to exercise the ssh functionality with a dummy script | |
14 |
|
14 | |||
15 | creating 'remote' repo |
|
15 | creating 'remote' repo | |
16 |
|
16 | |||
17 | $ hg init remote |
|
17 | $ hg init remote | |
18 | $ cd remote |
|
18 | $ cd remote | |
19 | $ echo this > foo |
|
19 | $ echo this > foo | |
20 | $ echo this > fooO |
|
20 | $ echo this > fooO | |
21 | $ hg ci -A -m "init" foo fooO |
|
21 | $ hg ci -A -m "init" foo fooO | |
22 |
|
22 | |||
23 | insert a closed branch (issue4428) |
|
23 | insert a closed branch (issue4428) | |
24 |
|
24 | |||
25 | $ hg up null |
|
25 | $ hg up null | |
26 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
26 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
27 | $ hg branch closed |
|
27 | $ hg branch closed | |
28 | marked working directory as branch closed |
|
28 | marked working directory as branch closed | |
29 | (branches are permanent and global, did you want a bookmark?) |
|
29 | (branches are permanent and global, did you want a bookmark?) | |
30 | $ hg ci -mc0 |
|
30 | $ hg ci -mc0 | |
31 | $ hg ci --close-branch -mc1 |
|
31 | $ hg ci --close-branch -mc1 | |
32 | $ hg up -q default |
|
32 | $ hg up -q default | |
33 |
|
33 | |||
34 | configure for serving |
|
34 | configure for serving | |
35 |
|
35 | |||
36 | $ cat <<EOF > .hg/hgrc |
|
36 | $ cat <<EOF > .hg/hgrc | |
37 | > [server] |
|
37 | > [server] | |
38 | > uncompressed = True |
|
38 | > uncompressed = True | |
39 | > |
|
39 | > | |
40 | > [hooks] |
|
40 | > [hooks] | |
41 | > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog" |
|
41 | > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog" | |
42 | > EOF |
|
42 | > EOF | |
43 | $ cd .. |
|
43 | $ cd .. | |
44 |
|
44 | |||
45 | repo not found error |
|
45 | repo not found error | |
46 |
|
46 | |||
47 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local |
|
47 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local | |
48 | remote: abort: repository nonexistent not found! |
|
48 | remote: abort: repository nonexistent not found! | |
49 | abort: no suitable response from remote hg! |
|
49 | abort: no suitable response from remote hg! | |
50 | [255] |
|
50 | [255] | |
51 |
|
51 | |||
52 | non-existent absolute path |
|
52 | non-existent absolute path | |
53 |
|
53 | |||
54 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local |
|
54 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local | |
55 | remote: abort: repository /$TESTTMP/nonexistent not found! |
|
55 | remote: abort: repository /$TESTTMP/nonexistent not found! | |
56 | abort: no suitable response from remote hg! |
|
56 | abort: no suitable response from remote hg! | |
57 | [255] |
|
57 | [255] | |
58 |
|
58 | |||
59 | clone remote via stream |
|
59 | clone remote via stream | |
60 |
|
60 | |||
61 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream |
|
61 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream | |
62 | streaming all changes |
|
62 | streaming all changes | |
63 | 4 files to transfer, 602 bytes of data |
|
63 | 4 files to transfer, 602 bytes of data | |
64 | transferred 602 bytes in * seconds (*) (glob) |
|
64 | transferred 602 bytes in * seconds (*) (glob) | |
65 | searching for changes |
|
65 | searching for changes | |
66 | no changes found |
|
66 | no changes found | |
67 | updating to branch default |
|
67 | updating to branch default | |
68 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
69 | $ cd local-stream |
|
69 | $ cd local-stream | |
70 | $ hg verify |
|
70 | $ hg verify | |
71 | checking changesets |
|
71 | checking changesets | |
72 | checking manifests |
|
72 | checking manifests | |
73 | crosschecking files in changesets and manifests |
|
73 | crosschecking files in changesets and manifests | |
74 | checking files |
|
74 | checking files | |
75 | 2 files, 3 changesets, 2 total revisions |
|
75 | 2 files, 3 changesets, 2 total revisions | |
76 | $ hg branches |
|
76 | $ hg branches | |
77 | default 0:1160648e36ce |
|
77 | default 0:1160648e36ce | |
78 | $ cd .. |
|
78 | $ cd .. | |
79 |
|
79 | |||
80 | clone bookmarks via stream |
|
80 | clone bookmarks via stream | |
81 |
|
81 | |||
82 | $ hg -R local-stream book mybook |
|
82 | $ hg -R local-stream book mybook | |
83 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2 |
|
83 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2 | |
84 | streaming all changes |
|
84 | streaming all changes | |
85 | 4 files to transfer, 602 bytes of data |
|
85 | 4 files to transfer, 602 bytes of data | |
86 | transferred 602 bytes in * seconds (*) (glob) |
|
86 | transferred 602 bytes in * seconds (*) (glob) | |
87 | searching for changes |
|
87 | searching for changes | |
88 | no changes found |
|
88 | no changes found | |
89 | updating to branch default |
|
89 | updating to branch default | |
90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
91 | $ cd stream2 |
|
91 | $ cd stream2 | |
92 | $ hg book |
|
92 | $ hg book | |
93 | mybook 0:1160648e36ce |
|
93 | mybook 0:1160648e36ce | |
94 | $ cd .. |
|
94 | $ cd .. | |
95 | $ rm -rf local-stream stream2 |
|
95 | $ rm -rf local-stream stream2 | |
96 |
|
96 | |||
97 | clone remote via pull |
|
97 | clone remote via pull | |
98 |
|
98 | |||
99 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local |
|
99 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local | |
100 | requesting all changes |
|
100 | requesting all changes | |
101 | adding changesets |
|
101 | adding changesets | |
102 | adding manifests |
|
102 | adding manifests | |
103 | adding file changes |
|
103 | adding file changes | |
104 | added 3 changesets with 2 changes to 2 files |
|
104 | added 3 changesets with 2 changes to 2 files | |
105 | updating to branch default |
|
105 | updating to branch default | |
106 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
106 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 |
|
107 | |||
108 | verify |
|
108 | verify | |
109 |
|
109 | |||
110 | $ cd local |
|
110 | $ cd local | |
111 | $ hg verify |
|
111 | $ hg verify | |
112 | checking changesets |
|
112 | checking changesets | |
113 | checking manifests |
|
113 | checking manifests | |
114 | crosschecking files in changesets and manifests |
|
114 | crosschecking files in changesets and manifests | |
115 | checking files |
|
115 | checking files | |
116 | 2 files, 3 changesets, 2 total revisions |
|
116 | 2 files, 3 changesets, 2 total revisions | |
117 | $ cat >> .hg/hgrc <<EOF |
|
117 | $ cat >> .hg/hgrc <<EOF | |
118 | > [hooks] |
|
118 | > [hooks] | |
119 | > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog" |
|
119 | > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog" | |
120 | > EOF |
|
120 | > EOF | |
121 |
|
121 | |||
122 | empty default pull |
|
122 | empty default pull | |
123 |
|
123 | |||
124 | $ hg paths |
|
124 | $ hg paths | |
125 | default = ssh://user@dummy/remote |
|
125 | default = ssh://user@dummy/remote | |
126 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" |
|
126 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" | |
127 | pulling from ssh://user@dummy/remote |
|
127 | pulling from ssh://user@dummy/remote | |
128 | searching for changes |
|
128 | searching for changes | |
129 | no changes found |
|
129 | no changes found | |
130 |
|
130 | |||
131 | pull from wrong ssh URL |
|
131 | pull from wrong ssh URL | |
132 |
|
132 | |||
133 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist |
|
133 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist | |
134 | pulling from ssh://user@dummy/doesnotexist |
|
134 | pulling from ssh://user@dummy/doesnotexist | |
135 | remote: abort: repository doesnotexist not found! |
|
135 | remote: abort: repository doesnotexist not found! | |
136 | abort: no suitable response from remote hg! |
|
136 | abort: no suitable response from remote hg! | |
137 | [255] |
|
137 | [255] | |
138 |
|
138 | |||
139 | local change |
|
139 | local change | |
140 |
|
140 | |||
141 | $ echo bleah > foo |
|
141 | $ echo bleah > foo | |
142 | $ hg ci -m "add" |
|
142 | $ hg ci -m "add" | |
143 |
|
143 | |||
144 | updating rc |
|
144 | updating rc | |
145 |
|
145 | |||
146 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
146 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
147 | $ echo "[ui]" >> .hg/hgrc |
|
147 | $ echo "[ui]" >> .hg/hgrc | |
148 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc |
|
148 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc | |
149 |
|
149 | |||
150 | find outgoing |
|
150 | find outgoing | |
151 |
|
151 | |||
152 | $ hg out ssh://user@dummy/remote |
|
152 | $ hg out ssh://user@dummy/remote | |
153 | comparing with ssh://user@dummy/remote |
|
153 | comparing with ssh://user@dummy/remote | |
154 | searching for changes |
|
154 | searching for changes | |
155 | changeset: 3:a28a9d1a809c |
|
155 | changeset: 3:a28a9d1a809c | |
156 | tag: tip |
|
156 | tag: tip | |
157 | parent: 0:1160648e36ce |
|
157 | parent: 0:1160648e36ce | |
158 | user: test |
|
158 | user: test | |
159 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
159 | date: Thu Jan 01 00:00:00 1970 +0000 | |
160 | summary: add |
|
160 | summary: add | |
161 |
|
161 | |||
162 |
|
162 | |||
163 | find incoming on the remote side |
|
163 | find incoming on the remote side | |
164 |
|
164 | |||
165 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local |
|
165 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local | |
166 | comparing with ssh://user@dummy/local |
|
166 | comparing with ssh://user@dummy/local | |
167 | searching for changes |
|
167 | searching for changes | |
168 | changeset: 3:a28a9d1a809c |
|
168 | changeset: 3:a28a9d1a809c | |
169 | tag: tip |
|
169 | tag: tip | |
170 | parent: 0:1160648e36ce |
|
170 | parent: 0:1160648e36ce | |
171 | user: test |
|
171 | user: test | |
172 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
172 | date: Thu Jan 01 00:00:00 1970 +0000 | |
173 | summary: add |
|
173 | summary: add | |
174 |
|
174 | |||
175 |
|
175 | |||
176 | find incoming on the remote side (using absolute path) |
|
176 | find incoming on the remote side (using absolute path) | |
177 |
|
177 | |||
178 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" |
|
178 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" | |
179 | comparing with ssh://user@dummy/$TESTTMP/local |
|
179 | comparing with ssh://user@dummy/$TESTTMP/local | |
180 | searching for changes |
|
180 | searching for changes | |
181 | changeset: 3:a28a9d1a809c |
|
181 | changeset: 3:a28a9d1a809c | |
182 | tag: tip |
|
182 | tag: tip | |
183 | parent: 0:1160648e36ce |
|
183 | parent: 0:1160648e36ce | |
184 | user: test |
|
184 | user: test | |
185 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
185 | date: Thu Jan 01 00:00:00 1970 +0000 | |
186 | summary: add |
|
186 | summary: add | |
187 |
|
187 | |||
188 |
|
188 | |||
189 | push |
|
189 | push | |
190 |
|
190 | |||
191 | $ hg push |
|
191 | $ hg push | |
192 | pushing to ssh://user@dummy/remote |
|
192 | pushing to ssh://user@dummy/remote | |
193 | searching for changes |
|
193 | searching for changes | |
194 | remote: adding changesets |
|
194 | remote: adding changesets | |
195 | remote: adding manifests |
|
195 | remote: adding manifests | |
196 | remote: adding file changes |
|
196 | remote: adding file changes | |
197 | remote: added 1 changesets with 1 changes to 1 files |
|
197 | remote: added 1 changesets with 1 changes to 1 files | |
198 | $ cd ../remote |
|
198 | $ cd ../remote | |
199 |
|
199 | |||
200 | check remote tip |
|
200 | check remote tip | |
201 |
|
201 | |||
202 | $ hg tip |
|
202 | $ hg tip | |
203 | changeset: 3:a28a9d1a809c |
|
203 | changeset: 3:a28a9d1a809c | |
204 | tag: tip |
|
204 | tag: tip | |
205 | parent: 0:1160648e36ce |
|
205 | parent: 0:1160648e36ce | |
206 | user: test |
|
206 | user: test | |
207 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
207 | date: Thu Jan 01 00:00:00 1970 +0000 | |
208 | summary: add |
|
208 | summary: add | |
209 |
|
209 | |||
210 | $ hg verify |
|
210 | $ hg verify | |
211 | checking changesets |
|
211 | checking changesets | |
212 | checking manifests |
|
212 | checking manifests | |
213 | crosschecking files in changesets and manifests |
|
213 | crosschecking files in changesets and manifests | |
214 | checking files |
|
214 | checking files | |
215 | 2 files, 4 changesets, 3 total revisions |
|
215 | 2 files, 4 changesets, 3 total revisions | |
216 | $ hg cat -r tip foo |
|
216 | $ hg cat -r tip foo | |
217 | bleah |
|
217 | bleah | |
218 | $ echo z > z |
|
218 | $ echo z > z | |
219 | $ hg ci -A -m z z |
|
219 | $ hg ci -A -m z z | |
220 | created new head |
|
220 | created new head | |
221 |
|
221 | |||
222 | test pushkeys and bookmarks |
|
222 | test pushkeys and bookmarks | |
223 |
|
223 | |||
224 | $ cd ../local |
|
224 | $ cd ../local | |
225 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces |
|
225 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces | |
226 | bookmarks |
|
226 | bookmarks | |
227 | namespaces |
|
227 | namespaces | |
228 | phases |
|
228 | phases | |
229 | $ hg book foo -r 0 |
|
229 | $ hg book foo -r 0 | |
230 | $ hg out -B |
|
230 | $ hg out -B | |
231 | comparing with ssh://user@dummy/remote |
|
231 | comparing with ssh://user@dummy/remote | |
232 | searching for changed bookmarks |
|
232 | searching for changed bookmarks | |
233 | foo 1160648e36ce |
|
233 | foo 1160648e36ce | |
234 | $ hg push -B foo |
|
234 | $ hg push -B foo | |
235 | pushing to ssh://user@dummy/remote |
|
235 | pushing to ssh://user@dummy/remote | |
236 | searching for changes |
|
236 | searching for changes | |
237 | no changes found |
|
237 | no changes found | |
238 | exporting bookmark foo |
|
238 | exporting bookmark foo | |
239 | [1] |
|
239 | [1] | |
240 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks |
|
240 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks | |
241 | foo 1160648e36cec0054048a7edc4110c6f84fde594 |
|
241 | foo 1160648e36cec0054048a7edc4110c6f84fde594 | |
242 | $ hg book -f foo |
|
242 | $ hg book -f foo | |
243 | $ hg push --traceback |
|
243 | $ hg push --traceback | |
244 | pushing to ssh://user@dummy/remote |
|
244 | pushing to ssh://user@dummy/remote | |
245 | searching for changes |
|
245 | searching for changes | |
246 | no changes found |
|
246 | no changes found | |
247 | updating bookmark foo |
|
247 | updating bookmark foo | |
248 | [1] |
|
248 | [1] | |
249 | $ hg book -d foo |
|
249 | $ hg book -d foo | |
250 | $ hg in -B |
|
250 | $ hg in -B | |
251 | comparing with ssh://user@dummy/remote |
|
251 | comparing with ssh://user@dummy/remote | |
252 | searching for changed bookmarks |
|
252 | searching for changed bookmarks | |
253 | foo a28a9d1a809c |
|
253 | foo a28a9d1a809c | |
254 | $ hg book -f -r 0 foo |
|
254 | $ hg book -f -r 0 foo | |
255 | $ hg pull -B foo |
|
255 | $ hg pull -B foo | |
256 | pulling from ssh://user@dummy/remote |
|
256 | pulling from ssh://user@dummy/remote | |
257 | no changes found |
|
257 | no changes found | |
258 | updating bookmark foo |
|
258 | updating bookmark foo | |
259 | $ hg book -d foo |
|
259 | $ hg book -d foo | |
260 | $ hg push -B foo |
|
260 | $ hg push -B foo | |
261 | pushing to ssh://user@dummy/remote |
|
261 | pushing to ssh://user@dummy/remote | |
262 | searching for changes |
|
262 | searching for changes | |
263 | no changes found |
|
263 | no changes found | |
264 | deleting remote bookmark foo |
|
264 | deleting remote bookmark foo | |
265 | [1] |
|
265 | [1] | |
266 |
|
266 | |||
267 | a bad, evil hook that prints to stdout |
|
267 | a bad, evil hook that prints to stdout | |
268 |
|
268 | |||
269 | $ cat <<EOF > $TESTTMP/badhook |
|
269 | $ cat <<EOF > $TESTTMP/badhook | |
270 | > import sys |
|
270 | > import sys | |
271 | > sys.stdout.write("KABOOM\n") |
|
271 | > sys.stdout.write("KABOOM\n") | |
272 | > EOF |
|
272 | > EOF | |
273 |
|
273 | |||
274 | $ echo '[hooks]' >> ../remote/.hg/hgrc |
|
274 | $ echo '[hooks]' >> ../remote/.hg/hgrc | |
275 | $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc |
|
275 | $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc | |
276 | $ echo r > r |
|
276 | $ echo r > r | |
277 | $ hg ci -A -m z r |
|
277 | $ hg ci -A -m z r | |
278 |
|
278 | |||
279 | push should succeed even though it has an unexpected response |
|
279 | push should succeed even though it has an unexpected response | |
280 |
|
280 | |||
281 | $ hg push |
|
281 | $ hg push | |
282 | pushing to ssh://user@dummy/remote |
|
282 | pushing to ssh://user@dummy/remote | |
283 | searching for changes |
|
283 | searching for changes | |
284 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 |
|
284 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 | |
285 | remote: adding changesets |
|
285 | remote: adding changesets | |
286 | remote: adding manifests |
|
286 | remote: adding manifests | |
287 | remote: adding file changes |
|
287 | remote: adding file changes | |
288 | remote: added 1 changesets with 1 changes to 1 files |
|
288 | remote: added 1 changesets with 1 changes to 1 files | |
289 | remote: KABOOM |
|
289 | remote: KABOOM | |
290 | $ hg -R ../remote heads |
|
290 | $ hg -R ../remote heads | |
291 | changeset: 5:1383141674ec |
|
291 | changeset: 5:1383141674ec | |
292 | tag: tip |
|
292 | tag: tip | |
293 | parent: 3:a28a9d1a809c |
|
293 | parent: 3:a28a9d1a809c | |
294 | user: test |
|
294 | user: test | |
295 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
295 | date: Thu Jan 01 00:00:00 1970 +0000 | |
296 | summary: z |
|
296 | summary: z | |
297 |
|
297 | |||
298 | changeset: 4:6c0482d977a3 |
|
298 | changeset: 4:6c0482d977a3 | |
299 | parent: 0:1160648e36ce |
|
299 | parent: 0:1160648e36ce | |
300 | user: test |
|
300 | user: test | |
301 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
301 | date: Thu Jan 01 00:00:00 1970 +0000 | |
302 | summary: z |
|
302 | summary: z | |
303 |
|
303 | |||
304 |
|
304 | |||
305 | clone bookmarks |
|
305 | clone bookmarks | |
306 |
|
306 | |||
307 | $ hg -R ../remote bookmark test |
|
307 | $ hg -R ../remote bookmark test | |
308 | $ hg -R ../remote bookmarks |
|
308 | $ hg -R ../remote bookmarks | |
309 | * test 4:6c0482d977a3 |
|
309 | * test 4:6c0482d977a3 | |
310 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks |
|
310 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks | |
311 | requesting all changes |
|
311 | requesting all changes | |
312 | adding changesets |
|
312 | adding changesets | |
313 | adding manifests |
|
313 | adding manifests | |
314 | adding file changes |
|
314 | adding file changes | |
315 | added 6 changesets with 5 changes to 4 files (+1 heads) |
|
315 | added 6 changesets with 5 changes to 4 files (+1 heads) | |
316 | updating to branch default |
|
316 | updating to branch default | |
317 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
317 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
318 | $ hg -R local-bookmarks bookmarks |
|
318 | $ hg -R local-bookmarks bookmarks | |
319 | test 4:6c0482d977a3 |
|
319 | test 4:6c0482d977a3 | |
320 |
|
320 | |||
321 | passwords in ssh urls are not supported |
|
321 | passwords in ssh urls are not supported | |
322 | (we use a glob here because different Python versions give different |
|
322 | (we use a glob here because different Python versions give different | |
323 | results here) |
|
323 | results here) | |
324 |
|
324 | |||
325 | $ hg push ssh://user:erroneouspwd@dummy/remote |
|
325 | $ hg push ssh://user:erroneouspwd@dummy/remote | |
326 | pushing to ssh://user:*@dummy/remote (glob) |
|
326 | pushing to ssh://user:*@dummy/remote (glob) | |
327 | abort: password in URL not supported! |
|
327 | abort: password in URL not supported! | |
328 | [255] |
|
328 | [255] | |
329 |
|
329 | |||
330 | $ cd .. |
|
330 | $ cd .. | |
331 |
|
331 | |||
332 | hide outer repo |
|
332 | hide outer repo | |
333 | $ hg init |
|
333 | $ hg init | |
334 |
|
334 | |||
335 | Test remote paths with spaces (issue2983): |
|
335 | Test remote paths with spaces (issue2983): | |
336 |
|
336 | |||
337 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
337 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
338 | $ touch "$TESTTMP/a repo/test" |
|
338 | $ touch "$TESTTMP/a repo/test" | |
339 | $ hg -R 'a repo' commit -A -m "test" |
|
339 | $ hg -R 'a repo' commit -A -m "test" | |
340 | adding test |
|
340 | adding test | |
341 | $ hg -R 'a repo' tag tag |
|
341 | $ hg -R 'a repo' tag tag | |
342 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
342 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
343 | 73649e48688a |
|
343 | 73649e48688a | |
344 |
|
344 | |||
345 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" |
|
345 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" | |
346 | abort: unknown revision 'noNoNO'! |
|
346 | abort: unknown revision 'noNoNO'! | |
347 | [255] |
|
347 | [255] | |
348 |
|
348 | |||
349 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): |
|
349 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): | |
350 |
|
350 | |||
351 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
351 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
352 | destination directory: a repo |
|
352 | destination directory: a repo | |
353 | abort: destination 'a repo' is not empty |
|
353 | abort: destination 'a repo' is not empty | |
354 | [255] |
|
354 | [255] | |
355 |
|
355 | |||
356 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might |
|
356 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might | |
357 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right |
|
357 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right | |
358 | parameters: |
|
358 | parameters: | |
359 |
|
359 | |||
360 | $ cat > ssh.sh << EOF |
|
360 | $ cat > ssh.sh << EOF | |
361 | > userhost="\$1" |
|
361 | > userhost="\$1" | |
362 | > SSH_ORIGINAL_COMMAND="\$2" |
|
362 | > SSH_ORIGINAL_COMMAND="\$2" | |
363 | > export SSH_ORIGINAL_COMMAND |
|
363 | > export SSH_ORIGINAL_COMMAND | |
364 | > PYTHONPATH="$PYTHONPATH" |
|
364 | > PYTHONPATH="$PYTHONPATH" | |
365 | > export PYTHONPATH |
|
365 | > export PYTHONPATH | |
366 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" |
|
366 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" | |
367 | > EOF |
|
367 | > EOF | |
368 |
|
368 | |||
369 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" |
|
369 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" | |
370 | 73649e48688a |
|
370 | 73649e48688a | |
371 |
|
371 | |||
372 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" |
|
372 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" | |
373 | remote: Illegal repository "$TESTTMP/a'repo" (glob) |
|
373 | remote: Illegal repository "$TESTTMP/a'repo" (glob) | |
374 | abort: no suitable response from remote hg! |
|
374 | abort: no suitable response from remote hg! | |
375 | [255] |
|
375 | [255] | |
376 |
|
376 | |||
377 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" |
|
377 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" | |
378 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" |
|
378 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" | |
379 | abort: no suitable response from remote hg! |
|
379 | abort: no suitable response from remote hg! | |
380 | [255] |
|
380 | [255] | |
381 |
|
381 | |||
382 | $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" python "$TESTDIR/../contrib/hg-ssh" |
|
382 | $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" python "$TESTDIR/../contrib/hg-ssh" | |
383 | Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation |
|
383 | Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation | |
384 | [255] |
|
384 | [255] | |
385 |
|
385 | |||
386 | Test hg-ssh in read-only mode: |
|
386 | Test hg-ssh in read-only mode: | |
387 |
|
387 | |||
388 | $ cat > ssh.sh << EOF |
|
388 | $ cat > ssh.sh << EOF | |
389 | > userhost="\$1" |
|
389 | > userhost="\$1" | |
390 | > SSH_ORIGINAL_COMMAND="\$2" |
|
390 | > SSH_ORIGINAL_COMMAND="\$2" | |
391 | > export SSH_ORIGINAL_COMMAND |
|
391 | > export SSH_ORIGINAL_COMMAND | |
392 | > PYTHONPATH="$PYTHONPATH" |
|
392 | > PYTHONPATH="$PYTHONPATH" | |
393 | > export PYTHONPATH |
|
393 | > export PYTHONPATH | |
394 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" |
|
394 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" | |
395 | > EOF |
|
395 | > EOF | |
396 |
|
396 | |||
397 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local |
|
397 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local | |
398 | requesting all changes |
|
398 | requesting all changes | |
399 | adding changesets |
|
399 | adding changesets | |
400 | adding manifests |
|
400 | adding manifests | |
401 | adding file changes |
|
401 | adding file changes | |
402 | added 6 changesets with 5 changes to 4 files (+1 heads) |
|
402 | added 6 changesets with 5 changes to 4 files (+1 heads) | |
403 | updating to branch default |
|
403 | updating to branch default | |
404 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
404 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
405 |
|
405 | |||
406 | $ cd read-only-local |
|
406 | $ cd read-only-local | |
407 | $ echo "baz" > bar |
|
407 | $ echo "baz" > bar | |
408 | $ hg ci -A -m "unpushable commit" bar |
|
408 | $ hg ci -A -m "unpushable commit" bar | |
409 | $ hg push --ssh "sh ../ssh.sh" |
|
409 | $ hg push --ssh "sh ../ssh.sh" | |
410 | pushing to ssh://user@dummy/*/remote (glob) |
|
410 | pushing to ssh://user@dummy/*/remote (glob) | |
411 | searching for changes |
|
411 | searching for changes | |
412 | remote: Permission denied |
|
412 | remote: Permission denied | |
413 | remote: abort: pretxnopen.hg-ssh hook failed |
|
413 | remote: abort: pretxnopen.hg-ssh hook failed | |
414 | remote: Permission denied |
|
414 | remote: Permission denied | |
415 | remote: pushkey-abort: prepushkey.hg-ssh hook failed |
|
415 | remote: pushkey-abort: prepushkey.hg-ssh hook failed | |
416 | updating 6c0482d977a3 to public failed! |
|
416 | updating 6c0482d977a3 to public failed! | |
417 | [1] |
|
417 | [1] | |
418 |
|
418 | |||
419 | $ cd .. |
|
419 | $ cd .. | |
420 |
|
420 | |||
421 | stderr from remote commands should be printed before stdout from local code (issue4336) |
|
421 | stderr from remote commands should be printed before stdout from local code (issue4336) | |
422 |
|
422 | |||
423 | $ hg clone remote stderr-ordering |
|
423 | $ hg clone remote stderr-ordering | |
424 | updating to branch default |
|
424 | updating to branch default | |
425 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
425 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
426 | $ cd stderr-ordering |
|
426 | $ cd stderr-ordering | |
427 | $ cat >> localwrite.py << EOF |
|
427 | $ cat >> localwrite.py << EOF | |
428 | > from mercurial import exchange, extensions |
|
428 | > from mercurial import exchange, extensions | |
429 | > |
|
429 | > | |
430 | > def wrappedpush(orig, repo, *args, **kwargs): |
|
430 | > def wrappedpush(orig, repo, *args, **kwargs): | |
431 | > res = orig(repo, *args, **kwargs) |
|
431 | > res = orig(repo, *args, **kwargs) | |
432 | > repo.ui.write('local stdout\n') |
|
432 | > repo.ui.write('local stdout\n') | |
433 | > return res |
|
433 | > return res | |
434 | > |
|
434 | > | |
435 | > def extsetup(ui): |
|
435 | > def extsetup(ui): | |
436 | > extensions.wrapfunction(exchange, 'push', wrappedpush) |
|
436 | > extensions.wrapfunction(exchange, 'push', wrappedpush) | |
437 | > EOF |
|
437 | > EOF | |
438 |
|
438 | |||
439 | $ cat >> .hg/hgrc << EOF |
|
439 | $ cat >> .hg/hgrc << EOF | |
440 | > [paths] |
|
440 | > [paths] | |
441 | > default-push = ssh://user@dummy/remote |
|
441 | > default-push = ssh://user@dummy/remote | |
442 | > [ui] |
|
442 | > [ui] | |
443 | > ssh = python "$TESTDIR/dummyssh" |
|
443 | > ssh = python "$TESTDIR/dummyssh" | |
444 | > [extensions] |
|
444 | > [extensions] | |
445 | > localwrite = localwrite.py |
|
445 | > localwrite = localwrite.py | |
446 | > EOF |
|
446 | > EOF | |
447 |
|
447 | |||
448 | $ echo localwrite > foo |
|
448 | $ echo localwrite > foo | |
449 | $ hg commit -m 'testing localwrite' |
|
449 | $ hg commit -m 'testing localwrite' | |
450 | $ hg push |
|
450 | $ hg push | |
451 | pushing to ssh://user@dummy/remote |
|
451 | pushing to ssh://user@dummy/remote | |
452 | searching for changes |
|
452 | searching for changes | |
453 | remote: adding changesets |
|
453 | remote: adding changesets | |
454 | remote: adding manifests |
|
454 | remote: adding manifests | |
455 | remote: adding file changes |
|
455 | remote: adding file changes | |
456 | remote: added 1 changesets with 1 changes to 1 files |
|
456 | remote: added 1 changesets with 1 changes to 1 files | |
457 | remote: KABOOM |
|
457 | remote: KABOOM | |
458 | local stdout |
|
458 | local stdout | |
459 |
|
459 | |||
460 | debug output |
|
460 | debug output | |
461 |
|
461 | |||
462 | $ hg pull --debug ssh://user@dummy/remote |
|
462 | $ hg pull --debug ssh://user@dummy/remote | |
463 | pulling from ssh://user@dummy/remote |
|
463 | pulling from ssh://user@dummy/remote | |
464 | running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) |
|
464 | running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) | |
465 | sending hello command |
|
465 | sending hello command | |
466 | sending between command |
|
466 | sending between command | |
467 | remote: 355 |
|
467 | remote: 355 | |
468 | remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN |
|
468 | remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN | |
469 | remote: 1 |
|
469 | remote: 1 | |
470 | preparing listkeys for "bookmarks" |
|
470 | preparing listkeys for "bookmarks" | |
471 | sending listkeys command |
|
471 | sending listkeys command | |
472 | received listkey for "bookmarks": 45 bytes |
|
472 | received listkey for "bookmarks": 45 bytes | |
473 | query 1; heads |
|
473 | query 1; heads | |
474 | sending batch command |
|
474 | sending batch command | |
475 | searching for changes |
|
475 | searching for changes | |
476 | all remote heads known locally |
|
476 | all remote heads known locally | |
477 | no changes found |
|
477 | no changes found | |
478 | preparing listkeys for "phases" |
|
478 | preparing listkeys for "phases" | |
479 | sending listkeys command |
|
479 | sending listkeys command | |
480 | received listkey for "phases": 15 bytes |
|
480 | received listkey for "phases": 15 bytes | |
481 | checking for updated bookmarks |
|
481 | checking for updated bookmarks | |
482 |
|
482 | |||
483 | $ cd .. |
|
483 | $ cd .. | |
484 |
|
484 | |||
485 | $ cat dummylog |
|
485 | $ cat dummylog | |
486 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
486 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio | |
487 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio |
|
487 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio | |
488 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
488 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
489 | Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio |
|
489 | Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio | |
490 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
490 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
491 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
491 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
492 | Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio |
|
492 | Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio | |
493 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
493 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
494 | Got arguments 1:user@dummy 2:hg -R local serve --stdio |
|
494 | Got arguments 1:user@dummy 2:hg -R local serve --stdio | |
495 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio |
|
495 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio | |
496 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
496 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
497 | changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP |
|
497 | changegroup-in-remote hook: HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP | |
498 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
498 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
499 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
499 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
500 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
500 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
501 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
501 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
502 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
502 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
503 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
503 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
504 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
504 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
505 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
505 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
506 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
506 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
507 | changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP |
|
507 | changegroup-in-remote hook: HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP | |
508 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
508 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
509 | Got arguments 1:user@dummy 2:hg init 'a repo' |
|
509 | Got arguments 1:user@dummy 2:hg init 'a repo' | |
510 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
510 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
511 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
511 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
512 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
512 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
513 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
513 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
514 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
514 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
515 | changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP |
|
515 | changegroup-in-remote hook: HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP | |
516 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
516 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
517 |
|
517 | |||
518 | remote hook failure is attributed to remote |
|
518 | remote hook failure is attributed to remote | |
519 |
|
519 | |||
520 | $ cat > $TESTTMP/failhook << EOF |
|
520 | $ cat > $TESTTMP/failhook << EOF | |
521 | > def hook(ui, repo, **kwargs): |
|
521 | > def hook(ui, repo, **kwargs): | |
522 | > ui.write('hook failure!\n') |
|
522 | > ui.write('hook failure!\n') | |
523 | > ui.flush() |
|
523 | > ui.flush() | |
524 | > return 1 |
|
524 | > return 1 | |
525 | > EOF |
|
525 | > EOF | |
526 |
|
526 | |||
527 | $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc |
|
527 | $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc | |
528 |
|
528 | |||
529 | $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout |
|
529 | $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout | |
530 | $ cd hookout |
|
530 | $ cd hookout | |
531 | $ touch hookfailure |
|
531 | $ touch hookfailure | |
532 | $ hg -q commit -A -m 'remote hook failure' |
|
532 | $ hg -q commit -A -m 'remote hook failure' | |
533 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" push |
|
533 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" push | |
534 | pushing to ssh://user@dummy/remote |
|
534 | pushing to ssh://user@dummy/remote | |
535 | searching for changes |
|
535 | searching for changes | |
536 | remote: adding changesets |
|
536 | remote: adding changesets | |
537 | remote: adding manifests |
|
537 | remote: adding manifests | |
538 | remote: adding file changes |
|
538 | remote: adding file changes | |
539 | remote: added 1 changesets with 1 changes to 1 files |
|
539 | remote: added 1 changesets with 1 changes to 1 files | |
540 | remote: hook failure! |
|
540 | remote: hook failure! | |
541 | remote: transaction abort! |
|
541 | remote: transaction abort! | |
542 | remote: rollback completed |
|
542 | remote: rollback completed | |
543 | remote: abort: pretxnchangegroup.fail hook failed |
|
543 | remote: abort: pretxnchangegroup.fail hook failed | |
544 | [1] |
|
544 | [1] | |
545 |
|
545 | |||
546 | abort during pull is properly reported as such |
|
546 | abort during pull is properly reported as such | |
547 |
|
547 | |||
548 | $ echo morefoo >> ../remote/foo |
|
548 | $ echo morefoo >> ../remote/foo | |
549 | $ hg -R ../remote commit --message "more foo to be pulled" |
|
549 | $ hg -R ../remote commit --message "more foo to be pulled" | |
550 | $ cat >> ../remote/.hg/hgrc << EOF |
|
550 | $ cat >> ../remote/.hg/hgrc << EOF | |
551 | > [extensions] |
|
551 | > [extensions] | |
552 | > crash = ${TESTDIR}/crashgetbundler.py |
|
552 | > crash = ${TESTDIR}/crashgetbundler.py | |
553 | > EOF |
|
553 | > EOF | |
554 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" pull |
|
554 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" pull | |
555 | pulling from ssh://user@dummy/remote |
|
555 | pulling from ssh://user@dummy/remote | |
556 | searching for changes |
|
556 | searching for changes | |
557 | adding changesets |
|
557 | adding changesets | |
558 | remote: abort: this is an exercise |
|
558 | remote: abort: this is an exercise | |
559 | transaction abort! |
|
559 | transaction abort! | |
560 | rollback completed |
|
560 | rollback completed | |
561 | abort: stream ended unexpectedly (got 0 bytes, expected 4) |
|
561 | abort: stream ended unexpectedly (got 0 bytes, expected 4) | |
562 | [255] |
|
562 | [255] |
@@ -1,564 +1,564 | |||||
1 |
|
1 | |||
2 | This test tries to exercise the ssh functionality with a dummy script |
|
2 | This test tries to exercise the ssh functionality with a dummy script | |
3 |
|
3 | |||
4 | $ cat <<EOF >> $HGRCPATH |
|
4 | $ cat <<EOF >> $HGRCPATH | |
5 | > [format] |
|
5 | > [format] | |
6 | > usegeneraldelta=yes |
|
6 | > usegeneraldelta=yes | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 | creating 'remote' repo |
|
9 | creating 'remote' repo | |
10 |
|
10 | |||
11 | $ hg init remote |
|
11 | $ hg init remote | |
12 | $ cd remote |
|
12 | $ cd remote | |
13 | $ echo this > foo |
|
13 | $ echo this > foo | |
14 | $ echo this > fooO |
|
14 | $ echo this > fooO | |
15 | $ hg ci -A -m "init" foo fooO |
|
15 | $ hg ci -A -m "init" foo fooO | |
16 |
|
16 | |||
17 | insert a closed branch (issue4428) |
|
17 | insert a closed branch (issue4428) | |
18 |
|
18 | |||
19 | $ hg up null |
|
19 | $ hg up null | |
20 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
20 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
21 | $ hg branch closed |
|
21 | $ hg branch closed | |
22 | marked working directory as branch closed |
|
22 | marked working directory as branch closed | |
23 | (branches are permanent and global, did you want a bookmark?) |
|
23 | (branches are permanent and global, did you want a bookmark?) | |
24 | $ hg ci -mc0 |
|
24 | $ hg ci -mc0 | |
25 | $ hg ci --close-branch -mc1 |
|
25 | $ hg ci --close-branch -mc1 | |
26 | $ hg up -q default |
|
26 | $ hg up -q default | |
27 |
|
27 | |||
28 | configure for serving |
|
28 | configure for serving | |
29 |
|
29 | |||
30 | $ cat <<EOF > .hg/hgrc |
|
30 | $ cat <<EOF > .hg/hgrc | |
31 | > [server] |
|
31 | > [server] | |
32 | > uncompressed = True |
|
32 | > uncompressed = True | |
33 | > |
|
33 | > | |
34 | > [hooks] |
|
34 | > [hooks] | |
35 | > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog" |
|
35 | > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog" | |
36 | > EOF |
|
36 | > EOF | |
37 | $ cd .. |
|
37 | $ cd .. | |
38 |
|
38 | |||
39 | repo not found error |
|
39 | repo not found error | |
40 |
|
40 | |||
41 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local |
|
41 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local | |
42 | remote: abort: repository nonexistent not found! |
|
42 | remote: abort: repository nonexistent not found! | |
43 | abort: no suitable response from remote hg! |
|
43 | abort: no suitable response from remote hg! | |
44 | [255] |
|
44 | [255] | |
45 |
|
45 | |||
46 | non-existent absolute path |
|
46 | non-existent absolute path | |
47 |
|
47 | |||
48 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local |
|
48 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local | |
49 | remote: abort: repository $TESTTMP/nonexistent not found! |
|
49 | remote: abort: repository $TESTTMP/nonexistent not found! | |
50 | abort: no suitable response from remote hg! |
|
50 | abort: no suitable response from remote hg! | |
51 | [255] |
|
51 | [255] | |
52 |
|
52 | |||
53 | clone remote via stream |
|
53 | clone remote via stream | |
54 |
|
54 | |||
55 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream |
|
55 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream | |
56 | streaming all changes |
|
56 | streaming all changes | |
57 | 4 files to transfer, 602 bytes of data |
|
57 | 4 files to transfer, 602 bytes of data | |
58 | transferred 602 bytes in * seconds (*) (glob) |
|
58 | transferred 602 bytes in * seconds (*) (glob) | |
59 | searching for changes |
|
59 | searching for changes | |
60 | no changes found |
|
60 | no changes found | |
61 | updating to branch default |
|
61 | updating to branch default | |
62 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
62 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
63 | $ cd local-stream |
|
63 | $ cd local-stream | |
64 | $ hg verify |
|
64 | $ hg verify | |
65 | checking changesets |
|
65 | checking changesets | |
66 | checking manifests |
|
66 | checking manifests | |
67 | crosschecking files in changesets and manifests |
|
67 | crosschecking files in changesets and manifests | |
68 | checking files |
|
68 | checking files | |
69 | 2 files, 3 changesets, 2 total revisions |
|
69 | 2 files, 3 changesets, 2 total revisions | |
70 | $ hg branches |
|
70 | $ hg branches | |
71 | default 0:1160648e36ce |
|
71 | default 0:1160648e36ce | |
72 | $ cd .. |
|
72 | $ cd .. | |
73 |
|
73 | |||
74 | clone bookmarks via stream |
|
74 | clone bookmarks via stream | |
75 |
|
75 | |||
76 | $ hg -R local-stream book mybook |
|
76 | $ hg -R local-stream book mybook | |
77 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2 |
|
77 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2 | |
78 | streaming all changes |
|
78 | streaming all changes | |
79 | 4 files to transfer, 602 bytes of data |
|
79 | 4 files to transfer, 602 bytes of data | |
80 | transferred 602 bytes in * seconds (*) (glob) |
|
80 | transferred 602 bytes in * seconds (*) (glob) | |
81 | searching for changes |
|
81 | searching for changes | |
82 | no changes found |
|
82 | no changes found | |
83 | updating to branch default |
|
83 | updating to branch default | |
84 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
84 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
85 | $ cd stream2 |
|
85 | $ cd stream2 | |
86 | $ hg book |
|
86 | $ hg book | |
87 | mybook 0:1160648e36ce |
|
87 | mybook 0:1160648e36ce | |
88 | $ cd .. |
|
88 | $ cd .. | |
89 | $ rm -rf local-stream stream2 |
|
89 | $ rm -rf local-stream stream2 | |
90 |
|
90 | |||
91 | clone remote via pull |
|
91 | clone remote via pull | |
92 |
|
92 | |||
93 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local |
|
93 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local | |
94 | requesting all changes |
|
94 | requesting all changes | |
95 | adding changesets |
|
95 | adding changesets | |
96 | adding manifests |
|
96 | adding manifests | |
97 | adding file changes |
|
97 | adding file changes | |
98 | added 3 changesets with 2 changes to 2 files |
|
98 | added 3 changesets with 2 changes to 2 files | |
99 | updating to branch default |
|
99 | updating to branch default | |
100 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
101 |
|
101 | |||
102 | verify |
|
102 | verify | |
103 |
|
103 | |||
104 | $ cd local |
|
104 | $ cd local | |
105 | $ hg verify |
|
105 | $ hg verify | |
106 | checking changesets |
|
106 | checking changesets | |
107 | checking manifests |
|
107 | checking manifests | |
108 | crosschecking files in changesets and manifests |
|
108 | crosschecking files in changesets and manifests | |
109 | checking files |
|
109 | checking files | |
110 | 2 files, 3 changesets, 2 total revisions |
|
110 | 2 files, 3 changesets, 2 total revisions | |
111 | $ cat >> .hg/hgrc <<EOF |
|
111 | $ cat >> .hg/hgrc <<EOF | |
112 | > [hooks] |
|
112 | > [hooks] | |
113 | > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog" |
|
113 | > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog" | |
114 | > EOF |
|
114 | > EOF | |
115 |
|
115 | |||
116 | empty default pull |
|
116 | empty default pull | |
117 |
|
117 | |||
118 | $ hg paths |
|
118 | $ hg paths | |
119 | default = ssh://user@dummy/remote |
|
119 | default = ssh://user@dummy/remote | |
120 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" |
|
120 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" | |
121 | pulling from ssh://user@dummy/remote |
|
121 | pulling from ssh://user@dummy/remote | |
122 | searching for changes |
|
122 | searching for changes | |
123 | no changes found |
|
123 | no changes found | |
124 |
|
124 | |||
125 | pull from wrong ssh URL |
|
125 | pull from wrong ssh URL | |
126 |
|
126 | |||
127 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist |
|
127 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist | |
128 | pulling from ssh://user@dummy/doesnotexist |
|
128 | pulling from ssh://user@dummy/doesnotexist | |
129 | remote: abort: repository doesnotexist not found! |
|
129 | remote: abort: repository doesnotexist not found! | |
130 | abort: no suitable response from remote hg! |
|
130 | abort: no suitable response from remote hg! | |
131 | [255] |
|
131 | [255] | |
132 |
|
132 | |||
133 | local change |
|
133 | local change | |
134 |
|
134 | |||
135 | $ echo bleah > foo |
|
135 | $ echo bleah > foo | |
136 | $ hg ci -m "add" |
|
136 | $ hg ci -m "add" | |
137 |
|
137 | |||
138 | updating rc |
|
138 | updating rc | |
139 |
|
139 | |||
140 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
140 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
141 | $ echo "[ui]" >> .hg/hgrc |
|
141 | $ echo "[ui]" >> .hg/hgrc | |
142 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc |
|
142 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc | |
143 |
|
143 | |||
144 | find outgoing |
|
144 | find outgoing | |
145 |
|
145 | |||
146 | $ hg out ssh://user@dummy/remote |
|
146 | $ hg out ssh://user@dummy/remote | |
147 | comparing with ssh://user@dummy/remote |
|
147 | comparing with ssh://user@dummy/remote | |
148 | searching for changes |
|
148 | searching for changes | |
149 | changeset: 3:a28a9d1a809c |
|
149 | changeset: 3:a28a9d1a809c | |
150 | tag: tip |
|
150 | tag: tip | |
151 | parent: 0:1160648e36ce |
|
151 | parent: 0:1160648e36ce | |
152 | user: test |
|
152 | user: test | |
153 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
153 | date: Thu Jan 01 00:00:00 1970 +0000 | |
154 | summary: add |
|
154 | summary: add | |
155 |
|
155 | |||
156 |
|
156 | |||
157 | find incoming on the remote side |
|
157 | find incoming on the remote side | |
158 |
|
158 | |||
159 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local |
|
159 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local | |
160 | comparing with ssh://user@dummy/local |
|
160 | comparing with ssh://user@dummy/local | |
161 | searching for changes |
|
161 | searching for changes | |
162 | changeset: 3:a28a9d1a809c |
|
162 | changeset: 3:a28a9d1a809c | |
163 | tag: tip |
|
163 | tag: tip | |
164 | parent: 0:1160648e36ce |
|
164 | parent: 0:1160648e36ce | |
165 | user: test |
|
165 | user: test | |
166 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
166 | date: Thu Jan 01 00:00:00 1970 +0000 | |
167 | summary: add |
|
167 | summary: add | |
168 |
|
168 | |||
169 |
|
169 | |||
170 | find incoming on the remote side (using absolute path) |
|
170 | find incoming on the remote side (using absolute path) | |
171 |
|
171 | |||
172 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" |
|
172 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" | |
173 | comparing with ssh://user@dummy/$TESTTMP/local |
|
173 | comparing with ssh://user@dummy/$TESTTMP/local | |
174 | searching for changes |
|
174 | searching for changes | |
175 | changeset: 3:a28a9d1a809c |
|
175 | changeset: 3:a28a9d1a809c | |
176 | tag: tip |
|
176 | tag: tip | |
177 | parent: 0:1160648e36ce |
|
177 | parent: 0:1160648e36ce | |
178 | user: test |
|
178 | user: test | |
179 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
179 | date: Thu Jan 01 00:00:00 1970 +0000 | |
180 | summary: add |
|
180 | summary: add | |
181 |
|
181 | |||
182 |
|
182 | |||
183 | push |
|
183 | push | |
184 |
|
184 | |||
185 | $ hg push |
|
185 | $ hg push | |
186 | pushing to ssh://user@dummy/remote |
|
186 | pushing to ssh://user@dummy/remote | |
187 | searching for changes |
|
187 | searching for changes | |
188 | remote: adding changesets |
|
188 | remote: adding changesets | |
189 | remote: adding manifests |
|
189 | remote: adding manifests | |
190 | remote: adding file changes |
|
190 | remote: adding file changes | |
191 | remote: added 1 changesets with 1 changes to 1 files |
|
191 | remote: added 1 changesets with 1 changes to 1 files | |
192 | $ cd ../remote |
|
192 | $ cd ../remote | |
193 |
|
193 | |||
194 | check remote tip |
|
194 | check remote tip | |
195 |
|
195 | |||
196 | $ hg tip |
|
196 | $ hg tip | |
197 | changeset: 3:a28a9d1a809c |
|
197 | changeset: 3:a28a9d1a809c | |
198 | tag: tip |
|
198 | tag: tip | |
199 | parent: 0:1160648e36ce |
|
199 | parent: 0:1160648e36ce | |
200 | user: test |
|
200 | user: test | |
201 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
201 | date: Thu Jan 01 00:00:00 1970 +0000 | |
202 | summary: add |
|
202 | summary: add | |
203 |
|
203 | |||
204 | $ hg verify |
|
204 | $ hg verify | |
205 | checking changesets |
|
205 | checking changesets | |
206 | checking manifests |
|
206 | checking manifests | |
207 | crosschecking files in changesets and manifests |
|
207 | crosschecking files in changesets and manifests | |
208 | checking files |
|
208 | checking files | |
209 | 2 files, 4 changesets, 3 total revisions |
|
209 | 2 files, 4 changesets, 3 total revisions | |
210 | $ hg cat -r tip foo |
|
210 | $ hg cat -r tip foo | |
211 | bleah |
|
211 | bleah | |
212 | $ echo z > z |
|
212 | $ echo z > z | |
213 | $ hg ci -A -m z z |
|
213 | $ hg ci -A -m z z | |
214 | created new head |
|
214 | created new head | |
215 |
|
215 | |||
216 | test pushkeys and bookmarks |
|
216 | test pushkeys and bookmarks | |
217 |
|
217 | |||
218 | $ cd ../local |
|
218 | $ cd ../local | |
219 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces |
|
219 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces | |
220 | bookmarks |
|
220 | bookmarks | |
221 | namespaces |
|
221 | namespaces | |
222 | phases |
|
222 | phases | |
223 | $ hg book foo -r 0 |
|
223 | $ hg book foo -r 0 | |
224 | $ hg out -B |
|
224 | $ hg out -B | |
225 | comparing with ssh://user@dummy/remote |
|
225 | comparing with ssh://user@dummy/remote | |
226 | searching for changed bookmarks |
|
226 | searching for changed bookmarks | |
227 | foo 1160648e36ce |
|
227 | foo 1160648e36ce | |
228 | $ hg push -B foo |
|
228 | $ hg push -B foo | |
229 | pushing to ssh://user@dummy/remote |
|
229 | pushing to ssh://user@dummy/remote | |
230 | searching for changes |
|
230 | searching for changes | |
231 | no changes found |
|
231 | no changes found | |
232 | exporting bookmark foo |
|
232 | exporting bookmark foo | |
233 | [1] |
|
233 | [1] | |
234 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks |
|
234 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks | |
235 | foo 1160648e36cec0054048a7edc4110c6f84fde594 |
|
235 | foo 1160648e36cec0054048a7edc4110c6f84fde594 | |
236 | $ hg book -f foo |
|
236 | $ hg book -f foo | |
237 | $ hg push --traceback |
|
237 | $ hg push --traceback | |
238 | pushing to ssh://user@dummy/remote |
|
238 | pushing to ssh://user@dummy/remote | |
239 | searching for changes |
|
239 | searching for changes | |
240 | no changes found |
|
240 | no changes found | |
241 | updating bookmark foo |
|
241 | updating bookmark foo | |
242 | [1] |
|
242 | [1] | |
243 | $ hg book -d foo |
|
243 | $ hg book -d foo | |
244 | $ hg in -B |
|
244 | $ hg in -B | |
245 | comparing with ssh://user@dummy/remote |
|
245 | comparing with ssh://user@dummy/remote | |
246 | searching for changed bookmarks |
|
246 | searching for changed bookmarks | |
247 | foo a28a9d1a809c |
|
247 | foo a28a9d1a809c | |
248 | $ hg book -f -r 0 foo |
|
248 | $ hg book -f -r 0 foo | |
249 | $ hg pull -B foo |
|
249 | $ hg pull -B foo | |
250 | pulling from ssh://user@dummy/remote |
|
250 | pulling from ssh://user@dummy/remote | |
251 | no changes found |
|
251 | no changes found | |
252 | updating bookmark foo |
|
252 | updating bookmark foo | |
253 | $ hg book -d foo |
|
253 | $ hg book -d foo | |
254 | $ hg push -B foo |
|
254 | $ hg push -B foo | |
255 | pushing to ssh://user@dummy/remote |
|
255 | pushing to ssh://user@dummy/remote | |
256 | searching for changes |
|
256 | searching for changes | |
257 | no changes found |
|
257 | no changes found | |
258 | deleting remote bookmark foo |
|
258 | deleting remote bookmark foo | |
259 | [1] |
|
259 | [1] | |
260 |
|
260 | |||
261 | a bad, evil hook that prints to stdout |
|
261 | a bad, evil hook that prints to stdout | |
262 |
|
262 | |||
263 | $ cat <<EOF > $TESTTMP/badhook |
|
263 | $ cat <<EOF > $TESTTMP/badhook | |
264 | > import sys |
|
264 | > import sys | |
265 | > sys.stdout.write("KABOOM\n") |
|
265 | > sys.stdout.write("KABOOM\n") | |
266 | > EOF |
|
266 | > EOF | |
267 |
|
267 | |||
268 | $ cat <<EOF > $TESTTMP/badpyhook.py |
|
268 | $ cat <<EOF > $TESTTMP/badpyhook.py | |
269 | > import sys |
|
269 | > import sys | |
270 | > def hook(ui, repo, hooktype, **kwargs): |
|
270 | > def hook(ui, repo, hooktype, **kwargs): | |
271 | > sys.stdout.write("KABOOM IN PROCESS\n") |
|
271 | > sys.stdout.write("KABOOM IN PROCESS\n") | |
272 | > EOF |
|
272 | > EOF | |
273 |
|
273 | |||
274 | $ cat <<EOF >> ../remote/.hg/hgrc |
|
274 | $ cat <<EOF >> ../remote/.hg/hgrc | |
275 | > [hooks] |
|
275 | > [hooks] | |
276 | > changegroup.stdout = python $TESTTMP/badhook |
|
276 | > changegroup.stdout = python $TESTTMP/badhook | |
277 | > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook |
|
277 | > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook | |
278 | > EOF |
|
278 | > EOF | |
279 | $ echo r > r |
|
279 | $ echo r > r | |
280 | $ hg ci -A -m z r |
|
280 | $ hg ci -A -m z r | |
281 |
|
281 | |||
282 | push should succeed even though it has an unexpected response |
|
282 | push should succeed even though it has an unexpected response | |
283 |
|
283 | |||
284 | $ hg push |
|
284 | $ hg push | |
285 | pushing to ssh://user@dummy/remote |
|
285 | pushing to ssh://user@dummy/remote | |
286 | searching for changes |
|
286 | searching for changes | |
287 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 |
|
287 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 | |
288 | remote: adding changesets |
|
288 | remote: adding changesets | |
289 | remote: adding manifests |
|
289 | remote: adding manifests | |
290 | remote: adding file changes |
|
290 | remote: adding file changes | |
291 | remote: added 1 changesets with 1 changes to 1 files |
|
291 | remote: added 1 changesets with 1 changes to 1 files | |
292 | remote: KABOOM |
|
292 | remote: KABOOM | |
293 | remote: KABOOM IN PROCESS |
|
293 | remote: KABOOM IN PROCESS | |
294 | $ hg -R ../remote heads |
|
294 | $ hg -R ../remote heads | |
295 | changeset: 5:1383141674ec |
|
295 | changeset: 5:1383141674ec | |
296 | tag: tip |
|
296 | tag: tip | |
297 | parent: 3:a28a9d1a809c |
|
297 | parent: 3:a28a9d1a809c | |
298 | user: test |
|
298 | user: test | |
299 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
299 | date: Thu Jan 01 00:00:00 1970 +0000 | |
300 | summary: z |
|
300 | summary: z | |
301 |
|
301 | |||
302 | changeset: 4:6c0482d977a3 |
|
302 | changeset: 4:6c0482d977a3 | |
303 | parent: 0:1160648e36ce |
|
303 | parent: 0:1160648e36ce | |
304 | user: test |
|
304 | user: test | |
305 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
305 | date: Thu Jan 01 00:00:00 1970 +0000 | |
306 | summary: z |
|
306 | summary: z | |
307 |
|
307 | |||
308 |
|
308 | |||
309 | clone bookmarks |
|
309 | clone bookmarks | |
310 |
|
310 | |||
311 | $ hg -R ../remote bookmark test |
|
311 | $ hg -R ../remote bookmark test | |
312 | $ hg -R ../remote bookmarks |
|
312 | $ hg -R ../remote bookmarks | |
313 | * test 4:6c0482d977a3 |
|
313 | * test 4:6c0482d977a3 | |
314 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks |
|
314 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks | |
315 | requesting all changes |
|
315 | requesting all changes | |
316 | adding changesets |
|
316 | adding changesets | |
317 | adding manifests |
|
317 | adding manifests | |
318 | adding file changes |
|
318 | adding file changes | |
319 | added 6 changesets with 5 changes to 4 files (+1 heads) |
|
319 | added 6 changesets with 5 changes to 4 files (+1 heads) | |
320 | updating to branch default |
|
320 | updating to branch default | |
321 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
321 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
322 | $ hg -R local-bookmarks bookmarks |
|
322 | $ hg -R local-bookmarks bookmarks | |
323 | test 4:6c0482d977a3 |
|
323 | test 4:6c0482d977a3 | |
324 |
|
324 | |||
325 | passwords in ssh urls are not supported |
|
325 | passwords in ssh urls are not supported | |
326 | (we use a glob here because different Python versions give different |
|
326 | (we use a glob here because different Python versions give different | |
327 | results here) |
|
327 | results here) | |
328 |
|
328 | |||
329 | $ hg push ssh://user:erroneouspwd@dummy/remote |
|
329 | $ hg push ssh://user:erroneouspwd@dummy/remote | |
330 | pushing to ssh://user:*@dummy/remote (glob) |
|
330 | pushing to ssh://user:*@dummy/remote (glob) | |
331 | abort: password in URL not supported! |
|
331 | abort: password in URL not supported! | |
332 | [255] |
|
332 | [255] | |
333 |
|
333 | |||
334 | $ cd .. |
|
334 | $ cd .. | |
335 |
|
335 | |||
336 | hide outer repo |
|
336 | hide outer repo | |
337 | $ hg init |
|
337 | $ hg init | |
338 |
|
338 | |||
339 | Test remote paths with spaces (issue2983): |
|
339 | Test remote paths with spaces (issue2983): | |
340 |
|
340 | |||
341 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
341 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
342 | $ touch "$TESTTMP/a repo/test" |
|
342 | $ touch "$TESTTMP/a repo/test" | |
343 | $ hg -R 'a repo' commit -A -m "test" |
|
343 | $ hg -R 'a repo' commit -A -m "test" | |
344 | adding test |
|
344 | adding test | |
345 | $ hg -R 'a repo' tag tag |
|
345 | $ hg -R 'a repo' tag tag | |
346 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
346 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
347 | 73649e48688a |
|
347 | 73649e48688a | |
348 |
|
348 | |||
349 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" |
|
349 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" | |
350 | abort: unknown revision 'noNoNO'! |
|
350 | abort: unknown revision 'noNoNO'! | |
351 | [255] |
|
351 | [255] | |
352 |
|
352 | |||
353 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): |
|
353 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): | |
354 |
|
354 | |||
355 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
355 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
356 | destination directory: a repo |
|
356 | destination directory: a repo | |
357 | abort: destination 'a repo' is not empty |
|
357 | abort: destination 'a repo' is not empty | |
358 | [255] |
|
358 | [255] | |
359 |
|
359 | |||
360 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might |
|
360 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might | |
361 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right |
|
361 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right | |
362 | parameters: |
|
362 | parameters: | |
363 |
|
363 | |||
364 | $ cat > ssh.sh << EOF |
|
364 | $ cat > ssh.sh << EOF | |
365 | > userhost="\$1" |
|
365 | > userhost="\$1" | |
366 | > SSH_ORIGINAL_COMMAND="\$2" |
|
366 | > SSH_ORIGINAL_COMMAND="\$2" | |
367 | > export SSH_ORIGINAL_COMMAND |
|
367 | > export SSH_ORIGINAL_COMMAND | |
368 | > PYTHONPATH="$PYTHONPATH" |
|
368 | > PYTHONPATH="$PYTHONPATH" | |
369 | > export PYTHONPATH |
|
369 | > export PYTHONPATH | |
370 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" |
|
370 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" | |
371 | > EOF |
|
371 | > EOF | |
372 |
|
372 | |||
373 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" |
|
373 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" | |
374 | 73649e48688a |
|
374 | 73649e48688a | |
375 |
|
375 | |||
376 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" |
|
376 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" | |
377 | remote: Illegal repository "$TESTTMP/a'repo" (glob) |
|
377 | remote: Illegal repository "$TESTTMP/a'repo" (glob) | |
378 | abort: no suitable response from remote hg! |
|
378 | abort: no suitable response from remote hg! | |
379 | [255] |
|
379 | [255] | |
380 |
|
380 | |||
381 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" |
|
381 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" | |
382 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" |
|
382 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" | |
383 | abort: no suitable response from remote hg! |
|
383 | abort: no suitable response from remote hg! | |
384 | [255] |
|
384 | [255] | |
385 |
|
385 | |||
386 | $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh" |
|
386 | $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh" | |
387 | Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation |
|
387 | Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation | |
388 | [255] |
|
388 | [255] | |
389 |
|
389 | |||
390 | Test hg-ssh in read-only mode: |
|
390 | Test hg-ssh in read-only mode: | |
391 |
|
391 | |||
392 | $ cat > ssh.sh << EOF |
|
392 | $ cat > ssh.sh << EOF | |
393 | > userhost="\$1" |
|
393 | > userhost="\$1" | |
394 | > SSH_ORIGINAL_COMMAND="\$2" |
|
394 | > SSH_ORIGINAL_COMMAND="\$2" | |
395 | > export SSH_ORIGINAL_COMMAND |
|
395 | > export SSH_ORIGINAL_COMMAND | |
396 | > PYTHONPATH="$PYTHONPATH" |
|
396 | > PYTHONPATH="$PYTHONPATH" | |
397 | > export PYTHONPATH |
|
397 | > export PYTHONPATH | |
398 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" |
|
398 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" | |
399 | > EOF |
|
399 | > EOF | |
400 |
|
400 | |||
401 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local |
|
401 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local | |
402 | requesting all changes |
|
402 | requesting all changes | |
403 | adding changesets |
|
403 | adding changesets | |
404 | adding manifests |
|
404 | adding manifests | |
405 | adding file changes |
|
405 | adding file changes | |
406 | added 6 changesets with 5 changes to 4 files (+1 heads) |
|
406 | added 6 changesets with 5 changes to 4 files (+1 heads) | |
407 | updating to branch default |
|
407 | updating to branch default | |
408 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
408 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
409 |
|
409 | |||
410 | $ cd read-only-local |
|
410 | $ cd read-only-local | |
411 | $ echo "baz" > bar |
|
411 | $ echo "baz" > bar | |
412 | $ hg ci -A -m "unpushable commit" bar |
|
412 | $ hg ci -A -m "unpushable commit" bar | |
413 | $ hg push --ssh "sh ../ssh.sh" |
|
413 | $ hg push --ssh "sh ../ssh.sh" | |
414 | pushing to ssh://user@dummy/*/remote (glob) |
|
414 | pushing to ssh://user@dummy/*/remote (glob) | |
415 | searching for changes |
|
415 | searching for changes | |
416 | remote: Permission denied |
|
416 | remote: Permission denied | |
417 | remote: pretxnopen.hg-ssh hook failed |
|
417 | remote: pretxnopen.hg-ssh hook failed | |
418 | abort: push failed on remote |
|
418 | abort: push failed on remote | |
419 | [255] |
|
419 | [255] | |
420 |
|
420 | |||
421 | $ cd .. |
|
421 | $ cd .. | |
422 |
|
422 | |||
423 | stderr from remote commands should be printed before stdout from local code (issue4336) |
|
423 | stderr from remote commands should be printed before stdout from local code (issue4336) | |
424 |
|
424 | |||
425 | $ hg clone remote stderr-ordering |
|
425 | $ hg clone remote stderr-ordering | |
426 | updating to branch default |
|
426 | updating to branch default | |
427 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
427 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
428 | $ cd stderr-ordering |
|
428 | $ cd stderr-ordering | |
429 | $ cat >> localwrite.py << EOF |
|
429 | $ cat >> localwrite.py << EOF | |
430 | > from mercurial import exchange, extensions |
|
430 | > from mercurial import exchange, extensions | |
431 | > |
|
431 | > | |
432 | > def wrappedpush(orig, repo, *args, **kwargs): |
|
432 | > def wrappedpush(orig, repo, *args, **kwargs): | |
433 | > res = orig(repo, *args, **kwargs) |
|
433 | > res = orig(repo, *args, **kwargs) | |
434 | > repo.ui.write('local stdout\n') |
|
434 | > repo.ui.write('local stdout\n') | |
435 | > return res |
|
435 | > return res | |
436 | > |
|
436 | > | |
437 | > def extsetup(ui): |
|
437 | > def extsetup(ui): | |
438 | > extensions.wrapfunction(exchange, 'push', wrappedpush) |
|
438 | > extensions.wrapfunction(exchange, 'push', wrappedpush) | |
439 | > EOF |
|
439 | > EOF | |
440 |
|
440 | |||
441 | $ cat >> .hg/hgrc << EOF |
|
441 | $ cat >> .hg/hgrc << EOF | |
442 | > [paths] |
|
442 | > [paths] | |
443 | > default-push = ssh://user@dummy/remote |
|
443 | > default-push = ssh://user@dummy/remote | |
444 | > [ui] |
|
444 | > [ui] | |
445 | > ssh = python "$TESTDIR/dummyssh" |
|
445 | > ssh = python "$TESTDIR/dummyssh" | |
446 | > [extensions] |
|
446 | > [extensions] | |
447 | > localwrite = localwrite.py |
|
447 | > localwrite = localwrite.py | |
448 | > EOF |
|
448 | > EOF | |
449 |
|
449 | |||
450 | $ echo localwrite > foo |
|
450 | $ echo localwrite > foo | |
451 | $ hg commit -m 'testing localwrite' |
|
451 | $ hg commit -m 'testing localwrite' | |
452 | $ hg push |
|
452 | $ hg push | |
453 | pushing to ssh://user@dummy/remote |
|
453 | pushing to ssh://user@dummy/remote | |
454 | searching for changes |
|
454 | searching for changes | |
455 | remote: adding changesets |
|
455 | remote: adding changesets | |
456 | remote: adding manifests |
|
456 | remote: adding manifests | |
457 | remote: adding file changes |
|
457 | remote: adding file changes | |
458 | remote: added 1 changesets with 1 changes to 1 files |
|
458 | remote: added 1 changesets with 1 changes to 1 files | |
459 | remote: KABOOM |
|
459 | remote: KABOOM | |
460 | remote: KABOOM IN PROCESS |
|
460 | remote: KABOOM IN PROCESS | |
461 | local stdout |
|
461 | local stdout | |
462 |
|
462 | |||
463 | debug output |
|
463 | debug output | |
464 |
|
464 | |||
465 | $ hg pull --debug ssh://user@dummy/remote |
|
465 | $ hg pull --debug ssh://user@dummy/remote | |
466 | pulling from ssh://user@dummy/remote |
|
466 | pulling from ssh://user@dummy/remote | |
467 | running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) |
|
467 | running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) | |
468 | sending hello command |
|
468 | sending hello command | |
469 | sending between command |
|
469 | sending between command | |
470 | remote: 355 |
|
470 | remote: 355 | |
471 | remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN |
|
471 | remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN | |
472 | remote: 1 |
|
472 | remote: 1 | |
473 | query 1; heads |
|
473 | query 1; heads | |
474 | sending batch command |
|
474 | sending batch command | |
475 | searching for changes |
|
475 | searching for changes | |
476 | all remote heads known locally |
|
476 | all remote heads known locally | |
477 | no changes found |
|
477 | no changes found | |
478 | sending getbundle command |
|
478 | sending getbundle command | |
479 | bundle2-input-bundle: with-transaction |
|
479 | bundle2-input-bundle: with-transaction | |
480 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
480 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
481 | bundle2-input-part: total payload size 15 |
|
481 | bundle2-input-part: total payload size 15 | |
482 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
482 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
483 | bundle2-input-part: total payload size 45 |
|
483 | bundle2-input-part: total payload size 45 | |
484 | bundle2-input-bundle: 1 parts total |
|
484 | bundle2-input-bundle: 1 parts total | |
485 | checking for updated bookmarks |
|
485 | checking for updated bookmarks | |
486 |
|
486 | |||
487 | $ cd .. |
|
487 | $ cd .. | |
488 |
|
488 | |||
489 | $ cat dummylog |
|
489 | $ cat dummylog | |
490 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
490 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio | |
491 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio |
|
491 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio | |
492 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
492 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
493 | Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio |
|
493 | Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio | |
494 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
494 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
495 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
495 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
496 | Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio |
|
496 | Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio | |
497 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
497 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
498 | Got arguments 1:user@dummy 2:hg -R local serve --stdio |
|
498 | Got arguments 1:user@dummy 2:hg -R local serve --stdio | |
499 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio |
|
499 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio | |
500 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
500 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
501 | changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP |
|
501 | changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP | |
502 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
502 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
503 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
503 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
504 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
504 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
505 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
505 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
506 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
506 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
507 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
507 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
508 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
508 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
509 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
509 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
510 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
510 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
511 | changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP |
|
511 | changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP | |
512 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
512 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
513 | Got arguments 1:user@dummy 2:hg init 'a repo' |
|
513 | Got arguments 1:user@dummy 2:hg init 'a repo' | |
514 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
514 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
515 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
515 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
516 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
516 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
517 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
517 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
518 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
518 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
519 | changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP |
|
519 | changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP | |
520 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
520 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
521 |
|
521 | |||
522 | remote hook failure is attributed to remote |
|
522 | remote hook failure is attributed to remote | |
523 |
|
523 | |||
524 | $ cat > $TESTTMP/failhook << EOF |
|
524 | $ cat > $TESTTMP/failhook << EOF | |
525 | > def hook(ui, repo, **kwargs): |
|
525 | > def hook(ui, repo, **kwargs): | |
526 | > ui.write('hook failure!\n') |
|
526 | > ui.write('hook failure!\n') | |
527 | > ui.flush() |
|
527 | > ui.flush() | |
528 | > return 1 |
|
528 | > return 1 | |
529 | > EOF |
|
529 | > EOF | |
530 |
|
530 | |||
531 | $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc |
|
531 | $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc | |
532 |
|
532 | |||
533 | $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout |
|
533 | $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout | |
534 | $ cd hookout |
|
534 | $ cd hookout | |
535 | $ touch hookfailure |
|
535 | $ touch hookfailure | |
536 | $ hg -q commit -A -m 'remote hook failure' |
|
536 | $ hg -q commit -A -m 'remote hook failure' | |
537 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" push |
|
537 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" push | |
538 | pushing to ssh://user@dummy/remote |
|
538 | pushing to ssh://user@dummy/remote | |
539 | searching for changes |
|
539 | searching for changes | |
540 | remote: adding changesets |
|
540 | remote: adding changesets | |
541 | remote: adding manifests |
|
541 | remote: adding manifests | |
542 | remote: adding file changes |
|
542 | remote: adding file changes | |
543 | remote: added 1 changesets with 1 changes to 1 files |
|
543 | remote: added 1 changesets with 1 changes to 1 files | |
544 | remote: hook failure! |
|
544 | remote: hook failure! | |
545 | remote: transaction abort! |
|
545 | remote: transaction abort! | |
546 | remote: rollback completed |
|
546 | remote: rollback completed | |
547 | remote: pretxnchangegroup.fail hook failed |
|
547 | remote: pretxnchangegroup.fail hook failed | |
548 | abort: push failed on remote |
|
548 | abort: push failed on remote | |
549 | [255] |
|
549 | [255] | |
550 |
|
550 | |||
551 | abort during pull is properly reported as such |
|
551 | abort during pull is properly reported as such | |
552 |
|
552 | |||
553 | $ echo morefoo >> ../remote/foo |
|
553 | $ echo morefoo >> ../remote/foo | |
554 | $ hg -R ../remote commit --message "more foo to be pulled" |
|
554 | $ hg -R ../remote commit --message "more foo to be pulled" | |
555 | $ cat >> ../remote/.hg/hgrc << EOF |
|
555 | $ cat >> ../remote/.hg/hgrc << EOF | |
556 | > [extensions] |
|
556 | > [extensions] | |
557 | > crash = ${TESTDIR}/crashgetbundler.py |
|
557 | > crash = ${TESTDIR}/crashgetbundler.py | |
558 | > EOF |
|
558 | > EOF | |
559 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" pull |
|
559 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" pull | |
560 | pulling from ssh://user@dummy/remote |
|
560 | pulling from ssh://user@dummy/remote | |
561 | searching for changes |
|
561 | searching for changes | |
562 | remote: abort: this is an exercise |
|
562 | remote: abort: this is an exercise | |
563 | abort: pull failed on remote |
|
563 | abort: pull failed on remote | |
564 | [255] |
|
564 | [255] |
@@ -1,159 +1,159 | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | $ hg clone http://localhost:$HGPORT/ copy |
|
3 | $ hg clone http://localhost:$HGPORT/ copy | |
4 | abort: * (glob) |
|
4 | abort: * (glob) | |
5 | [255] |
|
5 | [255] | |
6 | $ test -d copy |
|
6 | $ test -d copy | |
7 | [1] |
|
7 | [1] | |
8 |
|
8 | |||
9 | This server doesn't do range requests so it's basically only good for |
|
9 | This server doesn't do range requests so it's basically only good for | |
10 | one pull |
|
10 | one pull | |
11 |
|
11 | |||
12 | $ python "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid |
|
12 | $ python "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid | |
13 | $ cat dumb.pid >> $DAEMON_PIDS |
|
13 | $ cat dumb.pid >> $DAEMON_PIDS | |
14 | $ hg init remote |
|
14 | $ hg init remote | |
15 | $ cd remote |
|
15 | $ cd remote | |
16 | $ echo foo > bar |
|
16 | $ echo foo > bar | |
17 | $ echo c2 > '.dotfile with spaces' |
|
17 | $ echo c2 > '.dotfile with spaces' | |
18 | $ hg add |
|
18 | $ hg add | |
19 | adding .dotfile with spaces |
|
19 | adding .dotfile with spaces | |
20 | adding bar |
|
20 | adding bar | |
21 | $ hg commit -m"test" |
|
21 | $ hg commit -m"test" | |
22 | $ hg tip |
|
22 | $ hg tip | |
23 | changeset: 0:02770d679fb8 |
|
23 | changeset: 0:02770d679fb8 | |
24 | tag: tip |
|
24 | tag: tip | |
25 | user: test |
|
25 | user: test | |
26 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
26 | date: Thu Jan 01 00:00:00 1970 +0000 | |
27 | summary: test |
|
27 | summary: test | |
28 |
|
28 | |||
29 | $ cd .. |
|
29 | $ cd .. | |
30 | $ hg clone static-http://localhost:$HGPORT/remote local |
|
30 | $ hg clone static-http://localhost:$HGPORT/remote local | |
31 | requesting all changes |
|
31 | requesting all changes | |
32 | adding changesets |
|
32 | adding changesets | |
33 | adding manifests |
|
33 | adding manifests | |
34 | adding file changes |
|
34 | adding file changes | |
35 | added 1 changesets with 2 changes to 2 files |
|
35 | added 1 changesets with 2 changes to 2 files | |
36 | updating to branch default |
|
36 | updating to branch default | |
37 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
37 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
38 | $ cd local |
|
38 | $ cd local | |
39 | $ hg verify |
|
39 | $ hg verify | |
40 | checking changesets |
|
40 | checking changesets | |
41 | checking manifests |
|
41 | checking manifests | |
42 | crosschecking files in changesets and manifests |
|
42 | crosschecking files in changesets and manifests | |
43 | checking files |
|
43 | checking files | |
44 | 2 files, 1 changesets, 2 total revisions |
|
44 | 2 files, 1 changesets, 2 total revisions | |
45 | $ cat bar |
|
45 | $ cat bar | |
46 | foo |
|
46 | foo | |
47 | $ cd ../remote |
|
47 | $ cd ../remote | |
48 | $ echo baz > quux |
|
48 | $ echo baz > quux | |
49 | $ hg commit -A -mtest2 |
|
49 | $ hg commit -A -mtest2 | |
50 | adding quux |
|
50 | adding quux | |
51 |
|
51 | |||
52 | check for HTTP opener failures when cachefile does not exist |
|
52 | check for HTTP opener failures when cachefile does not exist | |
53 |
|
53 | |||
54 | $ rm .hg/cache/* |
|
54 | $ rm .hg/cache/* | |
55 | $ cd ../local |
|
55 | $ cd ../local | |
56 | $ cat >> .hg/hgrc <<EOF |
|
56 | $ cat >> .hg/hgrc <<EOF | |
57 | > [hooks] |
|
57 | > [hooks] | |
58 | > changegroup = sh -c "printenv.py changegroup" |
|
58 | > changegroup = sh -c "printenv.py changegroup" | |
59 | > EOF |
|
59 | > EOF | |
60 | $ hg pull |
|
60 | $ hg pull | |
61 | pulling from static-http://localhost:$HGPORT/remote |
|
61 | pulling from static-http://localhost:$HGPORT/remote | |
62 | searching for changes |
|
62 | searching for changes | |
63 | adding changesets |
|
63 | adding changesets | |
64 | adding manifests |
|
64 | adding manifests | |
65 | adding file changes |
|
65 | adding file changes | |
66 | added 1 changesets with 1 changes to 1 files |
|
66 | added 1 changesets with 1 changes to 1 files | |
67 | changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT/remote |
|
67 | changegroup hook: HG_HOOKTYPE=changegroup HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT/remote | |
68 | (run 'hg update' to get a working copy) |
|
68 | (run 'hg update' to get a working copy) | |
69 |
|
69 | |||
70 | trying to push |
|
70 | trying to push | |
71 |
|
71 | |||
72 | $ hg update |
|
72 | $ hg update | |
73 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
73 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
74 | $ echo more foo >> bar |
|
74 | $ echo more foo >> bar | |
75 | $ hg commit -m"test" |
|
75 | $ hg commit -m"test" | |
76 | $ hg push |
|
76 | $ hg push | |
77 | pushing to static-http://localhost:$HGPORT/remote |
|
77 | pushing to static-http://localhost:$HGPORT/remote | |
78 | abort: destination does not support push |
|
78 | abort: destination does not support push | |
79 | [255] |
|
79 | [255] | |
80 |
|
80 | |||
81 | trying clone -r |
|
81 | trying clone -r | |
82 |
|
82 | |||
83 | $ cd .. |
|
83 | $ cd .. | |
84 | $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0 |
|
84 | $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0 | |
85 | abort: unknown revision 'doesnotexist'! |
|
85 | abort: unknown revision 'doesnotexist'! | |
86 | [255] |
|
86 | [255] | |
87 | $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0 |
|
87 | $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0 | |
88 | adding changesets |
|
88 | adding changesets | |
89 | adding manifests |
|
89 | adding manifests | |
90 | adding file changes |
|
90 | adding file changes | |
91 | added 1 changesets with 2 changes to 2 files |
|
91 | added 1 changesets with 2 changes to 2 files | |
92 | updating to branch default |
|
92 | updating to branch default | |
93 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
93 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
94 |
|
94 | |||
95 | test with "/" URI (issue747) and subrepo |
|
95 | test with "/" URI (issue747) and subrepo | |
96 |
|
96 | |||
97 | $ hg init |
|
97 | $ hg init | |
98 | $ hg init sub |
|
98 | $ hg init sub | |
99 | $ touch sub/test |
|
99 | $ touch sub/test | |
100 | $ hg -R sub commit -A -m "test" |
|
100 | $ hg -R sub commit -A -m "test" | |
101 | adding test |
|
101 | adding test | |
102 | $ hg -R sub tag not-empty |
|
102 | $ hg -R sub tag not-empty | |
103 | $ echo sub=sub > .hgsub |
|
103 | $ echo sub=sub > .hgsub | |
104 | $ echo a > a |
|
104 | $ echo a > a | |
105 | $ hg add a .hgsub |
|
105 | $ hg add a .hgsub | |
106 | $ hg -q ci -ma |
|
106 | $ hg -q ci -ma | |
107 | $ hg clone static-http://localhost:$HGPORT/ local2 |
|
107 | $ hg clone static-http://localhost:$HGPORT/ local2 | |
108 | requesting all changes |
|
108 | requesting all changes | |
109 | adding changesets |
|
109 | adding changesets | |
110 | adding manifests |
|
110 | adding manifests | |
111 | adding file changes |
|
111 | adding file changes | |
112 | added 1 changesets with 3 changes to 3 files |
|
112 | added 1 changesets with 3 changes to 3 files | |
113 | updating to branch default |
|
113 | updating to branch default | |
114 | cloning subrepo sub from static-http://localhost:$HGPORT/sub |
|
114 | cloning subrepo sub from static-http://localhost:$HGPORT/sub | |
115 | requesting all changes |
|
115 | requesting all changes | |
116 | adding changesets |
|
116 | adding changesets | |
117 | adding manifests |
|
117 | adding manifests | |
118 | adding file changes |
|
118 | adding file changes | |
119 | added 2 changesets with 2 changes to 2 files |
|
119 | added 2 changesets with 2 changes to 2 files | |
120 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
120 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
121 | $ cd local2 |
|
121 | $ cd local2 | |
122 | $ hg verify |
|
122 | $ hg verify | |
123 | checking changesets |
|
123 | checking changesets | |
124 | checking manifests |
|
124 | checking manifests | |
125 | crosschecking files in changesets and manifests |
|
125 | crosschecking files in changesets and manifests | |
126 | checking files |
|
126 | checking files | |
127 | 3 files, 1 changesets, 3 total revisions |
|
127 | 3 files, 1 changesets, 3 total revisions | |
128 | checking subrepo links |
|
128 | checking subrepo links | |
129 | $ cat a |
|
129 | $ cat a | |
130 | a |
|
130 | a | |
131 | $ hg paths |
|
131 | $ hg paths | |
132 | default = static-http://localhost:$HGPORT/ |
|
132 | default = static-http://localhost:$HGPORT/ | |
133 |
|
133 | |||
134 | test with empty repo (issue965) |
|
134 | test with empty repo (issue965) | |
135 |
|
135 | |||
136 | $ cd .. |
|
136 | $ cd .. | |
137 | $ hg init remotempty |
|
137 | $ hg init remotempty | |
138 | $ hg clone static-http://localhost:$HGPORT/remotempty local3 |
|
138 | $ hg clone static-http://localhost:$HGPORT/remotempty local3 | |
139 | no changes found |
|
139 | no changes found | |
140 | updating to branch default |
|
140 | updating to branch default | |
141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
142 | $ cd local3 |
|
142 | $ cd local3 | |
143 | $ hg verify |
|
143 | $ hg verify | |
144 | checking changesets |
|
144 | checking changesets | |
145 | checking manifests |
|
145 | checking manifests | |
146 | crosschecking files in changesets and manifests |
|
146 | crosschecking files in changesets and manifests | |
147 | checking files |
|
147 | checking files | |
148 | 0 files, 0 changesets, 0 total revisions |
|
148 | 0 files, 0 changesets, 0 total revisions | |
149 | $ hg paths |
|
149 | $ hg paths | |
150 | default = static-http://localhost:$HGPORT/remotempty |
|
150 | default = static-http://localhost:$HGPORT/remotempty | |
151 |
|
151 | |||
152 | test with non-repo |
|
152 | test with non-repo | |
153 |
|
153 | |||
154 | $ cd .. |
|
154 | $ cd .. | |
155 | $ mkdir notarepo |
|
155 | $ mkdir notarepo | |
156 | $ hg clone static-http://localhost:$HGPORT/notarepo local3 |
|
156 | $ hg clone static-http://localhost:$HGPORT/notarepo local3 | |
157 | abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository! |
|
157 | abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository! | |
158 | [255] |
|
158 | [255] | |
159 | $ killdaemons.py |
|
159 | $ killdaemons.py |
General Comments 0
You need to be logged in to leave comments.
Login now