Mercurial > hg
annotate tests/test-convert.t @ 14732:e9ed3506f066 stable
backout of d04ba50e104d: allow to qpop/push with a dirty working copy
The new behavior was breaking existing tools that relied on a sequence such as
this:
1) start with a dirty working copy
2) qimport some patch
3) try to qpush it
4) old behavior would fail at this point due to outstanding changes.
(new behavior would only fail if the outstanding changes and the patches
changes intersect)
5) innocent user qrefreshes, gets his local changes in the imported patch
It's worth considering if we can move this behavior to -f in the future.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 24 Jun 2011 23:25:42 +0300 |
parents | 3178aca36b0f |
children | ff26712a0c50 |
rev | line source |
---|---|
5441
71e7c86adcb7
convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents:
5028
diff
changeset
|
1 |
12510 | 2 $ cat >> $HGRCPATH <<EOF |
3 > [extensions] | |
4 > convert= | |
5 > [convert] | |
6 > hg.saverev=False | |
7 > EOF | |
8 $ hg help convert | |
9 hg convert [OPTION]... SOURCE [DEST [REVMAP]] | |
10 | |
11 convert a foreign SCM repository to a Mercurial one. | |
12 | |
13 Accepted source formats [identifiers]: | |
14 | |
15 - Mercurial [hg] | |
16 - CVS [cvs] | |
17 - Darcs [darcs] | |
18 - git [git] | |
19 - Subversion [svn] | |
20 - Monotone [mtn] | |
21 - GNU Arch [gnuarch] | |
22 - Bazaar [bzr] | |
23 - Perforce [p4] | |
24 | |
25 Accepted destination formats [identifiers]: | |
26 | |
27 - Mercurial [hg] | |
28 - Subversion [svn] (history on branches is not preserved) | |
29 | |
30 If no revision is given, all revisions will be converted. Otherwise, | |
31 convert will only import up to the named revision (given in a format | |
32 understood by the source). | |
33 | |
34 If no destination directory name is specified, it defaults to the basename | |
35 of the source with "-hg" appended. If the destination repository doesn't | |
36 exist, it will be created. | |
37 | |
38 By default, all sources except Mercurial will use --branchsort. Mercurial | |
39 uses --sourcesort to preserve original revision numbers order. Sort modes | |
40 have the following effects: | |
41 | |
42 --branchsort convert from parent to child revision when possible, which | |
13011
4936a04b6792
minirst: improved support for option lists.
Erik Zielke <ez@aragost.com>
parents:
12924
diff
changeset
|
43 means branches are usually converted one after the other. |
4936a04b6792
minirst: improved support for option lists.
Erik Zielke <ez@aragost.com>
parents:
12924
diff
changeset
|
44 It generates more compact repositories. |
12510 | 45 --datesort sort revisions by date. Converted repositories have good- |
46 looking changelogs but are often an order of magnitude | |
47 larger than the same ones generated by --branchsort. | |
48 --sourcesort try to preserve source revisions order, only supported by | |
49 Mercurial sources. | |
50 | |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
51 If "REVMAP" isn't given, it will be put in a default location |
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
52 ("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that |
12510 | 53 maps each source commit ID to the destination ID for that revision, like |
54 so: | |
55 | |
56 <source ID> <destination ID> | |
57 | |
58 If the file doesn't exist, it's automatically created. It's updated on | |
59 each commit copied, so "hg convert" can be interrupted and can be run | |
60 repeatedly to copy new commits. | |
61 | |
62 The authormap is a simple text file that maps each source commit author to | |
63 a destination commit author. It is handy for source SCMs that use unix | |
64 logins to identify authors (eg: CVS). One line per author mapping and the | |
65 line format is: | |
66 | |
67 source author = destination author | |
68 | |
69 Empty lines and lines starting with a "#" are ignored. | |
70 | |
71 The filemap is a file that allows filtering and remapping of files and | |
72 directories. Each line can contain one of the following directives: | |
73 | |
74 include path/to/file-or-dir | |
75 | |
76 exclude path/to/file-or-dir | |
77 | |
78 rename path/to/source path/to/destination | |
79 | |
80 Comment lines start with "#". A specified path matches if it equals the | |
81 full relative name of a file or one of its parent directories. The | |
82 "include" or "exclude" directive with the longest matching path applies, | |
83 so line order does not matter. | |
84 | |
85 The "include" directive causes a file, or all files under a directory, to | |
86 be included in the destination repository, and the exclusion of all other | |
87 files and directories not explicitly included. The "exclude" directive | |
88 causes files or directories to be omitted. The "rename" directive renames | |
89 a file or directory if it is converted. To rename from a subdirectory into | |
90 the root of the repository, use "." as the path to rename to. | |
91 | |
92 The splicemap is a file that allows insertion of synthetic history, | |
93 letting you specify the parents of a revision. This is useful if you want | |
94 to e.g. give a Subversion merge two parents, or graft two disconnected | |
95 series of history together. Each entry contains a key, followed by a | |
96 space, followed by one or two comma-separated values: | |
97 | |
98 key parent1, parent2 | |
99 | |
100 The key is the revision ID in the source revision control system whose | |
101 parents should be modified (same format as a key in .hg/shamap). The | |
102 values are the revision IDs (in either the source or destination revision | |
103 control system) that should be used as the new parents for that node. For | |
104 example, if you have merged "release-1.0" into "trunk", then you should | |
105 specify the revision on "trunk" as the first parent and the one on the | |
106 "release-1.0" branch as the second. | |
107 | |
108 The branchmap is a file that allows you to rename a branch when it is | |
109 being brought in from whatever external repository. When used in | |
110 conjunction with a splicemap, it allows for a powerful combination to help | |
111 fix even the most badly mismanaged repositories and turn them into nicely | |
112 structured Mercurial repositories. The branchmap contains lines of the | |
113 form: | |
114 | |
115 original_branch_name new_branch_name | |
116 | |
117 where "original_branch_name" is the name of the branch in the source | |
118 repository, and "new_branch_name" is the name of the branch is the | |
119 destination repository. No whitespace is allowed in the branch names. This | |
120 can be used to (for instance) move code in one repository from "default" | |
121 to a named branch. | |
122 | |
123 Mercurial Source | |
12787
e8a8993b625e
tests: fix up changed output
Matt Mackall <mpm@selenic.com>
parents:
12510
diff
changeset
|
124 '''''''''''''''' |
12510 | 125 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
126 The Mercurial source recognizes the following configuration options, which |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
127 you can set on the command line with "--config": |
12510 | 128 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
129 convert.hg.ignoreerrors |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
130 ignore integrity errors when reading. Use it to fix Mercurial |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
131 repositories with missing revlogs, by converting from and to |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
132 Mercurial. Default is False. |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
133 convert.hg.saverev |
13431
69c773750055
test-convert: update output to match 0079fb98e8d0
Martin Geisler <mg@aragost.com>
parents:
13389
diff
changeset
|
134 store original revision ID in changeset (forces target IDs to |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
135 change). It takes and boolean argument and defaults to False. |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
136 convert.hg.startrev |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
137 convert start revision and its descendants. It takes a hg |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
138 revision identifier and defaults to 0. |
12510 | 139 |
140 CVS Source | |
12787
e8a8993b625e
tests: fix up changed output
Matt Mackall <mpm@selenic.com>
parents:
12510
diff
changeset
|
141 '''''''''' |
12510 | 142 |
143 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to | |
144 indicate the starting point of what will be converted. Direct access to | |
145 the repository files is not needed, unless of course the repository is | |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
146 ":local:". The conversion uses the top level directory in the sandbox to |
12510 | 147 find the CVS repository, and then uses CVS rlog commands to find files to |
148 convert. This means that unless a filemap is given, all files under the | |
149 starting directory will be converted, and that any directory | |
150 reorganization in the CVS sandbox is ignored. | |
151 | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
152 The following options can be used with "--config": |
12510 | 153 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
154 convert.cvsps.cache |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
155 Set to False to disable remote log caching, for testing and |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
156 debugging purposes. Default is True. |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
157 convert.cvsps.fuzz |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
158 Specify the maximum time (in seconds) that is allowed between |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
159 commits with identical user and log message in a single |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
160 changeset. When very large files were checked in as part of a |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
161 changeset then the default may not be long enough. The default |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
162 is 60. |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
163 convert.cvsps.mergeto |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
164 Specify a regular expression to which commit log messages are |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
165 matched. If a match occurs, then the conversion process will |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
166 insert a dummy revision merging the branch on which this log |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
167 message occurs to the branch indicated in the regex. Default |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
168 is "{{mergetobranch ([-\w]+)}}" |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
169 convert.cvsps.mergefrom |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
170 Specify a regular expression to which commit log messages are |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
171 matched. If a match occurs, then the conversion process will |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
172 add the most recent revision on the branch indicated in the |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
173 regex as the second parent of the changeset. Default is |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
174 "{{mergefrombranch ([-\w]+)}}" |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
175 hook.cvslog |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
176 Specify a Python function to be called at the end of gathering |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
177 the CVS log. The function is passed a list with the log |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
178 entries, and can modify the entries in-place, or add or delete |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
179 them. |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
180 hook.cvschangesets |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
181 Specify a Python function to be called after the changesets |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
182 are calculated from the the CVS log. The function is passed a |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
183 list with the changeset entries, and can modify the changesets |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
184 in-place, or add or delete them. |
12510 | 185 |
186 An additional "debugcvsps" Mercurial command allows the builtin changeset | |
187 merging code to be run without doing a conversion. Its parameters and | |
188 output are similar to that of cvsps 2.1. Please see the command help for | |
189 more details. | |
190 | |
191 Subversion Source | |
12787
e8a8993b625e
tests: fix up changed output
Matt Mackall <mpm@selenic.com>
parents:
12510
diff
changeset
|
192 ''''''''''''''''' |
12510 | 193 |
194 Subversion source detects classical trunk/branches/tags layouts. By | |
195 default, the supplied "svn://repo/path/" source URL is converted as a | |
196 single branch. If "svn://repo/path/trunk" exists it replaces the default | |
197 branch. If "svn://repo/path/branches" exists, its subdirectories are | |
198 listed as possible branches. If "svn://repo/path/tags" exists, it is | |
199 looked for tags referencing converted branches. Default "trunk", | |
200 "branches" and "tags" values can be overridden with following options. Set | |
201 them to paths relative to the source URL, or leave them blank to disable | |
202 auto detection. | |
203 | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
204 The following options can be set with "--config": |
12510 | 205 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
206 convert.svn.branches |
13494
3178aca36b0f
convert.svn: branch name which equals trunk means `default' branch (issue2653)
Pavel Boldin <boldin.pavel@gmail.com>
parents:
13431
diff
changeset
|
207 specify the directory containing branches. The default is |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
208 "branches". |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
209 convert.svn.tags |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
210 specify the directory containing tags. The default is "tags". |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
211 convert.svn.trunk |
13494
3178aca36b0f
convert.svn: branch name which equals trunk means `default' branch (issue2653)
Pavel Boldin <boldin.pavel@gmail.com>
parents:
13431
diff
changeset
|
212 specify the name of the trunk branch. The default is "trunk". |
12510 | 213 |
214 Source history can be retrieved starting at a specific revision, instead | |
215 of being integrally converted. Only single branch conversions are | |
216 supported. | |
217 | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
218 convert.svn.startrev |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
219 specify start Subversion revision number. The default is 0. |
12510 | 220 |
221 Perforce Source | |
12787
e8a8993b625e
tests: fix up changed output
Matt Mackall <mpm@selenic.com>
parents:
12510
diff
changeset
|
222 ''''''''''''''' |
12510 | 223 |
224 The Perforce (P4) importer can be given a p4 depot path or a client | |
225 specification as source. It will convert all files in the source to a flat | |
226 Mercurial repository, ignoring labels, branches and integrations. Note | |
227 that when a depot path is given you then usually should specify a target | |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
228 directory, because otherwise the target may be named "...-hg". |
12510 | 229 |
230 It is possible to limit the amount of source history to be converted by | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
231 specifying an initial Perforce revision: |
12510 | 232 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
233 convert.p4.startrev |
13431
69c773750055
test-convert: update output to match 0079fb98e8d0
Martin Geisler <mg@aragost.com>
parents:
13389
diff
changeset
|
234 specify initial Perforce revision (a Perforce changelist |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
235 number). |
12510 | 236 |
237 Mercurial Destination | |
12787
e8a8993b625e
tests: fix up changed output
Matt Mackall <mpm@selenic.com>
parents:
12510
diff
changeset
|
238 ''''''''''''''''''''' |
12510 | 239 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
240 The following options are supported: |
12510 | 241 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
242 convert.hg.clonebranches |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
243 dispatch source branches in separate clones. The default is |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
244 False. |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
245 convert.hg.tagsbranch |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
246 branch name for tag revisions, defaults to "default". |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
247 convert.hg.usebranchnames |
13431
69c773750055
test-convert: update output to match 0079fb98e8d0
Martin Geisler <mg@aragost.com>
parents:
13389
diff
changeset
|
248 preserve branch names. The default is True. |
12510 | 249 |
250 options: | |
251 | |
252 -s --source-type TYPE source repository type | |
253 -d --dest-type TYPE destination repository type | |
254 -r --rev REV import up to target revision REV | |
255 -A --authormap FILE remap usernames using this file | |
256 --filemap FILE remap file names using contents of file | |
257 --splicemap FILE splice synthesized history into place | |
258 --branchmap FILE change branch names while converting | |
259 --branchsort try to sort changesets by branches | |
260 --datesort try to sort changesets by date | |
261 --sourcesort preserve source changesets order | |
262 | |
263 use "hg -v help convert" to show global options | |
264 $ hg init a | |
265 $ cd a | |
266 $ echo a > a | |
267 $ hg ci -d'0 0' -Ama | |
268 adding a | |
269 $ hg cp a b | |
270 $ hg ci -d'1 0' -mb | |
271 $ hg rm a | |
272 $ hg ci -d'2 0' -mc | |
273 $ hg mv b a | |
274 $ hg ci -d'3 0' -md | |
275 $ echo a >> a | |
276 $ hg ci -d'4 0' -me | |
277 $ cd .. | |
278 $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded' | |
279 assuming destination a-hg | |
280 initializing destination a-hg repository | |
281 scanning source... | |
282 sorting... | |
283 converting... | |
284 4 a | |
285 3 b | |
286 2 c | |
287 1 d | |
288 0 e | |
289 $ hg --cwd a-hg pull ../a | |
290 pulling from ../a | |
291 searching for changes | |
292 no changes found | |
293 $ touch bogusfile | |
7905
d596b1f2935a
convert: missing p4 tool is only slightly fatal
Mads Kiilerich <mads@kiilerich.com>
parents:
5805
diff
changeset
|
294 |
12510 | 295 should fail |
296 | |
297 $ hg convert a bogusfile | |
298 initializing destination bogusfile repository | |
299 abort: cannot create new bundle repository | |
300 [255] | |
301 $ mkdir bogusdir | |
302 $ chmod 000 bogusdir | |
303 | |
304 should fail | |
305 | |
306 $ hg convert a bogusdir | |
307 abort: Permission denied: bogusdir | |
308 [255] | |
309 | |
310 should succeed | |
9962
a7178eccf2dc
convert: better error on invalid repository type
Patrick Mezard <pmezard@gmail.com>
parents:
8674
diff
changeset
|
311 |
12510 | 312 $ chmod 700 bogusdir |
313 $ hg convert a bogusdir | |
314 initializing destination bogusdir repository | |
315 scanning source... | |
316 sorting... | |
317 converting... | |
318 4 a | |
319 3 b | |
320 2 c | |
321 1 d | |
322 0 e | |
323 | |
324 test pre and post conversion actions | |
325 | |
326 $ echo 'include b' > filemap | |
327 $ hg convert --debug --filemap filemap a partialb | \ | |
328 > grep 'run hg' | |
329 run hg source pre-conversion action | |
330 run hg sink pre-conversion action | |
331 run hg sink post-conversion action | |
332 run hg source post-conversion action | |
333 | |
334 converting empty dir should fail "nicely | |
335 | |
336 $ mkdir emptydir | |
337 | |
338 override $PATH to ensure p4 not visible; use $PYTHON in case we're | |
339 running from a devel copy, not a temp installation | |
9962
a7178eccf2dc
convert: better error on invalid repository type
Patrick Mezard <pmezard@gmail.com>
parents:
8674
diff
changeset
|
340 |
12510 | 341 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir |
342 assuming destination emptydir-hg | |
343 initializing destination emptydir-hg repository | |
344 emptydir does not look like a CVS checkout | |
345 emptydir does not look like a Git repository | |
346 emptydir does not look like a Subversion repository | |
347 emptydir is not a local Mercurial repository | |
348 emptydir does not look like a darcs repository | |
349 emptydir does not look like a monotone repository | |
350 emptydir does not look like a GNU Arch repository | |
351 emptydir does not look like a Bazaar repository | |
352 cannot find required "p4" tool | |
353 abort: emptydir: missing or unsupported repository | |
354 [255] | |
355 | |
356 convert with imaginary source type | |
357 | |
358 $ hg convert --source-type foo a a-foo | |
359 initializing destination a-foo repository | |
360 abort: foo: invalid source repository type | |
361 [255] | |
362 | |
363 convert with imaginary sink type | |
10577
d5bd1beff794
store: only add new entries to the fncache file
Adrian Buehlmann <adrian@cadifra.com>
parents:
9962
diff
changeset
|
364 |
12510 | 365 $ hg convert --dest-type foo a a-foo |
366 abort: foo: invalid destination repository type | |
367 [255] | |
368 | |
369 testing: convert must not produce duplicate entries in fncache | |
10885
9e4d120e3c32
convert/subversion: fix default URL checker prototype
Patrick Mezard <pmezard@gmail.com>
parents:
10775
diff
changeset
|
370 |
12510 | 371 $ hg convert a b |
372 initializing destination b repository | |
373 scanning source... | |
374 sorting... | |
375 converting... | |
376 4 a | |
377 3 b | |
378 2 c | |
379 1 d | |
380 0 e | |
381 | |
382 contents of fncache file: | |
383 | |
13389
3efc99ac2ac4
tests: sort fncache
Adrian Buehlmann <adrian@cadifra.com>
parents:
13011
diff
changeset
|
384 $ cat b/.hg/store/fncache | sort |
12510 | 385 data/a.i |
386 data/b.i | |
387 | |
388 test bogus URL | |
389 | |
390 $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz | |
391 abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository | |
392 [255] |