Show More
@@ -35,48 +35,50 b' def convert(ui, src, dest=None, revmapfi' | |||||
35 | - Mercurial [hg] |
|
35 | - Mercurial [hg] | |
36 | - Subversion [svn] (history on branches is not preserved) |
|
36 | - Subversion [svn] (history on branches is not preserved) | |
37 |
|
37 | |||
38 |
If no revision is given, all revisions will be converted. |
|
38 | If no revision is given, all revisions will be converted. | |
39 |
convert will only import up to the named revision |
|
39 | Otherwise, convert will only import up to the named revision | |
40 | understood by the source). |
|
40 | (given in a format understood by the source). | |
41 |
|
41 | |||
42 |
If no destination directory name is specified, it defaults to the |
|
42 | If no destination directory name is specified, it defaults to the | |
43 |
of the source with '-hg' appended. If the destination |
|
43 | basename of the source with '-hg' appended. If the destination | |
44 | exist, it will be created. |
|
44 | repository doesn't exist, it will be created. | |
45 |
|
45 | |||
46 |
By default, all sources except Mercurial will use --branchsort. |
|
46 | By default, all sources except Mercurial will use --branchsort. | |
47 |
uses --sourcesort to preserve original revision numbers |
|
47 | Mercurial uses --sourcesort to preserve original revision numbers | |
48 | have the following effects: |
|
48 | order. Sort modes have the following effects: | |
49 |
|
49 | |||
50 |
--branchsort convert from parent to child revision when possible, |
|
50 | --branchsort convert from parent to child revision when possible, | |
51 |
means branches are usually converted one after |
|
51 | which means branches are usually converted one after | |
52 | generates more compact repositories. |
|
52 | the other. It generates more compact repositories. | |
53 |
|
53 | |||
54 | --datesort sort revisions by date. Converted repositories have |
|
54 | --datesort sort revisions by date. Converted repositories have | |
55 |
good-looking changelogs but are often an order of |
|
55 | good-looking changelogs but are often an order of | |
56 |
larger than the same ones generated by |
|
56 | magnitude larger than the same ones generated by | |
|
57 | --branchsort. | |||
57 |
|
58 | |||
58 |
--sourcesort try to preserve source revisions order, only |
|
59 | --sourcesort try to preserve source revisions order, only | |
59 | Mercurial sources. |
|
60 | supported by Mercurial sources. | |
60 |
|
61 | |||
61 | If <REVMAP> isn't given, it will be put in a default location |
|
62 | If <REVMAP> isn't given, it will be put in a default location | |
62 |
(<dest>/.hg/shamap by default). The <REVMAP> is a simple text file |
|
63 | (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file | |
63 |
maps each source commit ID to the destination ID for that |
|
64 | that maps each source commit ID to the destination ID for that | |
64 | so:: |
|
65 | revision, like so:: | |
65 |
|
66 | |||
66 | <source ID> <destination ID> |
|
67 | <source ID> <destination ID> | |
67 |
|
68 | |||
68 |
If the file doesn't exist, it's automatically created. It's |
|
69 | If the file doesn't exist, it's automatically created. It's | |
69 |
each commit copied, so convert-repo can be interrupted |
|
70 | updated on each commit copied, so convert-repo can be interrupted | |
70 | repeatedly to copy new commits. |
|
71 | and can be run repeatedly to copy new commits. | |
71 |
|
72 | |||
72 |
The [username mapping] file is a simple text file that maps each |
|
73 | The [username mapping] file is a simple text file that maps each | |
73 |
commit author to a destination commit author. It is handy |
|
74 | source commit author to a destination commit author. It is handy | |
74 |
that use unix logins to identify authors (eg: |
|
75 | for source SCMs that use unix logins to identify authors (eg: | |
75 | mapping and the line format is: srcauthor=whatever string you want |
|
76 | CVS). One line per author mapping and the line format is: | |
|
77 | srcauthor=whatever string you want | |||
76 |
|
78 | |||
77 |
The filemap is a file that allows filtering and remapping of files |
|
79 | The filemap is a file that allows filtering and remapping of files | |
78 |
directories. Comment lines start with '#'. Each line can |
|
80 | and directories. Comment lines start with '#'. Each line can | |
79 | the following directives:: |
|
81 | contain one of the following directives:: | |
80 |
|
82 | |||
81 | include path/to/file |
|
83 | include path/to/file | |
82 |
|
84 | |||
@@ -84,32 +86,35 b' def convert(ui, src, dest=None, revmapfi' | |||||
84 |
|
86 | |||
85 | rename from/file to/file |
|
87 | rename from/file to/file | |
86 |
|
88 | |||
87 |
The 'include' directive causes a file, or all files under a |
|
89 | The 'include' directive causes a file, or all files under a | |
88 |
be included in the destination repository, and the |
|
90 | directory, to be included in the destination repository, and the | |
89 | files and directories not explicitly included. The 'exclude' directive |
|
91 | exclusion of all other files and directories not explicitly | |
90 | causes files or directories to be omitted. The 'rename' directive renames |
|
92 | included. The 'exclude' directive causes files or directories to | |
91 | a file or directory. To rename from a subdirectory into the root of the |
|
93 | be omitted. The 'rename' directive renames a file or directory. To | |
92 | repository, use '.' as the path to rename to. |
|
94 | rename from a subdirectory into the root of the repository, use | |
|
95 | '.' as the path to rename to. | |||
93 |
|
96 | |||
94 |
The splicemap is a file that allows insertion of synthetic |
|
97 | The splicemap is a file that allows insertion of synthetic | |
95 |
letting you specify the parents of a revision. This is |
|
98 | history, letting you specify the parents of a revision. This is | |
96 |
to e.g. give a Subversion merge two parents, or |
|
99 | useful if you want to e.g. give a Subversion merge two parents, or | |
97 |
series of history together. Each entry |
|
100 | graft two disconnected series of history together. Each entry | |
98 | space, followed by one or two comma-separated values. The key is the |
|
101 | contains a key, followed by a space, followed by one or two | |
99 | revision ID in the source revision control system whose parents should be |
|
102 | comma-separated values. The key is the revision ID in the source | |
100 | modified (same format as a key in .hg/shamap). The values are the revision |
|
103 | revision control system whose parents should be modified (same | |
101 | IDs (in either the source or destination revision control system) that |
|
104 | format as a key in .hg/shamap). The values are the revision IDs | |
|
105 | (in either the source or destination revision control system) that | |||
102 | should be used as the new parents for that node. |
|
106 | should be used as the new parents for that node. | |
103 |
|
107 | |||
104 | The branchmap is a file that allows you to rename a branch when it is |
|
108 | The branchmap is a file that allows you to rename a branch when it is | |
105 | being brought in from whatever external repository. When used in |
|
109 | being brought in from whatever external repository. When used in | |
106 |
conjunction with a splicemap, it allows for a powerful combination |
|
110 | conjunction with a splicemap, it allows for a powerful combination | |
107 |
fix even the most badly mismanaged repositories and turn them |
|
111 | to help fix even the most badly mismanaged repositories and turn them | |
108 |
structured Mercurial repositories. The branchmap contains |
|
112 | into nicely structured Mercurial repositories. The branchmap contains | |
109 |
form "original_branch_name new_branch_name". |
|
113 | lines of the form "original_branch_name new_branch_name". | |
110 | name of the branch in the source repository, and "new_branch_name" is the |
|
114 | "original_branch_name" is the name of the branch in the source | |
111 | name of the branch is the destination repository. This can be used to (for |
|
115 | repository, and "new_branch_name" is the name of the branch is the | |
112 | instance) move code in one repository from "default" to a named branch. |
|
116 | destination repository. This can be used to (for instance) move code | |
|
117 | in one repository from "default" to a named branch. | |||
113 |
|
118 | |||
114 | Mercurial Source |
|
119 | Mercurial Source | |
115 | ---------------- |
|
120 | ---------------- | |
@@ -119,26 +124,28 b' def convert(ui, src, dest=None, revmapfi' | |||||
119 | repositories with missing revlogs, by converting from and to |
|
124 | repositories with missing revlogs, by converting from and to | |
120 | Mercurial. |
|
125 | Mercurial. | |
121 | --config convert.hg.saverev=False (boolean) |
|
126 | --config convert.hg.saverev=False (boolean) | |
122 |
store original revision ID in changeset (forces target IDs to |
|
127 | store original revision ID in changeset (forces target IDs to | |
|
128 | change) | |||
123 | --config convert.hg.startrev=0 (hg revision identifier) |
|
129 | --config convert.hg.startrev=0 (hg revision identifier) | |
124 | convert start revision and its descendants |
|
130 | convert start revision and its descendants | |
125 |
|
131 | |||
126 | CVS Source |
|
132 | CVS Source | |
127 | ---------- |
|
133 | ---------- | |
128 |
|
134 | |||
129 |
CVS source will use a sandbox (i.e. a checked-out copy) from CVS |
|
135 | CVS source will use a sandbox (i.e. a checked-out copy) from CVS | |
130 |
indicate the starting point of what will be converted. Direct |
|
136 | to indicate the starting point of what will be converted. Direct | |
131 |
the repository files is not needed, unless of course the |
|
137 | access to the repository files is not needed, unless of course the | |
132 |
:local:. The conversion uses the top level directory |
|
138 | repository is :local:. The conversion uses the top level directory | |
133 |
find the CVS repository, and then uses CVS rlog |
|
139 | in the sandbox to find the CVS repository, and then uses CVS rlog | |
134 | convert. This means that unless a filemap is given, all files under the |
|
140 | commands to find files to convert. This means that unless a | |
135 | starting directory will be converted, and that any directory |
|
141 | filemap is given, all files under the starting directory will be | |
136 | reorganization in the CVS sandbox is ignored. |
|
142 | converted, and that any directory reorganization in the CVS | |
|
143 | sandbox is ignored. | |||
137 |
|
144 | |||
138 | Because CVS does not have changesets, it is necessary to collect |
|
145 | Because CVS does not have changesets, it is necessary to collect | |
139 |
individual commits to CVS and merge them into changesets. CVS |
|
146 | individual commits to CVS and merge them into changesets. CVS | |
140 |
its internal changeset merging code by default but can |
|
147 | source uses its internal changeset merging code by default but can | |
141 | call the external 'cvsps' program by setting:: |
|
148 | be configured to call the external 'cvsps' program by setting:: | |
142 |
|
149 | |||
143 | --config convert.cvsps='cvsps -A -u --cvs-direct -q' |
|
150 | --config convert.cvsps='cvsps -A -u --cvs-direct -q' | |
144 |
|
151 | |||
@@ -153,40 +160,41 b' def convert(ui, src, dest=None, revmapfi' | |||||
153 | and has a few more configurable options: |
|
160 | and has a few more configurable options: | |
154 |
|
161 | |||
155 | --config convert.cvsps.cache=True (boolean) |
|
162 | --config convert.cvsps.cache=True (boolean) | |
156 |
Set to False to disable remote log caching, for testing and |
|
163 | Set to False to disable remote log caching, for testing and | |
157 | purposes. |
|
164 | debugging purposes. | |
158 | --config convert.cvsps.fuzz=60 (integer) |
|
165 | --config convert.cvsps.fuzz=60 (integer) | |
159 |
Specify the maximum time (in seconds) that is allowed between |
|
166 | Specify the maximum time (in seconds) that is allowed between | |
160 |
with identical user and log message in a single |
|
167 | commits with identical user and log message in a single | |
161 |
large files were checked in as part of a |
|
168 | changeset. When very large files were checked in as part of a | |
162 | may not be long enough. |
|
169 | changeset then the default may not be long enough. | |
163 | --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}' |
|
170 | --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}' | |
164 |
Specify a regular expression to which commit log messages are |
|
171 | Specify a regular expression to which commit log messages are | |
165 |
If a match occurs, then the conversion process will |
|
172 | matched. If a match occurs, then the conversion process will | |
166 |
revision merging the branch on which this log |
|
173 | insert a dummy revision merging the branch on which this log | |
167 | branch indicated in the regex. |
|
174 | message occurs to the branch indicated in the regex. | |
168 | --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}' |
|
175 | --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}' | |
169 |
Specify a regular expression to which commit log messages are |
|
176 | Specify a regular expression to which commit log messages are | |
170 |
If a match occurs, then the conversion process will |
|
177 | matched. If a match occurs, then the conversion process will | |
171 |
recent revision on the branch indicated in the |
|
178 | add the most recent revision on the branch indicated in the | |
172 | parent of the changeset. |
|
179 | regex as the second parent of the changeset. | |
173 |
|
180 | |||
174 |
The hgext/convert/cvsps wrapper script allows the builtin |
|
181 | The hgext/convert/cvsps wrapper script allows the builtin | |
175 |
merging code to be run without doing a conversion. Its |
|
182 | changeset merging code to be run without doing a conversion. Its | |
176 | output are similar to that of cvsps 2.1. |
|
183 | parameters and output are similar to that of cvsps 2.1. | |
177 |
|
184 | |||
178 | Subversion Source |
|
185 | Subversion Source | |
179 | ----------------- |
|
186 | ----------------- | |
180 |
|
187 | |||
181 |
Subversion source detects classical trunk/branches/tags layouts. |
|
188 | Subversion source detects classical trunk/branches/tags layouts. | |
182 |
default, the supplied "svn://repo/path/" source URL is |
|
189 | By default, the supplied "svn://repo/path/" source URL is | |
183 |
single branch. If "svn://repo/path/trunk" exists it |
|
190 | converted as a single branch. If "svn://repo/path/trunk" exists it | |
184 |
branch. If "svn://repo/path/branches" exists, |
|
191 | replaces the default branch. If "svn://repo/path/branches" exists, | |
185 | listed as possible branches. If "svn://repo/path/tags" exists, it is |
|
192 | its subdirectories are listed as possible branches. If | |
186 | looked for tags referencing converted branches. Default "trunk", |
|
193 | "svn://repo/path/tags" exists, it is looked for tags referencing | |
187 | "branches" and "tags" values can be overridden with following options. Set |
|
194 | converted branches. Default "trunk", "branches" and "tags" values | |
188 | them to paths relative to the source URL, or leave them blank to disable |
|
195 | can be overridden with following options. Set them to paths | |
189 | auto detection. |
|
196 | relative to the source URL, or leave them blank to disable auto | |
|
197 | detection. | |||
190 |
|
198 | |||
191 | --config convert.svn.branches=branches (directory name) |
|
199 | --config convert.svn.branches=branches (directory name) | |
192 | specify the directory containing branches |
|
200 | specify the directory containing branches | |
@@ -195,9 +203,9 b' def convert(ui, src, dest=None, revmapfi' | |||||
195 | --config convert.svn.trunk=trunk (directory name) |
|
203 | --config convert.svn.trunk=trunk (directory name) | |
196 | specify the name of the trunk branch |
|
204 | specify the name of the trunk branch | |
197 |
|
205 | |||
198 |
Source history can be retrieved starting at a specific revision, |
|
206 | Source history can be retrieved starting at a specific revision, | |
199 |
of being integrally converted. Only single branch |
|
207 | instead of being integrally converted. Only single branch | |
200 | supported. |
|
208 | conversions are supported. | |
201 |
|
209 | |||
202 | --config convert.svn.startrev=0 (svn revision number) |
|
210 | --config convert.svn.startrev=0 (svn revision number) | |
203 | specify start Subversion revision. |
|
211 | specify start Subversion revision. | |
@@ -205,14 +213,15 b' def convert(ui, src, dest=None, revmapfi' | |||||
205 | Perforce Source |
|
213 | Perforce Source | |
206 | --------------- |
|
214 | --------------- | |
207 |
|
215 | |||
208 |
The Perforce (P4) importer can be given a p4 depot path or a |
|
216 | The Perforce (P4) importer can be given a p4 depot path or a | |
209 |
specification as source. It will convert all files in the |
|
217 | client specification as source. It will convert all files in the | |
210 |
Mercurial repository, ignoring labels, branches |
|
218 | source to a flat Mercurial repository, ignoring labels, branches | |
211 |
that when a depot path is given you then |
|
219 | and integrations. Note that when a depot path is given you then | |
212 | directory, because otherwise the target may be named ...-hg. |
|
220 | usually should specify a target directory, because otherwise the | |
|
221 | target may be named ...-hg. | |||
213 |
|
222 | |||
214 |
It is possible to limit the amount of source history to be |
|
223 | It is possible to limit the amount of source history to be | |
215 | specifying an initial Perforce revision. |
|
224 | converted by specifying an initial Perforce revision. | |
216 |
|
225 | |||
217 | --config convert.p4.startrev=0 (perforce changelist number) |
|
226 | --config convert.p4.startrev=0 (perforce changelist number) | |
218 | specify initial Perforce revision. |
|
227 | specify initial Perforce revision. | |
@@ -236,13 +245,14 b' def debugsvnlog(ui, **opts):' | |||||
236 | def debugcvsps(ui, *args, **opts): |
|
245 | def debugcvsps(ui, *args, **opts): | |
237 | '''create changeset information from CVS |
|
246 | '''create changeset information from CVS | |
238 |
|
247 | |||
239 |
This command is intended as a debugging tool for the CVS to |
|
248 | This command is intended as a debugging tool for the CVS to | |
240 |
converter, and can be used as a direct replacement for |
|
249 | Mercurial converter, and can be used as a direct replacement for | |
|
250 | cvsps. | |||
241 |
|
251 | |||
242 |
Hg debugcvsps reads the CVS rlog for current directory (or any |
|
252 | Hg debugcvsps reads the CVS rlog for current directory (or any | |
243 |
directory) in the CVS repository, and converts the log to a |
|
253 | named directory) in the CVS repository, and converts the log to a | |
244 |
changesets based on matching commit log entries and |
|
254 | series of changesets based on matching commit log entries and | |
245 | ''' |
|
255 | dates.''' | |
246 | return cvsps.debugcvsps(ui, *args, **opts) |
|
256 | return cvsps.debugcvsps(ui, *args, **opts) | |
247 |
|
257 | |||
248 | commands.norepo += " convert debugsvnlog debugcvsps" |
|
258 | commands.norepo += " convert debugsvnlog debugcvsps" |
General Comments 0
You need to be logged in to leave comments.
Login now