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