##// END OF EJS Templates
tests: fix test for convert detection of p4 repos
Dirkjan Ochtman -
r8844:d2ef4f2b default
parent child Browse files
Show More
@@ -1,275 +1,275 b''
1 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
1 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
2
2
3 convert a foreign SCM repository to a Mercurial one.
3 convert a foreign SCM repository to a Mercurial one.
4
4
5 Accepted source formats [identifiers]:
5 Accepted source formats [identifiers]:
6 - Mercurial [hg]
6 - Mercurial [hg]
7 - CVS [cvs]
7 - CVS [cvs]
8 - Darcs [darcs]
8 - Darcs [darcs]
9 - git [git]
9 - git [git]
10 - Subversion [svn]
10 - Subversion [svn]
11 - Monotone [mtn]
11 - Monotone [mtn]
12 - GNU Arch [gnuarch]
12 - GNU Arch [gnuarch]
13 - Bazaar [bzr]
13 - Bazaar [bzr]
14 - Perforce [p4]
14 - Perforce [p4]
15
15
16 Accepted destination formats [identifiers]:
16 Accepted destination formats [identifiers]:
17 - Mercurial [hg]
17 - Mercurial [hg]
18 - Subversion [svn] (history on branches is not preserved)
18 - Subversion [svn] (history on branches is not preserved)
19
19
20 If no revision is given, all revisions will be converted.
20 If no revision is given, all revisions will be converted.
21 Otherwise, convert will only import up to the named revision
21 Otherwise, convert will only import up to the named revision
22 (given in a format understood by the source).
22 (given in a format understood by the source).
23
23
24 If no destination directory name is specified, it defaults to the
24 If no destination directory name is specified, it defaults to the
25 basename of the source with '-hg' appended. If the destination
25 basename of the source with '-hg' appended. If the destination
26 repository doesn't exist, it will be created.
26 repository doesn't exist, it will be created.
27
27
28 By default, all sources except Mercurial will use
28 By default, all sources except Mercurial will use
29 --branchsort. Mercurial uses --sourcesort to preserve original
29 --branchsort. Mercurial uses --sourcesort to preserve original
30 revision numbers order. Sort modes have the following effects:
30 revision numbers order. Sort modes have the following effects:
31 --branchsort: convert from parent to child revision when
31 --branchsort: convert from parent to child revision when
32 possible, which means branches are usually converted one after
32 possible, which means branches are usually converted one after
33 the other. It generates more compact repositories.
33 the other. It generates more compact repositories.
34 --datesort: sort revisions by date. Converted repositories have
34 --datesort: sort revisions by date. Converted repositories have
35 good-looking changelogs but are often an order of magnitude
35 good-looking changelogs but are often an order of magnitude
36 larger than the same ones generated by --branchsort.
36 larger than the same ones generated by --branchsort.
37 --sourcesort: try to preserve source revisions order, only
37 --sourcesort: try to preserve source revisions order, only
38 supported by Mercurial sources.
38 supported by Mercurial sources.
39
39
40 If <REVMAP> isn't given, it will be put in a default location
40 If <REVMAP> isn't given, it will be put in a default location
41 (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file
41 (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file
42 that maps each source commit ID to the destination ID for that
42 that maps each source commit ID to the destination ID for that
43 revision, like so:
43 revision, like so:
44 <source ID> <destination ID>
44 <source ID> <destination ID>
45
45
46 If the file doesn't exist, it's automatically created. It's
46 If the file doesn't exist, it's automatically created. It's
47 updated on each commit copied, so convert-repo can be interrupted
47 updated on each commit copied, so convert-repo can be interrupted
48 and can be run repeatedly to copy new commits.
48 and can be run repeatedly to copy new commits.
49
49
50 The [username mapping] file is a simple text file that maps each
50 The [username mapping] file is a simple text file that maps each
51 source commit author to a destination commit author. It is handy
51 source commit author to a destination commit author. It is handy
52 for source SCMs that use unix logins to identify authors (eg:
52 for source SCMs that use unix logins to identify authors (eg:
53 CVS). One line per author mapping and the line format is:
53 CVS). One line per author mapping and the line format is:
54 srcauthor=whatever string you want
54 srcauthor=whatever string you want
55
55
56 The filemap is a file that allows filtering and remapping of files
56 The filemap is a file that allows filtering and remapping of files
57 and directories. Comment lines start with '#'. Each line can
57 and directories. Comment lines start with '#'. Each line can
58 contain one of the following directives:
58 contain one of the following directives:
59
59
60 include path/to/file
60 include path/to/file
61
61
62 exclude path/to/file
62 exclude path/to/file
63
63
64 rename from/file to/file
64 rename from/file to/file
65
65
66 The 'include' directive causes a file, or all files under a
66 The 'include' directive causes a file, or all files under a
67 directory, to be included in the destination repository, and the
67 directory, to be included in the destination repository, and the
68 exclusion of all other files and directories not explicitly included.
68 exclusion of all other files and directories not explicitly included.
69 The 'exclude' directive causes files or directories to be omitted.
69 The 'exclude' directive causes files or directories to be omitted.
70 The 'rename' directive renames a file or directory. To rename from
70 The 'rename' directive renames a file or directory. To rename from
71 a subdirectory into the root of the repository, use '.' as the
71 a subdirectory into the root of the repository, use '.' as the
72 path to rename to.
72 path to rename to.
73
73
74 The splicemap is a file that allows insertion of synthetic
74 The splicemap is a file that allows insertion of synthetic
75 history, letting you specify the parents of a revision. This is
75 history, letting you specify the parents of a revision. This is
76 useful if you want to e.g. give a Subversion merge two parents, or
76 useful if you want to e.g. give a Subversion merge two parents, or
77 graft two disconnected series of history together. Each entry
77 graft two disconnected series of history together. Each entry
78 contains a key, followed by a space, followed by one or two
78 contains a key, followed by a space, followed by one or two
79 comma-separated values. The key is the revision ID in the source
79 comma-separated values. The key is the revision ID in the source
80 revision control system whose parents should be modified (same
80 revision control system whose parents should be modified (same
81 format as a key in .hg/shamap). The values are the revision IDs
81 format as a key in .hg/shamap). The values are the revision IDs
82 (in either the source or destination revision control system) that
82 (in either the source or destination revision control system) that
83 should be used as the new parents for that node.
83 should be used as the new parents for that node.
84
84
85 The branchmap is a file that allows you to rename a branch when it is
85 The branchmap is a file that allows you to rename a branch when it is
86 being brought in from whatever external repository. When used in
86 being brought in from whatever external repository. When used in
87 conjunction with a splicemap, it allows for a powerful combination
87 conjunction with a splicemap, it allows for a powerful combination
88 to help fix even the most badly mismanaged repositories and turn them
88 to help fix even the most badly mismanaged repositories and turn them
89 into nicely structured Mercurial repositories. The branchmap contains
89 into nicely structured Mercurial repositories. The branchmap contains
90 lines of the form "original_branch_name new_branch_name".
90 lines of the form "original_branch_name new_branch_name".
91 "original_branch_name" is the name of the branch in the source
91 "original_branch_name" is the name of the branch in the source
92 repository, and "new_branch_name" is the name of the branch is the
92 repository, and "new_branch_name" is the name of the branch is the
93 destination repository. This can be used to (for instance) move code
93 destination repository. This can be used to (for instance) move code
94 in one repository from "default" to a named branch.
94 in one repository from "default" to a named branch.
95
95
96 Mercurial Source
96 Mercurial Source
97 -----------------
97 -----------------
98
98
99 --config convert.hg.ignoreerrors=False (boolean)
99 --config convert.hg.ignoreerrors=False (boolean)
100 ignore integrity errors when reading. Use it to fix Mercurial
100 ignore integrity errors when reading. Use it to fix Mercurial
101 repositories with missing revlogs, by converting from and to
101 repositories with missing revlogs, by converting from and to
102 Mercurial.
102 Mercurial.
103 --config convert.hg.saverev=False (boolean)
103 --config convert.hg.saverev=False (boolean)
104 store original revision ID in changeset (forces target IDs to
104 store original revision ID in changeset (forces target IDs to
105 change)
105 change)
106 --config convert.hg.startrev=0 (hg revision identifier)
106 --config convert.hg.startrev=0 (hg revision identifier)
107 convert start revision and its descendants
107 convert start revision and its descendants
108
108
109 CVS Source
109 CVS Source
110 ----------
110 ----------
111
111
112 CVS source will use a sandbox (i.e. a checked-out copy) from CVS
112 CVS source will use a sandbox (i.e. a checked-out copy) from CVS
113 to indicate the starting point of what will be converted. Direct
113 to indicate the starting point of what will be converted. Direct
114 access to the repository files is not needed, unless of course the
114 access to the repository files is not needed, unless of course the
115 repository is :local:. The conversion uses the top level directory
115 repository is :local:. The conversion uses the top level directory
116 in the sandbox to find the CVS repository, and then uses CVS rlog
116 in the sandbox to find the CVS repository, and then uses CVS rlog
117 commands to find files to convert. This means that unless a
117 commands to find files to convert. This means that unless a
118 filemap is given, all files under the starting directory will be
118 filemap is given, all files under the starting directory will be
119 converted, and that any directory reorganization in the CVS
119 converted, and that any directory reorganization in the CVS
120 sandbox is ignored.
120 sandbox is ignored.
121
121
122 Because CVS does not have changesets, it is necessary to collect
122 Because CVS does not have changesets, it is necessary to collect
123 individual commits to CVS and merge them into changesets. CVS
123 individual commits to CVS and merge them into changesets. CVS
124 source uses its internal changeset merging code by default but can
124 source uses its internal changeset merging code by default but can
125 be configured to call the external 'cvsps' program by setting:
125 be configured to call the external 'cvsps' program by setting:
126 --config convert.cvsps='cvsps -A -u --cvs-direct -q'
126 --config convert.cvsps='cvsps -A -u --cvs-direct -q'
127 This option is deprecated and will be removed in Mercurial 1.4.
127 This option is deprecated and will be removed in Mercurial 1.4.
128
128
129 The options shown are the defaults.
129 The options shown are the defaults.
130
130
131 Internal cvsps is selected by setting
131 Internal cvsps is selected by setting
132 --config convert.cvsps=builtin
132 --config convert.cvsps=builtin
133 and has a few more configurable options:
133 and has a few more configurable options:
134 --config convert.cvsps.cache=True (boolean)
134 --config convert.cvsps.cache=True (boolean)
135 Set to False to disable remote log caching, for testing and
135 Set to False to disable remote log caching, for testing and
136 debugging purposes.
136 debugging purposes.
137 --config convert.cvsps.fuzz=60 (integer)
137 --config convert.cvsps.fuzz=60 (integer)
138 Specify the maximum time (in seconds) that is allowed
138 Specify the maximum time (in seconds) that is allowed
139 between commits with identical user and log message in a
139 between commits with identical user and log message in a
140 single changeset. When very large files were checked in as
140 single changeset. When very large files were checked in as
141 part of a changeset then the default may not be long
141 part of a changeset then the default may not be long
142 enough.
142 enough.
143 --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}'
143 --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}'
144 Specify a regular expression to which commit log messages
144 Specify a regular expression to which commit log messages
145 are matched. If a match occurs, then the conversion
145 are matched. If a match occurs, then the conversion
146 process will insert a dummy revision merging the branch on
146 process will insert a dummy revision merging the branch on
147 which this log message occurs to the branch indicated in
147 which this log message occurs to the branch indicated in
148 the regex.
148 the regex.
149 --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}'
149 --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}'
150 Specify a regular expression to which commit log messages
150 Specify a regular expression to which commit log messages
151 are matched. If a match occurs, then the conversion
151 are matched. If a match occurs, then the conversion
152 process will add the most recent revision on the branch
152 process will add the most recent revision on the branch
153 indicated in the regex as the second parent of the
153 indicated in the regex as the second parent of the
154 changeset.
154 changeset.
155
155
156 The hgext/convert/cvsps wrapper script allows the builtin
156 The hgext/convert/cvsps wrapper script allows the builtin
157 changeset merging code to be run without doing a conversion. Its
157 changeset merging code to be run without doing a conversion. Its
158 parameters and output are similar to that of cvsps 2.1.
158 parameters and output are similar to that of cvsps 2.1.
159
159
160 Subversion Source
160 Subversion Source
161 -----------------
161 -----------------
162
162
163 Subversion source detects classical trunk/branches/tags layouts.
163 Subversion source detects classical trunk/branches/tags layouts.
164 By default, the supplied "svn://repo/path/" source URL is
164 By default, the supplied "svn://repo/path/" source URL is
165 converted as a single branch. If "svn://repo/path/trunk" exists it
165 converted as a single branch. If "svn://repo/path/trunk" exists it
166 replaces the default branch. If "svn://repo/path/branches" exists,
166 replaces the default branch. If "svn://repo/path/branches" exists,
167 its subdirectories are listed as possible branches. If
167 its subdirectories are listed as possible branches. If
168 "svn://repo/path/tags" exists, it is looked for tags referencing
168 "svn://repo/path/tags" exists, it is looked for tags referencing
169 converted branches. Default "trunk", "branches" and "tags" values
169 converted branches. Default "trunk", "branches" and "tags" values
170 can be overridden with following options. Set them to paths
170 can be overridden with following options. Set them to paths
171 relative to the source URL, or leave them blank to disable auto
171 relative to the source URL, or leave them blank to disable auto
172 detection.
172 detection.
173
173
174 --config convert.svn.branches=branches (directory name)
174 --config convert.svn.branches=branches (directory name)
175 specify the directory containing branches
175 specify the directory containing branches
176 --config convert.svn.tags=tags (directory name)
176 --config convert.svn.tags=tags (directory name)
177 specify the directory containing tags
177 specify the directory containing tags
178 --config convert.svn.trunk=trunk (directory name)
178 --config convert.svn.trunk=trunk (directory name)
179 specify the name of the trunk branch
179 specify the name of the trunk branch
180
180
181 Source history can be retrieved starting at a specific revision,
181 Source history can be retrieved starting at a specific revision,
182 instead of being integrally converted. Only single branch
182 instead of being integrally converted. Only single branch
183 conversions are supported.
183 conversions are supported.
184
184
185 --config convert.svn.startrev=0 (svn revision number)
185 --config convert.svn.startrev=0 (svn revision number)
186 specify start Subversion revision.
186 specify start Subversion revision.
187
187
188 Perforce Source
188 Perforce Source
189 ---------------
189 ---------------
190
190
191 The Perforce (P4) importer can be given a p4 depot path or a
191 The Perforce (P4) importer can be given a p4 depot path or a
192 client specification as source. It will convert all files in the
192 client specification as source. It will convert all files in the
193 source to a flat Mercurial repository, ignoring labels, branches
193 source to a flat Mercurial repository, ignoring labels, branches
194 and integrations. Note that when a depot path is given you then
194 and integrations. Note that when a depot path is given you then
195 usually should specify a target directory, because otherwise the
195 usually should specify a target directory, because otherwise the
196 target may be named ...-hg.
196 target may be named ...-hg.
197
197
198 It is possible to limit the amount of source history to be
198 It is possible to limit the amount of source history to be
199 converted by specifying an initial Perforce revision.
199 converted by specifying an initial Perforce revision.
200
200
201 --config convert.p4.startrev=0 (perforce changelist number)
201 --config convert.p4.startrev=0 (perforce changelist number)
202 specify initial Perforce revision.
202 specify initial Perforce revision.
203
203
204
204
205 Mercurial Destination
205 Mercurial Destination
206 ---------------------
206 ---------------------
207
207
208 --config convert.hg.clonebranches=False (boolean)
208 --config convert.hg.clonebranches=False (boolean)
209 dispatch source branches in separate clones.
209 dispatch source branches in separate clones.
210 --config convert.hg.tagsbranch=default (branch name)
210 --config convert.hg.tagsbranch=default (branch name)
211 tag revisions branch name
211 tag revisions branch name
212 --config convert.hg.usebranchnames=True (boolean)
212 --config convert.hg.usebranchnames=True (boolean)
213 preserve branch names
213 preserve branch names
214
214
215 options:
215 options:
216
216
217 -A --authors username mapping filename
217 -A --authors username mapping filename
218 -d --dest-type destination repository type
218 -d --dest-type destination repository type
219 --filemap remap file names using contents of file
219 --filemap remap file names using contents of file
220 -r --rev import up to target revision REV
220 -r --rev import up to target revision REV
221 -s --source-type source repository type
221 -s --source-type source repository type
222 --splicemap splice synthesized history into place
222 --splicemap splice synthesized history into place
223 --branchmap change branch names while converting
223 --branchmap change branch names while converting
224 --branchsort try to sort changesets by branches
224 --branchsort try to sort changesets by branches
225 --datesort try to sort changesets by date
225 --datesort try to sort changesets by date
226 --sourcesort preserve source changesets order
226 --sourcesort preserve source changesets order
227
227
228 use "hg -v help convert" to show global options
228 use "hg -v help convert" to show global options
229 adding a
229 adding a
230 assuming destination a-hg
230 assuming destination a-hg
231 initializing destination a-hg repository
231 initializing destination a-hg repository
232 scanning source...
232 scanning source...
233 sorting...
233 sorting...
234 converting...
234 converting...
235 4 a
235 4 a
236 3 b
236 3 b
237 2 c
237 2 c
238 1 d
238 1 d
239 0 e
239 0 e
240 pulling from ../a
240 pulling from ../a
241 searching for changes
241 searching for changes
242 no changes found
242 no changes found
243 % should fail
243 % should fail
244 initializing destination bogusfile repository
244 initializing destination bogusfile repository
245 abort: cannot create new bundle repository
245 abort: cannot create new bundle repository
246 % should fail
246 % should fail
247 abort: Permission denied: bogusdir
247 abort: Permission denied: bogusdir
248 % should succeed
248 % should succeed
249 initializing destination bogusdir repository
249 initializing destination bogusdir repository
250 scanning source...
250 scanning source...
251 sorting...
251 sorting...
252 converting...
252 converting...
253 4 a
253 4 a
254 3 b
254 3 b
255 2 c
255 2 c
256 1 d
256 1 d
257 0 e
257 0 e
258 % test pre and post conversion actions
258 % test pre and post conversion actions
259 run hg source pre-conversion action
259 run hg source pre-conversion action
260 run hg sink pre-conversion action
260 run hg sink pre-conversion action
261 run hg sink post-conversion action
261 run hg sink post-conversion action
262 run hg source post-conversion action
262 run hg source post-conversion action
263 % converting empty dir should fail nicely
263 % converting empty dir should fail nicely
264 assuming destination emptydir-hg
264 assuming destination emptydir-hg
265 initializing destination emptydir-hg repository
265 initializing destination emptydir-hg repository
266 emptydir does not look like a CVS checkout
266 emptydir does not look like a CVS checkout
267 emptydir does not look like a Git repo
267 emptydir does not look like a Git repo
268 emptydir does not look like a Subversion repo
268 emptydir does not look like a Subversion repo
269 emptydir is not a local Mercurial repo
269 emptydir is not a local Mercurial repo
270 emptydir does not look like a darcs repo
270 emptydir does not look like a darcs repo
271 emptydir does not look like a monotone repo
271 emptydir does not look like a monotone repo
272 emptydir does not look like a GNU Arch repo
272 emptydir does not look like a GNU Arch repo
273 emptydir does not look like a Bazaar repo
273 emptydir does not look like a Bazaar repo
274 emptydir does not look like a P4 repo
274 cannot find required "p4" tool
275 abort: emptydir: missing or unsupported repository
275 abort: emptydir: missing or unsupported repository
General Comments 0
You need to be logged in to leave comments. Login now