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