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