Show More
@@ -1,307 +1,307 | |||||
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 of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | '''import revisions from foreign VCS repositories into Mercurial''' |
|
8 | '''import revisions from foreign VCS repositories into Mercurial''' | |
9 |
|
9 | |||
10 | import convcmd |
|
10 | import convcmd | |
11 | import cvsps |
|
11 | import cvsps | |
12 | import subversion |
|
12 | import subversion | |
13 | from mercurial import commands |
|
13 | from mercurial import commands | |
14 | from mercurial.i18n import _ |
|
14 | from mercurial.i18n import _ | |
15 |
|
15 | |||
16 | # Commands definition was moved elsewhere to ease demandload job. |
|
16 | # Commands definition was moved elsewhere to ease demandload job. | |
17 |
|
17 | |||
18 | def convert(ui, src, dest=None, revmapfile=None, **opts): |
|
18 | def convert(ui, src, dest=None, revmapfile=None, **opts): | |
19 | """convert a foreign SCM repository to a Mercurial one. |
|
19 | """convert a foreign SCM repository to a Mercurial one. | |
20 |
|
20 | |||
21 | Accepted source formats [identifiers]: |
|
21 | Accepted source formats [identifiers]: | |
22 |
|
22 | |||
23 | - Mercurial [hg] |
|
23 | - Mercurial [hg] | |
24 | - CVS [cvs] |
|
24 | - CVS [cvs] | |
25 | - Darcs [darcs] |
|
25 | - Darcs [darcs] | |
26 | - git [git] |
|
26 | - git [git] | |
27 | - Subversion [svn] |
|
27 | - Subversion [svn] | |
28 | - Monotone [mtn] |
|
28 | - Monotone [mtn] | |
29 | - GNU Arch [gnuarch] |
|
29 | - GNU Arch [gnuarch] | |
30 | - Bazaar [bzr] |
|
30 | - Bazaar [bzr] | |
31 | - Perforce [p4] |
|
31 | - Perforce [p4] | |
32 |
|
32 | |||
33 | Accepted destination formats [identifiers]: |
|
33 | Accepted destination formats [identifiers]: | |
34 |
|
34 | |||
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 | Otherwise, convert will only import up to the named revision |
|
39 | Otherwise, convert will only import up to the named revision | |
40 | (given in a format 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 | basename of the source with '-hg' appended. If the destination |
|
43 | basename of the source with '-hg' appended. If the destination | |
44 | repository doesn't 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 | Mercurial uses --sourcesort to preserve original revision numbers |
|
47 | Mercurial uses --sourcesort to preserve original revision numbers | |
48 | order. Sort modes 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 | which means branches are usually converted one after |
|
51 | which means branches are usually converted one after | |
52 | the other. It 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 | magnitude larger than the same ones generated by |
|
56 | magnitude larger than the same ones generated by | |
57 | --branchsort. |
|
57 | --branchsort. | |
58 |
|
58 | |||
59 | --sourcesort try to preserve source revisions order, only |
|
59 | --sourcesort try to preserve source revisions order, only | |
60 | supported by Mercurial sources. |
|
60 | supported by Mercurial sources. | |
61 |
|
61 | |||
62 | 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 | |
63 | (<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 | |
64 | that maps each source commit ID to the destination ID for that |
|
64 | that maps each source commit ID to the destination ID for that | |
65 | revision, like so:: |
|
65 | revision, like so:: | |
66 |
|
66 | |||
67 | <source ID> <destination ID> |
|
67 | <source ID> <destination ID> | |
68 |
|
68 | |||
69 | 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 | |
70 | updated on each commit copied, so convert-repo can be interrupted |
|
70 | updated on each commit copied, so convert-repo can be interrupted | |
71 | and can be run repeatedly to copy new commits. |
|
71 | and can be run repeatedly to copy new commits. | |
72 |
|
72 | |||
73 | 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 | |
74 | source commit author to a destination commit author. It is handy |
|
74 | source commit author to a destination commit author. It is handy | |
75 | for source SCMs that use unix logins to identify authors (eg: |
|
75 | for source SCMs that use unix logins to identify authors (eg: | |
76 | CVS). One line per author mapping and the line format is: |
|
76 | CVS). One line per author mapping and the line format is: | |
77 | srcauthor=whatever string you want |
|
77 | srcauthor=whatever string you want | |
78 |
|
78 | |||
79 | 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 | |
80 | and directories. Each line can contain one of the following |
|
80 | and directories. Each line can contain one of the following | |
81 | directives:: |
|
81 | directives:: | |
82 |
|
82 | |||
83 | include path/to/file-or-dir |
|
83 | include path/to/file-or-dir | |
84 |
|
84 | |||
85 | exclude path/to/file-or-dir |
|
85 | exclude path/to/file-or-dir | |
86 |
|
86 | |||
87 | rename path/to/source path/to/destination |
|
87 | rename path/to/source path/to/destination | |
88 |
|
88 | |||
89 |
Comment lines start with '#'. A specifi |
|
89 | Comment lines start with '#'. A specified path matches if it | |
90 | equals the full relative name of a file or one of its parent |
|
90 | equals the full relative name of a file or one of its parent | |
91 | directories. The 'include' or 'exclude' directive with the longest |
|
91 | directories. The 'include' or 'exclude' directive with the longest | |
92 | matching path applies, so line order does not matter. |
|
92 | matching path applies, so line order does not matter. | |
93 |
|
93 | |||
94 | The 'include' directive causes a file, or all files under a |
|
94 | The 'include' directive causes a file, or all files under a | |
95 | directory, to be included in the destination repository, and the |
|
95 | directory, to be included in the destination repository, and the | |
96 | exclusion of all other files and directories not explicitly |
|
96 | exclusion of all other files and directories not explicitly | |
97 | included. The 'exclude' directive causes files or directories to |
|
97 | included. The 'exclude' directive causes files or directories to | |
98 | be omitted. The 'rename' directive renames a file or directory if |
|
98 | be omitted. The 'rename' directive renames a file or directory if | |
99 |
is converted. To rename from a subdirectory into the root of |
|
99 | it is converted. To rename from a subdirectory into the root of | |
100 | repository, use '.' as the path to rename to. |
|
100 | the repository, use '.' as the path to rename to. | |
101 |
|
101 | |||
102 | The splicemap is a file that allows insertion of synthetic |
|
102 | The splicemap is a file that allows insertion of synthetic | |
103 | history, letting you specify the parents of a revision. This is |
|
103 | history, letting you specify the parents of a revision. This is | |
104 | useful if you want to e.g. give a Subversion merge two parents, or |
|
104 | useful if you want to e.g. give a Subversion merge two parents, or | |
105 | graft two disconnected series of history together. Each entry |
|
105 | graft two disconnected series of history together. Each entry | |
106 | contains a key, followed by a space, followed by one or two |
|
106 | contains a key, followed by a space, followed by one or two | |
107 | comma-separated values. The key is the revision ID in the source |
|
107 | comma-separated values. The key is the revision ID in the source | |
108 | revision control system whose parents should be modified (same |
|
108 | revision control system whose parents should be modified (same | |
109 | format as a key in .hg/shamap). The values are the revision IDs |
|
109 | format as a key in .hg/shamap). The values are the revision IDs | |
110 | (in either the source or destination revision control system) that |
|
110 | (in either the source or destination revision control system) that | |
111 | should be used as the new parents for that node. For example, if |
|
111 | should be used as the new parents for that node. For example, if | |
112 | you have merged "release-1.0" into "trunk", then you should |
|
112 | you have merged "release-1.0" into "trunk", then you should | |
113 | specify the revision on "trunk" as the first parent and the one on |
|
113 | specify the revision on "trunk" as the first parent and the one on | |
114 | the "release-1.0" branch as the second. |
|
114 | the "release-1.0" branch as the second. | |
115 |
|
115 | |||
116 | The branchmap is a file that allows you to rename a branch when it is |
|
116 | The branchmap is a file that allows you to rename a branch when it is | |
117 | being brought in from whatever external repository. When used in |
|
117 | being brought in from whatever external repository. When used in | |
118 | conjunction with a splicemap, it allows for a powerful combination |
|
118 | conjunction with a splicemap, it allows for a powerful combination | |
119 | to help fix even the most badly mismanaged repositories and turn them |
|
119 | to help fix even the most badly mismanaged repositories and turn them | |
120 | into nicely structured Mercurial repositories. The branchmap contains |
|
120 | into nicely structured Mercurial repositories. The branchmap contains | |
121 | lines of the form "original_branch_name new_branch_name". |
|
121 | lines of the form "original_branch_name new_branch_name". | |
122 | "original_branch_name" is the name of the branch in the source |
|
122 | "original_branch_name" is the name of the branch in the source | |
123 | repository, and "new_branch_name" is the name of the branch is the |
|
123 | repository, and "new_branch_name" is the name of the branch is the | |
124 | destination repository. This can be used to (for instance) move code |
|
124 | destination repository. This can be used to (for instance) move code | |
125 | in one repository from "default" to a named branch. |
|
125 | in one repository from "default" to a named branch. | |
126 |
|
126 | |||
127 | Mercurial Source |
|
127 | Mercurial Source | |
128 | ---------------- |
|
128 | ---------------- | |
129 |
|
129 | |||
130 | --config convert.hg.ignoreerrors=False (boolean) |
|
130 | --config convert.hg.ignoreerrors=False (boolean) | |
131 | ignore integrity errors when reading. Use it to fix Mercurial |
|
131 | ignore integrity errors when reading. Use it to fix Mercurial | |
132 | repositories with missing revlogs, by converting from and to |
|
132 | repositories with missing revlogs, by converting from and to | |
133 | Mercurial. |
|
133 | Mercurial. | |
134 | --config convert.hg.saverev=False (boolean) |
|
134 | --config convert.hg.saverev=False (boolean) | |
135 | store original revision ID in changeset (forces target IDs to |
|
135 | store original revision ID in changeset (forces target IDs to | |
136 | change) |
|
136 | change) | |
137 | --config convert.hg.startrev=0 (hg revision identifier) |
|
137 | --config convert.hg.startrev=0 (hg revision identifier) | |
138 | convert start revision and its descendants |
|
138 | convert start revision and its descendants | |
139 |
|
139 | |||
140 | CVS Source |
|
140 | CVS Source | |
141 | ---------- |
|
141 | ---------- | |
142 |
|
142 | |||
143 | CVS source will use a sandbox (i.e. a checked-out copy) from CVS |
|
143 | CVS source will use a sandbox (i.e. a checked-out copy) from CVS | |
144 | to indicate the starting point of what will be converted. Direct |
|
144 | to indicate the starting point of what will be converted. Direct | |
145 | access to the repository files is not needed, unless of course the |
|
145 | access to the repository files is not needed, unless of course the | |
146 | repository is :local:. The conversion uses the top level directory |
|
146 | repository is :local:. The conversion uses the top level directory | |
147 | in the sandbox to find the CVS repository, and then uses CVS rlog |
|
147 | in the sandbox to find the CVS repository, and then uses CVS rlog | |
148 | commands to find files to convert. This means that unless a |
|
148 | commands to find files to convert. This means that unless a | |
149 | filemap is given, all files under the starting directory will be |
|
149 | filemap is given, all files under the starting directory will be | |
150 | converted, and that any directory reorganization in the CVS |
|
150 | converted, and that any directory reorganization in the CVS | |
151 | sandbox is ignored. |
|
151 | sandbox is ignored. | |
152 |
|
152 | |||
153 | The options shown are the defaults. |
|
153 | The options shown are the defaults. | |
154 |
|
154 | |||
155 | --config convert.cvsps.cache=True (boolean) |
|
155 | --config convert.cvsps.cache=True (boolean) | |
156 | Set to False to disable remote log caching, for testing and |
|
156 | Set to False to disable remote log caching, for testing and | |
157 | debugging purposes. |
|
157 | debugging purposes. | |
158 | --config convert.cvsps.fuzz=60 (integer) |
|
158 | --config convert.cvsps.fuzz=60 (integer) | |
159 | Specify the maximum time (in seconds) that is allowed between |
|
159 | Specify the maximum time (in seconds) that is allowed between | |
160 | commits with identical user and log message in a single |
|
160 | commits with identical user and log message in a single | |
161 | changeset. When very large files were checked in as part of a |
|
161 | changeset. When very large files were checked in as part of a | |
162 | changeset then the default may not be long enough. |
|
162 | changeset then the default may not be long enough. | |
163 | --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}' |
|
163 | --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}' | |
164 | Specify a regular expression to which commit log messages are |
|
164 | Specify a regular expression to which commit log messages are | |
165 | matched. If a match occurs, then the conversion process will |
|
165 | matched. If a match occurs, then the conversion process will | |
166 | insert a dummy revision merging the branch on which this log |
|
166 | insert a dummy revision merging the branch on which this log | |
167 | message occurs to the branch indicated in the regex. |
|
167 | message occurs to the branch indicated in the regex. | |
168 | --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}' |
|
168 | --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}' | |
169 | Specify a regular expression to which commit log messages are |
|
169 | Specify a regular expression to which commit log messages are | |
170 | matched. If a match occurs, then the conversion process will |
|
170 | matched. If a match occurs, then the conversion process will | |
171 | add the most recent revision on the branch indicated in the |
|
171 | add the most recent revision on the branch indicated in the | |
172 | regex as the second parent of the changeset. |
|
172 | regex as the second parent of the changeset. | |
173 | --config hook.cvslog |
|
173 | --config hook.cvslog | |
174 | Specify a Python function to be called at the end of gathering |
|
174 | Specify a Python function to be called at the end of gathering | |
175 | the CVS log. The function is passed a list with the log entries, |
|
175 | the CVS log. The function is passed a list with the log entries, | |
176 | and can modify the entries in-place, or add or delete them. |
|
176 | and can modify the entries in-place, or add or delete them. | |
177 | --config hook.cvschangesets |
|
177 | --config hook.cvschangesets | |
178 | Specify a Python function to be called after the changesets |
|
178 | Specify a Python function to be called after the changesets | |
179 | are calculated from the the CVS log. The function is passed |
|
179 | are calculated from the the CVS log. The function is passed | |
180 | a list with the changeset entries, and can modify the changesets |
|
180 | a list with the changeset entries, and can modify the changesets | |
181 | in-place, or add or delete them. |
|
181 | in-place, or add or delete them. | |
182 |
|
182 | |||
183 | An additional "debugcvsps" Mercurial command allows the builtin |
|
183 | An additional "debugcvsps" Mercurial command allows the builtin | |
184 | changeset merging code to be run without doing a conversion. Its |
|
184 | changeset merging code to be run without doing a conversion. Its | |
185 | parameters and output are similar to that of cvsps 2.1. Please see |
|
185 | parameters and output are similar to that of cvsps 2.1. Please see | |
186 | the command help for more details. |
|
186 | the command help for more details. | |
187 |
|
187 | |||
188 | Subversion Source |
|
188 | Subversion Source | |
189 | ----------------- |
|
189 | ----------------- | |
190 |
|
190 | |||
191 | Subversion source detects classical trunk/branches/tags layouts. |
|
191 | Subversion source detects classical trunk/branches/tags layouts. | |
192 | By default, the supplied "svn://repo/path/" source URL is |
|
192 | By default, the supplied "svn://repo/path/" source URL is | |
193 | converted as a single branch. If "svn://repo/path/trunk" exists it |
|
193 | converted as a single branch. If "svn://repo/path/trunk" exists it | |
194 | replaces the default branch. If "svn://repo/path/branches" exists, |
|
194 | replaces the default branch. If "svn://repo/path/branches" exists, | |
195 | its subdirectories are listed as possible branches. If |
|
195 | its subdirectories are listed as possible branches. If | |
196 | "svn://repo/path/tags" exists, it is looked for tags referencing |
|
196 | "svn://repo/path/tags" exists, it is looked for tags referencing | |
197 | converted branches. Default "trunk", "branches" and "tags" values |
|
197 | converted branches. Default "trunk", "branches" and "tags" values | |
198 | can be overridden with following options. Set them to paths |
|
198 | can be overridden with following options. Set them to paths | |
199 | relative to the source URL, or leave them blank to disable auto |
|
199 | relative to the source URL, or leave them blank to disable auto | |
200 | detection. |
|
200 | detection. | |
201 |
|
201 | |||
202 | --config convert.svn.branches=branches (directory name) |
|
202 | --config convert.svn.branches=branches (directory name) | |
203 | specify the directory containing branches |
|
203 | specify the directory containing branches | |
204 | --config convert.svn.tags=tags (directory name) |
|
204 | --config convert.svn.tags=tags (directory name) | |
205 | specify the directory containing tags |
|
205 | specify the directory containing tags | |
206 | --config convert.svn.trunk=trunk (directory name) |
|
206 | --config convert.svn.trunk=trunk (directory name) | |
207 | specify the name of the trunk branch |
|
207 | specify the name of the trunk branch | |
208 |
|
208 | |||
209 | Source history can be retrieved starting at a specific revision, |
|
209 | Source history can be retrieved starting at a specific revision, | |
210 | instead of being integrally converted. Only single branch |
|
210 | instead of being integrally converted. Only single branch | |
211 | conversions are supported. |
|
211 | conversions are supported. | |
212 |
|
212 | |||
213 | --config convert.svn.startrev=0 (svn revision number) |
|
213 | --config convert.svn.startrev=0 (svn revision number) | |
214 | specify start Subversion revision. |
|
214 | specify start Subversion revision. | |
215 |
|
215 | |||
216 | Perforce Source |
|
216 | Perforce Source | |
217 | --------------- |
|
217 | --------------- | |
218 |
|
218 | |||
219 | The Perforce (P4) importer can be given a p4 depot path or a |
|
219 | The Perforce (P4) importer can be given a p4 depot path or a | |
220 | client specification as source. It will convert all files in the |
|
220 | client specification as source. It will convert all files in the | |
221 | source to a flat Mercurial repository, ignoring labels, branches |
|
221 | source to a flat Mercurial repository, ignoring labels, branches | |
222 | and integrations. Note that when a depot path is given you then |
|
222 | and integrations. Note that when a depot path is given you then | |
223 | usually should specify a target directory, because otherwise the |
|
223 | usually should specify a target directory, because otherwise the | |
224 | target may be named ...-hg. |
|
224 | target may be named ...-hg. | |
225 |
|
225 | |||
226 | It is possible to limit the amount of source history to be |
|
226 | It is possible to limit the amount of source history to be | |
227 | converted by specifying an initial Perforce revision. |
|
227 | converted by specifying an initial Perforce revision. | |
228 |
|
228 | |||
229 | --config convert.p4.startrev=0 (perforce changelist number) |
|
229 | --config convert.p4.startrev=0 (perforce changelist number) | |
230 | specify initial Perforce revision. |
|
230 | specify initial Perforce revision. | |
231 |
|
231 | |||
232 | Mercurial Destination |
|
232 | Mercurial Destination | |
233 | --------------------- |
|
233 | --------------------- | |
234 |
|
234 | |||
235 | --config convert.hg.clonebranches=False (boolean) |
|
235 | --config convert.hg.clonebranches=False (boolean) | |
236 | dispatch source branches in separate clones. |
|
236 | dispatch source branches in separate clones. | |
237 | --config convert.hg.tagsbranch=default (branch name) |
|
237 | --config convert.hg.tagsbranch=default (branch name) | |
238 | tag revisions branch name |
|
238 | tag revisions branch name | |
239 | --config convert.hg.usebranchnames=True (boolean) |
|
239 | --config convert.hg.usebranchnames=True (boolean) | |
240 | preserve branch names |
|
240 | preserve branch names | |
241 |
|
241 | |||
242 | """ |
|
242 | """ | |
243 | return convcmd.convert(ui, src, dest, revmapfile, **opts) |
|
243 | return convcmd.convert(ui, src, dest, revmapfile, **opts) | |
244 |
|
244 | |||
245 | def debugsvnlog(ui, **opts): |
|
245 | def debugsvnlog(ui, **opts): | |
246 | return subversion.debugsvnlog(ui, **opts) |
|
246 | return subversion.debugsvnlog(ui, **opts) | |
247 |
|
247 | |||
248 | def debugcvsps(ui, *args, **opts): |
|
248 | def debugcvsps(ui, *args, **opts): | |
249 | '''create changeset information from CVS |
|
249 | '''create changeset information from CVS | |
250 |
|
250 | |||
251 | This command is intended as a debugging tool for the CVS to |
|
251 | This command is intended as a debugging tool for the CVS to | |
252 | Mercurial converter, and can be used as a direct replacement for |
|
252 | Mercurial converter, and can be used as a direct replacement for | |
253 | cvsps. |
|
253 | cvsps. | |
254 |
|
254 | |||
255 | Hg debugcvsps reads the CVS rlog for current directory (or any |
|
255 | Hg debugcvsps reads the CVS rlog for current directory (or any | |
256 | named directory) in the CVS repository, and converts the log to a |
|
256 | named directory) in the CVS repository, and converts the log to a | |
257 | series of changesets based on matching commit log entries and |
|
257 | series of changesets based on matching commit log entries and | |
258 | dates.''' |
|
258 | dates.''' | |
259 | return cvsps.debugcvsps(ui, *args, **opts) |
|
259 | return cvsps.debugcvsps(ui, *args, **opts) | |
260 |
|
260 | |||
261 | commands.norepo += " convert debugsvnlog debugcvsps" |
|
261 | commands.norepo += " convert debugsvnlog debugcvsps" | |
262 |
|
262 | |||
263 | cmdtable = { |
|
263 | cmdtable = { | |
264 | "convert": |
|
264 | "convert": | |
265 | (convert, |
|
265 | (convert, | |
266 | [('A', 'authors', '', |
|
266 | [('A', 'authors', '', | |
267 | _('username mapping filename'), _('FILE')), |
|
267 | _('username mapping filename'), _('FILE')), | |
268 | ('d', 'dest-type', '', |
|
268 | ('d', 'dest-type', '', | |
269 | _('destination repository type'), _('TYPE')), |
|
269 | _('destination repository type'), _('TYPE')), | |
270 | ('', 'filemap', '', |
|
270 | ('', 'filemap', '', | |
271 | _('remap file names using contents of file'), _('FILE')), |
|
271 | _('remap file names using contents of file'), _('FILE')), | |
272 | ('r', 'rev', '', |
|
272 | ('r', 'rev', '', | |
273 | _('import up to target revision REV'), _('REV')), |
|
273 | _('import up to target revision REV'), _('REV')), | |
274 | ('s', 'source-type', '', |
|
274 | ('s', 'source-type', '', | |
275 | _('source repository type'), _('TYPE')), |
|
275 | _('source repository type'), _('TYPE')), | |
276 | ('', 'splicemap', '', |
|
276 | ('', 'splicemap', '', | |
277 | _('splice synthesized history into place'), _('FILE')), |
|
277 | _('splice synthesized history into place'), _('FILE')), | |
278 | ('', 'branchmap', '', |
|
278 | ('', 'branchmap', '', | |
279 | _('change branch names while converting'), _('FILE')), |
|
279 | _('change branch names while converting'), _('FILE')), | |
280 | ('', 'branchsort', None, _('try to sort changesets by branches')), |
|
280 | ('', 'branchsort', None, _('try to sort changesets by branches')), | |
281 | ('', 'datesort', None, _('try to sort changesets by date')), |
|
281 | ('', 'datesort', None, _('try to sort changesets by date')), | |
282 | ('', 'sourcesort', None, _('preserve source changesets order'))], |
|
282 | ('', 'sourcesort', None, _('preserve source changesets order'))], | |
283 | _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]')), |
|
283 | _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]')), | |
284 | "debugsvnlog": |
|
284 | "debugsvnlog": | |
285 | (debugsvnlog, |
|
285 | (debugsvnlog, | |
286 | [], |
|
286 | [], | |
287 | 'hg debugsvnlog'), |
|
287 | 'hg debugsvnlog'), | |
288 | "debugcvsps": |
|
288 | "debugcvsps": | |
289 | (debugcvsps, |
|
289 | (debugcvsps, | |
290 | [ |
|
290 | [ | |
291 | # Main options shared with cvsps-2.1 |
|
291 | # Main options shared with cvsps-2.1 | |
292 | ('b', 'branches', [], _('only return changes on specified branches')), |
|
292 | ('b', 'branches', [], _('only return changes on specified branches')), | |
293 | ('p', 'prefix', '', _('prefix to remove from file names')), |
|
293 | ('p', 'prefix', '', _('prefix to remove from file names')), | |
294 | ('r', 'revisions', [], |
|
294 | ('r', 'revisions', [], | |
295 | _('only return changes after or between specified tags')), |
|
295 | _('only return changes after or between specified tags')), | |
296 | ('u', 'update-cache', None, _("update cvs log cache")), |
|
296 | ('u', 'update-cache', None, _("update cvs log cache")), | |
297 | ('x', 'new-cache', None, _("create new cvs log cache")), |
|
297 | ('x', 'new-cache', None, _("create new cvs log cache")), | |
298 | ('z', 'fuzz', 60, _('set commit time fuzz in seconds')), |
|
298 | ('z', 'fuzz', 60, _('set commit time fuzz in seconds')), | |
299 | ('', 'root', '', _('specify cvsroot')), |
|
299 | ('', 'root', '', _('specify cvsroot')), | |
300 | # Options specific to builtin cvsps |
|
300 | # Options specific to builtin cvsps | |
301 | ('', 'parents', '', _('show parent changesets')), |
|
301 | ('', 'parents', '', _('show parent changesets')), | |
302 | ('', 'ancestors', '', _('show current changeset in ancestor branches')), |
|
302 | ('', 'ancestors', '', _('show current changeset in ancestor branches')), | |
303 | # Options that are ignored for compatibility with cvsps-2.1 |
|
303 | # Options that are ignored for compatibility with cvsps-2.1 | |
304 | ('A', 'cvs-direct', None, _('ignored for compatibility')), |
|
304 | ('A', 'cvs-direct', None, _('ignored for compatibility')), | |
305 | ], |
|
305 | ], | |
306 | _('hg debugcvsps [OPTION]... [PATH]...')), |
|
306 | _('hg debugcvsps [OPTION]... [PATH]...')), | |
307 | } |
|
307 | } |
@@ -1,357 +1,357 | |||||
1 | Ancestor |
|
1 | Ancestor | |
2 | Any changeset that can be reached by an unbroken chain of parent |
|
2 | Any changeset that can be reached by an unbroken chain of parent | |
3 | changesets from a given changeset. More precisely, the ancestors |
|
3 | changesets from a given changeset. More precisely, the ancestors | |
4 | of a changeset can be defined by two properties: a parent of a |
|
4 | of a changeset can be defined by two properties: a parent of a | |
5 | changeset is an ancestor, and a parent of an ancestor is an |
|
5 | changeset is an ancestor, and a parent of an ancestor is an | |
6 | ancestor. See also: 'Descendant'. |
|
6 | ancestor. See also: 'Descendant'. | |
7 |
|
7 | |||
8 | Branch |
|
8 | Branch | |
9 | (Noun) A child changeset that has been created from a parent that |
|
9 | (Noun) A child changeset that has been created from a parent that | |
10 | is not a head. These are known as topological branches, see |
|
10 | is not a head. These are known as topological branches, see | |
11 | 'Branch, topological'. If a topological branch is named, it becomes |
|
11 | 'Branch, topological'. If a topological branch is named, it becomes | |
12 | a named branch. If a topological branch is not named, it becomes |
|
12 | a named branch. If a topological branch is not named, it becomes | |
13 | an anonymous branch. See 'Branch, anonymous' and 'Branch, named'. |
|
13 | an anonymous branch. See 'Branch, anonymous' and 'Branch, named'. | |
14 |
|
14 | |||
15 | Branches may be created when changes are pulled from or pushed to |
|
15 | Branches may be created when changes are pulled from or pushed to | |
16 | a remote repository, since new heads may be created by these |
|
16 | a remote repository, since new heads may be created by these | |
17 | operations. Note that the term branch can also be used informally |
|
17 | operations. Note that the term branch can also be used informally | |
18 | to describe a development process in which certain development is |
|
18 | to describe a development process in which certain development is | |
19 | done independently of other development.This is sometimes done |
|
19 | done independently of other development. This is sometimes done | |
20 | explicitly with a named branch, but it can also be done locally, |
|
20 | explicitly with a named branch, but it can also be done locally, | |
21 | using bookmarks or clones and anonymous branches. |
|
21 | using bookmarks or clones and anonymous branches. | |
22 |
|
22 | |||
23 | Example: "The experimental branch". |
|
23 | Example: "The experimental branch". | |
24 |
|
24 | |||
25 | (Verb) The action of creating a child changeset which results in |
|
25 | (Verb) The action of creating a child changeset which results in | |
26 | its parent having more than one child. |
|
26 | its parent having more than one child. | |
27 |
|
27 | |||
28 | Example: "I'm going to branch at X". |
|
28 | Example: "I'm going to branch at X". | |
29 |
|
29 | |||
30 | Branch, anonymous |
|
30 | Branch, anonymous | |
31 | Every time a new child changeset is created from a parent that is not |
|
31 | Every time a new child changeset is created from a parent that is not | |
32 | a head and the name of the branch is not changed, a new anonymous |
|
32 | a head and the name of the branch is not changed, a new anonymous | |
33 | branch is created. |
|
33 | branch is created. | |
34 |
|
34 | |||
35 | Branch, closed |
|
35 | Branch, closed | |
36 | A named branch whose branch heads have all been closed. |
|
36 | A named branch whose branch heads have all been closed. | |
37 |
|
37 | |||
38 | Branch, default |
|
38 | Branch, default | |
39 | The branch assigned to a changeset when no name has previously been |
|
39 | The branch assigned to a changeset when no name has previously been | |
40 | assigned. |
|
40 | assigned. | |
41 |
|
41 | |||
42 | Branch head |
|
42 | Branch head | |
43 | See 'Head, branch'. |
|
43 | See 'Head, branch'. | |
44 |
|
44 | |||
45 | Branch, named |
|
45 | Branch, named | |
46 | A collection of changesets which have the same branch name. By |
|
46 | A collection of changesets which have the same branch name. By | |
47 | default, children of a changeset in a named branch belong to the |
|
47 | default, children of a changeset in a named branch belong to the | |
48 | same named branch. A child can be explicitly assigned to a |
|
48 | same named branch. A child can be explicitly assigned to a | |
49 | different branch. See :hg:`help branch`, :hg:`help branches` and |
|
49 | different branch. See :hg:`help branch`, :hg:`help branches` and | |
50 | :hg:`commit --close-branch` for more information on managing |
|
50 | :hg:`commit --close-branch` for more information on managing | |
51 | branches. |
|
51 | branches. | |
52 |
|
52 | |||
53 | Named branches can be thought of as a kind of namespace, dividing |
|
53 | Named branches can be thought of as a kind of namespace, dividing | |
54 | the collection of changesets that comprise the repository into a |
|
54 | the collection of changesets that comprise the repository into a | |
55 | collection of disjoint subsets. A named branch is not necessarily |
|
55 | collection of disjoint subsets. A named branch is not necessarily | |
56 | a topological branch. If a new named branch is created from the |
|
56 | a topological branch. If a new named branch is created from the | |
57 | head of another named branch, or the default branch, but no |
|
57 | head of another named branch, or the default branch, but no | |
58 | further changesets are added to that previous branch, then that |
|
58 | further changesets are added to that previous branch, then that | |
59 | previous branch will be a branch in name only. |
|
59 | previous branch will be a branch in name only. | |
60 |
|
60 | |||
61 | Branch tip |
|
61 | Branch tip | |
62 | See 'Tip, branch'. |
|
62 | See 'Tip, branch'. | |
63 |
|
63 | |||
64 | Branch, topological |
|
64 | Branch, topological | |
65 | Every time a new child changeset is created from a parent that is |
|
65 | Every time a new child changeset is created from a parent that is | |
66 | not a head, a new topological branch is created. If a topological |
|
66 | not a head, a new topological branch is created. If a topological | |
67 | branch is named, it becomes a named branch. If a topological |
|
67 | branch is named, it becomes a named branch. If a topological | |
68 | branch is not named, it becomes an anonymous branch of the |
|
68 | branch is not named, it becomes an anonymous branch of the | |
69 | current, possibly default, branch. |
|
69 | current, possibly default, branch. | |
70 |
|
70 | |||
71 | Changelog |
|
71 | Changelog | |
72 | A record of the changesets in the order in which they were added |
|
72 | A record of the changesets in the order in which they were added | |
73 | to the repository. This includes details such as changeset id, |
|
73 | to the repository. This includes details such as changeset id, | |
74 | author, commit message, date, and list of changed files. |
|
74 | author, commit message, date, and list of changed files. | |
75 |
|
75 | |||
76 | Changeset |
|
76 | Changeset | |
77 | A snapshot of the state of the repository used to record a change. |
|
77 | A snapshot of the state of the repository used to record a change. | |
78 |
|
78 | |||
79 | Changeset, child |
|
79 | Changeset, child | |
80 | The converse of parent changeset: if P is a parent of C, then C is |
|
80 | The converse of parent changeset: if P is a parent of C, then C is | |
81 | a child of P. There is no limit to the number of children that a |
|
81 | a child of P. There is no limit to the number of children that a | |
82 | changeset may have. |
|
82 | changeset may have. | |
83 |
|
83 | |||
84 | Changeset id |
|
84 | Changeset id | |
85 | A SHA-1 hash that uniquely identifies a changeset. It may be |
|
85 | A SHA-1 hash that uniquely identifies a changeset. It may be | |
86 | represented as either a "long" 40-byte hexadecimal string, or a |
|
86 | represented as either a "long" 40-byte hexadecimal string, or a | |
87 | "short" 12-byte hexadecimal string. |
|
87 | "short" 12-byte hexadecimal string. | |
88 |
|
88 | |||
89 | Changeset, merge |
|
89 | Changeset, merge | |
90 | A changeset with two parents. This occurs when a merge is |
|
90 | A changeset with two parents. This occurs when a merge is | |
91 | committed. |
|
91 | committed. | |
92 |
|
92 | |||
93 | Changeset, parent |
|
93 | Changeset, parent | |
94 | A revision upon which a child changeset is based. Specifically, a |
|
94 | A revision upon which a child changeset is based. Specifically, a | |
95 | parent changeset of a changeset C is a changeset whose node |
|
95 | parent changeset of a changeset C is a changeset whose node | |
96 | immediately precedes C in the DAG. Changesets have at most two |
|
96 | immediately precedes C in the DAG. Changesets have at most two | |
97 | parents. |
|
97 | parents. | |
98 |
|
98 | |||
99 | Checkout |
|
99 | Checkout | |
100 | (Noun) The working directory being updated to a specific |
|
100 | (Noun) The working directory being updated to a specific | |
101 | revision. This use should probably be avoided where possible, as |
|
101 | revision. This use should probably be avoided where possible, as | |
102 | changeset is much more appropriate than checkout in this context. |
|
102 | changeset is much more appropriate than checkout in this context. | |
103 |
|
103 | |||
104 | Example: "I'm using checkout X." |
|
104 | Example: "I'm using checkout X." | |
105 |
|
105 | |||
106 | (Verb) Updating the working directory to a specific changeset. See |
|
106 | (Verb) Updating the working directory to a specific changeset. See | |
107 | :hg:`help update`. |
|
107 | :hg:`help update`. | |
108 |
|
108 | |||
109 | Example: "I'm going to check out changeset X." |
|
109 | Example: "I'm going to check out changeset X." | |
110 |
|
110 | |||
111 | Child changeset |
|
111 | Child changeset | |
112 | See 'Changeset, child'. |
|
112 | See 'Changeset, child'. | |
113 |
|
113 | |||
114 | Close changeset |
|
114 | Close changeset | |
115 | See 'Changeset, close'. |
|
115 | See 'Changeset, close'. | |
116 |
|
116 | |||
117 | Closed branch |
|
117 | Closed branch | |
118 | See 'Branch, closed'. |
|
118 | See 'Branch, closed'. | |
119 |
|
119 | |||
120 | Clone |
|
120 | Clone | |
121 | (Noun) An entire or partial copy of a repository. The partial |
|
121 | (Noun) An entire or partial copy of a repository. The partial | |
122 | clone must be in the form of a revision and its ancestors. |
|
122 | clone must be in the form of a revision and its ancestors. | |
123 |
|
123 | |||
124 | Example: "Is your clone up to date?". |
|
124 | Example: "Is your clone up to date?". | |
125 |
|
125 | |||
126 | (Verb) The process of creating a clone, using :hg:`clone`. |
|
126 | (Verb) The process of creating a clone, using :hg:`clone`. | |
127 |
|
127 | |||
128 | Example: "I'm going to clone the repository". |
|
128 | Example: "I'm going to clone the repository". | |
129 |
|
129 | |||
130 | Closed branch head |
|
130 | Closed branch head | |
131 | See 'Head, closed branch'. |
|
131 | See 'Head, closed branch'. | |
132 |
|
132 | |||
133 | Commit |
|
133 | Commit | |
134 | (Noun) A synonym for changeset. |
|
134 | (Noun) A synonym for changeset. | |
135 |
|
135 | |||
136 | Example: "Is the bug fixed in your recent commit?" |
|
136 | Example: "Is the bug fixed in your recent commit?" | |
137 |
|
137 | |||
138 | (Verb) The act of recording changes to a repository. When files |
|
138 | (Verb) The act of recording changes to a repository. When files | |
139 | are committed in a working directory, Mercurial finds the |
|
139 | are committed in a working directory, Mercurial finds the | |
140 | differences between the committed files and their parent |
|
140 | differences between the committed files and their parent | |
141 | changeset, creating a new changeset in the repository. |
|
141 | changeset, creating a new changeset in the repository. | |
142 |
|
142 | |||
143 | Example: "You should commit those changes now." |
|
143 | Example: "You should commit those changes now." | |
144 |
|
144 | |||
145 | Cset |
|
145 | Cset | |
146 | A common abbreviation of the term changeset. |
|
146 | A common abbreviation of the term changeset. | |
147 |
|
147 | |||
148 | DAG |
|
148 | DAG | |
149 | The repository of changesets of a distributed version control |
|
149 | The repository of changesets of a distributed version control | |
150 | system (DVCS) can be described as a directed acyclic graph (DAG), |
|
150 | system (DVCS) can be described as a directed acyclic graph (DAG), | |
151 | consisting of nodes and edges, where nodes correspond to |
|
151 | consisting of nodes and edges, where nodes correspond to | |
152 | changesets and edges imply a parent -> child relation. This graph |
|
152 | changesets and edges imply a parent -> child relation. This graph | |
153 | can be visualized by graphical tools such as :hg:`glog` |
|
153 | can be visualized by graphical tools such as :hg:`glog` | |
154 | (graphlog). In Mercurial, the DAG is limited by the requirement |
|
154 | (graphlog). In Mercurial, the DAG is limited by the requirement | |
155 | for children to have at most two parents. |
|
155 | for children to have at most two parents. | |
156 |
|
156 | |||
157 | Default branch |
|
157 | Default branch | |
158 | See 'Branch, default'. |
|
158 | See 'Branch, default'. | |
159 |
|
159 | |||
160 | Descendant |
|
160 | Descendant | |
161 | Any changeset that can be reached by a chain of child changesets |
|
161 | Any changeset that can be reached by a chain of child changesets | |
162 | from a given changeset. More precisely, the descendants of a |
|
162 | from a given changeset. More precisely, the descendants of a | |
163 | changeset can be defined by two properties: the child of a |
|
163 | changeset can be defined by two properties: the child of a | |
164 | changeset is a descendant, and the child of a descendant is a |
|
164 | changeset is a descendant, and the child of a descendant is a | |
165 | descendant. See also: 'Ancestor'. |
|
165 | descendant. See also: 'Ancestor'. | |
166 |
|
166 | |||
167 | Diff |
|
167 | Diff | |
168 | (Noun) The difference between the contents and attributes of files |
|
168 | (Noun) The difference between the contents and attributes of files | |
169 | in two changesets or a changeset and the current working |
|
169 | in two changesets or a changeset and the current working | |
170 | directory. The difference is usually represented in a standard |
|
170 | directory. The difference is usually represented in a standard | |
171 | form called a "diff" or "patch". The "git diff" format is used |
|
171 | form called a "diff" or "patch". The "git diff" format is used | |
172 | when the changes include copies, renames, or changes to file |
|
172 | when the changes include copies, renames, or changes to file | |
173 | attributes, none of which can be represented/handled by classic |
|
173 | attributes, none of which can be represented/handled by classic | |
174 | "diff" and "patch". |
|
174 | "diff" and "patch". | |
175 |
|
175 | |||
176 | Example: "Did you see my correction in the diff?" |
|
176 | Example: "Did you see my correction in the diff?" | |
177 |
|
177 | |||
178 | (Verb) Diffing two changesets is the action of creating a diff or |
|
178 | (Verb) Diffing two changesets is the action of creating a diff or | |
179 | patch. |
|
179 | patch. | |
180 |
|
180 | |||
181 | Example: "If you diff with changeset X, you will see what I mean." |
|
181 | Example: "If you diff with changeset X, you will see what I mean." | |
182 |
|
182 | |||
183 | Directory, working |
|
183 | Directory, working | |
184 | The working directory represents the state of the files tracked by |
|
184 | The working directory represents the state of the files tracked by | |
185 | Mercurial, that will be recorded in the next commit. The working |
|
185 | Mercurial, that will be recorded in the next commit. The working | |
186 | directory initially corresponds to the snapshot at an existing |
|
186 | directory initially corresponds to the snapshot at an existing | |
187 | changeset, known as the parent of the working directory. See |
|
187 | changeset, known as the parent of the working directory. See | |
188 | 'Parent, working directory'. The state may be modified by changes |
|
188 | 'Parent, working directory'. The state may be modified by changes | |
189 | to the files introduced manually or by a merge. The repository |
|
189 | to the files introduced manually or by a merge. The repository | |
190 | metadata exists in the .hg directory inside the working directory. |
|
190 | metadata exists in the .hg directory inside the working directory. | |
191 |
|
191 | |||
192 | Graph |
|
192 | Graph | |
193 | See DAG and :hg:`help graphlog`. |
|
193 | See DAG and :hg:`help graphlog`. | |
194 |
|
194 | |||
195 | Head |
|
195 | Head | |
196 | The term 'head' may be used to refer to both a branch head or a |
|
196 | The term 'head' may be used to refer to both a branch head or a | |
197 | repository head, depending on the context. See 'Head, branch' and |
|
197 | repository head, depending on the context. See 'Head, branch' and | |
198 | 'Head, repository' for specific definitions. |
|
198 | 'Head, repository' for specific definitions. | |
199 |
|
199 | |||
200 | Heads are where development generally takes place and are the |
|
200 | Heads are where development generally takes place and are the | |
201 | usual targets for update and merge operations. |
|
201 | usual targets for update and merge operations. | |
202 |
|
202 | |||
203 | Head, branch |
|
203 | Head, branch | |
204 | A changeset with no descendants on the same named branch. |
|
204 | A changeset with no descendants on the same named branch. | |
205 |
|
205 | |||
206 | Head, closed branch |
|
206 | Head, closed branch | |
207 | A changeset that marks a head as no longer interesting. The closed |
|
207 | A changeset that marks a head as no longer interesting. The closed | |
208 | head is no longer listed by :hg:`heads`. A branch is considered |
|
208 | head is no longer listed by :hg:`heads`. A branch is considered | |
209 | closed when all its heads are closed and consequently is not |
|
209 | closed when all its heads are closed and consequently is not | |
210 | listed by :hg:`branches`. |
|
210 | listed by :hg:`branches`. | |
211 |
|
211 | |||
212 | Head, repository |
|
212 | Head, repository | |
213 | A topological head which has not been closed. |
|
213 | A topological head which has not been closed. | |
214 |
|
214 | |||
215 | Head, topological |
|
215 | Head, topological | |
216 | A changeset with no children in the repository. |
|
216 | A changeset with no children in the repository. | |
217 |
|
217 | |||
218 | History, immutable |
|
218 | History, immutable | |
219 | Once committed, changesets cannot be altered. Extensions which |
|
219 | Once committed, changesets cannot be altered. Extensions which | |
220 | appear to change history actually create new changesets that |
|
220 | appear to change history actually create new changesets that | |
221 | replace existing ones, and then destroy the old changesets. Doing |
|
221 | replace existing ones, and then destroy the old changesets. Doing | |
222 | so in public repositories can result in old changesets being |
|
222 | so in public repositories can result in old changesets being | |
223 | reintroduced to the repository. |
|
223 | reintroduced to the repository. | |
224 |
|
224 | |||
225 | History, rewriting |
|
225 | History, rewriting | |
226 | The changesets in a repository are immutable. However, extensions |
|
226 | The changesets in a repository are immutable. However, extensions | |
227 | to Mercurial can be used to alter the repository, usually in such |
|
227 | to Mercurial can be used to alter the repository, usually in such | |
228 | a way as to preserve changeset contents. |
|
228 | a way as to preserve changeset contents. | |
229 |
|
229 | |||
230 | Immutable history |
|
230 | Immutable history | |
231 | See 'History, immutable'. |
|
231 | See 'History, immutable'. | |
232 |
|
232 | |||
233 | Merge changeset |
|
233 | Merge changeset | |
234 | See 'Changeset, merge'. |
|
234 | See 'Changeset, merge'. | |
235 |
|
235 | |||
236 | Manifest |
|
236 | Manifest | |
237 | Each changeset has a manifest, which is the list of files that are |
|
237 | Each changeset has a manifest, which is the list of files that are | |
238 | tracked by the changeset. |
|
238 | tracked by the changeset. | |
239 |
|
239 | |||
240 | Merge |
|
240 | Merge | |
241 | Used to bring together divergent branches of work. When you update |
|
241 | Used to bring together divergent branches of work. When you update | |
242 | to a changeset and then merge another changeset, you bring the |
|
242 | to a changeset and then merge another changeset, you bring the | |
243 | history of the latter changeset into your working directory. Once |
|
243 | history of the latter changeset into your working directory. Once | |
244 | conflicts are resolved (and marked), this merge may be committed |
|
244 | conflicts are resolved (and marked), this merge may be committed | |
245 | as a merge changeset, bringing two branches together in the DAG. |
|
245 | as a merge changeset, bringing two branches together in the DAG. | |
246 |
|
246 | |||
247 | Named branch |
|
247 | Named branch | |
248 | See 'Branch, named'. |
|
248 | See 'Branch, named'. | |
249 |
|
249 | |||
250 | Null changeset |
|
250 | Null changeset | |
251 | The empty changeset. It is the parent state of newly-initialized |
|
251 | The empty changeset. It is the parent state of newly-initialized | |
252 | repositories and repositories with no checked out revision. It is |
|
252 | repositories and repositories with no checked out revision. It is | |
253 | thus the parent of root changesets and the effective ancestor when |
|
253 | thus the parent of root changesets and the effective ancestor when | |
254 | merging unrelated changesets. Can be specified by the alias 'null' |
|
254 | merging unrelated changesets. Can be specified by the alias 'null' | |
255 | or by the changeset ID '000000000000'. |
|
255 | or by the changeset ID '000000000000'. | |
256 |
|
256 | |||
257 | Parent |
|
257 | Parent | |
258 | See 'Changeset, parent'. |
|
258 | See 'Changeset, parent'. | |
259 |
|
259 | |||
260 | Parent changeset |
|
260 | Parent changeset | |
261 | See 'Changeset, parent'. |
|
261 | See 'Changeset, parent'. | |
262 |
|
262 | |||
263 | Parent, working directory |
|
263 | Parent, working directory | |
264 | The working directory parent reflects a virtual revision which is |
|
264 | The working directory parent reflects a virtual revision which is | |
265 | the child of the changeset (or two changesets with an uncommitted |
|
265 | the child of the changeset (or two changesets with an uncommitted | |
266 | merge) shown by :hg:`parents`. This is changed with |
|
266 | merge) shown by :hg:`parents`. This is changed with | |
267 | :hg:`update`. Other commands to see the working directory parent |
|
267 | :hg:`update`. Other commands to see the working directory parent | |
268 | are :hg:`summary` and :hg:`id`. Can be specified by the alias ".". |
|
268 | are :hg:`summary` and :hg:`id`. Can be specified by the alias ".". | |
269 |
|
269 | |||
270 | Patch |
|
270 | Patch | |
271 | (Noun) The product of a diff operation. |
|
271 | (Noun) The product of a diff operation. | |
272 |
|
272 | |||
273 | Example: "I've sent you my patch." |
|
273 | Example: "I've sent you my patch." | |
274 |
|
274 | |||
275 | (Verb) The process of using a patch file to transform one |
|
275 | (Verb) The process of using a patch file to transform one | |
276 | changeset into another. |
|
276 | changeset into another. | |
277 |
|
277 | |||
278 | Example: "You will need to patch that revision." |
|
278 | Example: "You will need to patch that revision." | |
279 |
|
279 | |||
280 | Pull |
|
280 | Pull | |
281 | An operation in which changesets in a remote repository which are |
|
281 | An operation in which changesets in a remote repository which are | |
282 | not in the local repository are brought into the local |
|
282 | not in the local repository are brought into the local | |
283 | repository. Note that this operation without special arguments |
|
283 | repository. Note that this operation without special arguments | |
284 | only updates the repository, it does not update the files in the |
|
284 | only updates the repository, it does not update the files in the | |
285 | working directory. See :hg:`help pull`. |
|
285 | working directory. See :hg:`help pull`. | |
286 |
|
286 | |||
287 | Push |
|
287 | Push | |
288 | An operation in which changesets in a local repository which are |
|
288 | An operation in which changesets in a local repository which are | |
289 | not in a remote repository are sent to the remote repository. Note |
|
289 | not in a remote repository are sent to the remote repository. Note | |
290 | that this operation only adds changesets which have been committed |
|
290 | that this operation only adds changesets which have been committed | |
291 | locally to the remote repository. Uncommitted changes are not |
|
291 | locally to the remote repository. Uncommitted changes are not | |
292 | sent. See :hg:`help push`. |
|
292 | sent. See :hg:`help push`. | |
293 |
|
293 | |||
294 | Repository |
|
294 | Repository | |
295 | The metadata describing all recorded states of a collection of |
|
295 | The metadata describing all recorded states of a collection of | |
296 | files. Each recorded state is represented by a changeset. A |
|
296 | files. Each recorded state is represented by a changeset. A | |
297 | repository is usually (but not always) found in the ``.hg`` |
|
297 | repository is usually (but not always) found in the ``.hg`` | |
298 | subdirectory of a working directory. Any recorded state can be |
|
298 | subdirectory of a working directory. Any recorded state can be | |
299 | recreated by "updating" a working directory to a specific |
|
299 | recreated by "updating" a working directory to a specific | |
300 | changeset. |
|
300 | changeset. | |
301 |
|
301 | |||
302 | Repository head |
|
302 | Repository head | |
303 | See 'Head, repository'. |
|
303 | See 'Head, repository'. | |
304 |
|
304 | |||
305 | Revision |
|
305 | Revision | |
306 | A state of the repository at some point in time. Earlier revisions |
|
306 | A state of the repository at some point in time. Earlier revisions | |
307 | can be updated to by using :hg:`update`. See also 'Revision |
|
307 | can be updated to by using :hg:`update`. See also 'Revision | |
308 | number'; See also 'Changeset'. |
|
308 | number'; See also 'Changeset'. | |
309 |
|
309 | |||
310 | Revision number |
|
310 | Revision number | |
311 | This integer uniquely identifies a changeset in a specific |
|
311 | This integer uniquely identifies a changeset in a specific | |
312 | repository. It represents the order in which changesets were added |
|
312 | repository. It represents the order in which changesets were added | |
313 | to a repository, starting with revision number 0. Note that the |
|
313 | to a repository, starting with revision number 0. Note that the | |
314 | revision number may be different in each clone of a repository. To |
|
314 | revision number may be different in each clone of a repository. To | |
315 | identify changesets uniquely between different clones, see |
|
315 | identify changesets uniquely between different clones, see | |
316 | 'Changeset id'. |
|
316 | 'Changeset id'. | |
317 |
|
317 | |||
318 | Revlog |
|
318 | Revlog | |
319 | History storage mechanism used by Mercurial. It is a form of delta |
|
319 | History storage mechanism used by Mercurial. It is a form of delta | |
320 | encoding, with occasional full revision of data followed by delta |
|
320 | encoding, with occasional full revision of data followed by delta | |
321 | of each successive revision. It includes data and an index |
|
321 | of each successive revision. It includes data and an index | |
322 | pointing to the data. |
|
322 | pointing to the data. | |
323 |
|
323 | |||
324 | Rewriting history |
|
324 | Rewriting history | |
325 | See 'History, rewriting'. |
|
325 | See 'History, rewriting'. | |
326 |
|
326 | |||
327 | Root |
|
327 | Root | |
328 | A changeset that has only the null changeset as its parent. Most |
|
328 | A changeset that has only the null changeset as its parent. Most | |
329 | repositories have only a single root changeset. |
|
329 | repositories have only a single root changeset. | |
330 |
|
330 | |||
331 | Tip |
|
331 | Tip | |
332 | The changeset with the highest revision number. It is the changeset |
|
332 | The changeset with the highest revision number. It is the changeset | |
333 | most recently added in a repository. |
|
333 | most recently added in a repository. | |
334 |
|
334 | |||
335 | Tip, branch |
|
335 | Tip, branch | |
336 | The head of a given branch with the highest revision number. When |
|
336 | The head of a given branch with the highest revision number. When | |
337 | a branch name is used as a revision identifier, it refers to the |
|
337 | a branch name is used as a revision identifier, it refers to the | |
338 | branch tip. See also 'Branch, head'. Note that because revision |
|
338 | branch tip. See also 'Branch, head'. Note that because revision | |
339 | numbers may be different in different repository clones, the |
|
339 | numbers may be different in different repository clones, the | |
340 | branch tip may be different in different cloned repositories. |
|
340 | branch tip may be different in different cloned repositories. | |
341 |
|
341 | |||
342 | Update |
|
342 | Update | |
343 | (Noun) Another synonym of changeset. |
|
343 | (Noun) Another synonym of changeset. | |
344 |
|
344 | |||
345 | Example: "I've pushed an update". |
|
345 | Example: "I've pushed an update". | |
346 |
|
346 | |||
347 | (Verb) This term is usually used to describe updating the state of |
|
347 | (Verb) This term is usually used to describe updating the state of | |
348 | the working directory to that of a specific changeset. See |
|
348 | the working directory to that of a specific changeset. See | |
349 | :hg:`help update`. |
|
349 | :hg:`help update`. | |
350 |
|
350 | |||
351 | Example: "You should update". |
|
351 | Example: "You should update". | |
352 |
|
352 | |||
353 | Working directory |
|
353 | Working directory | |
354 | See 'Directory, working'. |
|
354 | See 'Directory, working'. | |
355 |
|
355 | |||
356 | Working directory parent |
|
356 | Working directory parent | |
357 | See 'Parent, working directory'. |
|
357 | See 'Parent, working directory'. |
@@ -1,176 +1,176 | |||||
1 | # transaction.py - simple journalling scheme for mercurial |
|
1 | # transaction.py - simple journalling scheme for mercurial | |
2 | # |
|
2 | # | |
3 | # This transaction scheme is intended to gracefully handle program |
|
3 | # This transaction scheme is intended to gracefully handle program | |
4 | # errors and interruptions. More serious failures like system crashes |
|
4 | # errors and interruptions. More serious failures like system crashes | |
5 | # can be recovered with an fsck-like tool. As the whole repository is |
|
5 | # can be recovered with an fsck-like tool. As the whole repository is | |
6 | # effectively log-structured, this should amount to simply truncating |
|
6 | # effectively log-structured, this should amount to simply truncating | |
7 | # anything that isn't referenced in the changelog. |
|
7 | # anything that isn't referenced in the changelog. | |
8 | # |
|
8 | # | |
9 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
|
9 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> | |
10 | # |
|
10 | # | |
11 | # This software may be used and distributed according to the terms of the |
|
11 | # This software may be used and distributed according to the terms of the | |
12 | # GNU General Public License version 2 or any later version. |
|
12 | # GNU General Public License version 2 or any later version. | |
13 |
|
13 | |||
14 | from i18n import _ |
|
14 | from i18n import _ | |
15 | import os, errno |
|
15 | import os, errno | |
16 | import error |
|
16 | import error | |
17 |
|
17 | |||
18 | def active(func): |
|
18 | def active(func): | |
19 | def _active(self, *args, **kwds): |
|
19 | def _active(self, *args, **kwds): | |
20 | if self.count == 0: |
|
20 | if self.count == 0: | |
21 | raise error.Abort(_( |
|
21 | raise error.Abort(_( | |
22 | 'cannot use transaction when it is already committed/aborted')) |
|
22 | 'cannot use transaction when it is already committed/aborted')) | |
23 | return func(self, *args, **kwds) |
|
23 | return func(self, *args, **kwds) | |
24 | return _active |
|
24 | return _active | |
25 |
|
25 | |||
26 | def _playback(journal, report, opener, entries, unlink=True): |
|
26 | def _playback(journal, report, opener, entries, unlink=True): | |
27 | for f, o, ignore in entries: |
|
27 | for f, o, ignore in entries: | |
28 | if o or not unlink: |
|
28 | if o or not unlink: | |
29 | try: |
|
29 | try: | |
30 | opener(f, 'a').truncate(o) |
|
30 | opener(f, 'a').truncate(o) | |
31 | except IOError: |
|
31 | except IOError: | |
32 | report(_("failed to truncate %s\n") % f) |
|
32 | report(_("failed to truncate %s\n") % f) | |
33 | raise |
|
33 | raise | |
34 | else: |
|
34 | else: | |
35 | try: |
|
35 | try: | |
36 | fn = opener(f).name |
|
36 | fn = opener(f).name | |
37 | os.unlink(fn) |
|
37 | os.unlink(fn) | |
38 | except (IOError, OSError), inst: |
|
38 | except (IOError, OSError), inst: | |
39 | if inst.errno != errno.ENOENT: |
|
39 | if inst.errno != errno.ENOENT: | |
40 | raise |
|
40 | raise | |
41 | os.unlink(journal) |
|
41 | os.unlink(journal) | |
42 |
|
42 | |||
43 | class transaction(object): |
|
43 | class transaction(object): | |
44 | def __init__(self, report, opener, journal, after=None, createmode=None): |
|
44 | def __init__(self, report, opener, journal, after=None, createmode=None): | |
45 | self.count = 1 |
|
45 | self.count = 1 | |
46 | self.usages = 1 |
|
46 | self.usages = 1 | |
47 | self.report = report |
|
47 | self.report = report | |
48 | self.opener = opener |
|
48 | self.opener = opener | |
49 | self.after = after |
|
49 | self.after = after | |
50 | self.entries = [] |
|
50 | self.entries = [] | |
51 | self.map = {} |
|
51 | self.map = {} | |
52 | self.journal = journal |
|
52 | self.journal = journal | |
53 | self._queue = [] |
|
53 | self._queue = [] | |
54 |
|
54 | |||
55 | self.file = open(self.journal, "w") |
|
55 | self.file = open(self.journal, "w") | |
56 | if createmode is not None: |
|
56 | if createmode is not None: | |
57 | os.chmod(self.journal, createmode & 0666) |
|
57 | os.chmod(self.journal, createmode & 0666) | |
58 |
|
58 | |||
59 | def __del__(self): |
|
59 | def __del__(self): | |
60 | if self.journal: |
|
60 | if self.journal: | |
61 | self._abort() |
|
61 | self._abort() | |
62 |
|
62 | |||
63 | @active |
|
63 | @active | |
64 | def startgroup(self): |
|
64 | def startgroup(self): | |
65 | self._queue.append([]) |
|
65 | self._queue.append([]) | |
66 |
|
66 | |||
67 | @active |
|
67 | @active | |
68 | def endgroup(self): |
|
68 | def endgroup(self): | |
69 | q = self._queue.pop() |
|
69 | q = self._queue.pop() | |
70 | d = ''.join(['%s\0%d\n' % (x[0], x[1]) for x in q]) |
|
70 | d = ''.join(['%s\0%d\n' % (x[0], x[1]) for x in q]) | |
71 | self.entries.extend(q) |
|
71 | self.entries.extend(q) | |
72 | self.file.write(d) |
|
72 | self.file.write(d) | |
73 | self.file.flush() |
|
73 | self.file.flush() | |
74 |
|
74 | |||
75 | @active |
|
75 | @active | |
76 | def add(self, file, offset, data=None): |
|
76 | def add(self, file, offset, data=None): | |
77 | if file in self.map: |
|
77 | if file in self.map: | |
78 | return |
|
78 | return | |
79 | if self._queue: |
|
79 | if self._queue: | |
80 | self._queue[-1].append((file, offset, data)) |
|
80 | self._queue[-1].append((file, offset, data)) | |
81 | return |
|
81 | return | |
82 |
|
82 | |||
83 | self.entries.append((file, offset, data)) |
|
83 | self.entries.append((file, offset, data)) | |
84 | self.map[file] = len(self.entries) - 1 |
|
84 | self.map[file] = len(self.entries) - 1 | |
85 | # add enough data to the journal to do the truncate |
|
85 | # add enough data to the journal to do the truncate | |
86 | self.file.write("%s\0%d\n" % (file, offset)) |
|
86 | self.file.write("%s\0%d\n" % (file, offset)) | |
87 | self.file.flush() |
|
87 | self.file.flush() | |
88 |
|
88 | |||
89 | @active |
|
89 | @active | |
90 | def find(self, file): |
|
90 | def find(self, file): | |
91 | if file in self.map: |
|
91 | if file in self.map: | |
92 | return self.entries[self.map[file]] |
|
92 | return self.entries[self.map[file]] | |
93 | return None |
|
93 | return None | |
94 |
|
94 | |||
95 | @active |
|
95 | @active | |
96 | def replace(self, file, offset, data=None): |
|
96 | def replace(self, file, offset, data=None): | |
97 | ''' |
|
97 | ''' | |
98 | replace can only replace already committed entries |
|
98 | replace can only replace already committed entries | |
99 | that are not pending in the queue |
|
99 | that are not pending in the queue | |
100 | ''' |
|
100 | ''' | |
101 |
|
101 | |||
102 | if file not in self.map: |
|
102 | if file not in self.map: | |
103 | raise KeyError(file) |
|
103 | raise KeyError(file) | |
104 | index = self.map[file] |
|
104 | index = self.map[file] | |
105 | self.entries[index] = (file, offset, data) |
|
105 | self.entries[index] = (file, offset, data) | |
106 | self.file.write("%s\0%d\n" % (file, offset)) |
|
106 | self.file.write("%s\0%d\n" % (file, offset)) | |
107 | self.file.flush() |
|
107 | self.file.flush() | |
108 |
|
108 | |||
109 | @active |
|
109 | @active | |
110 | def nest(self): |
|
110 | def nest(self): | |
111 | self.count += 1 |
|
111 | self.count += 1 | |
112 | self.usages += 1 |
|
112 | self.usages += 1 | |
113 | return self |
|
113 | return self | |
114 |
|
114 | |||
115 | def release(self): |
|
115 | def release(self): | |
116 | if self.count > 0: |
|
116 | if self.count > 0: | |
117 | self.usages -= 1 |
|
117 | self.usages -= 1 | |
118 |
# |
|
118 | # if the transaction scopes are left without being closed, fail | |
119 | if self.count > 0 and self.usages == 0: |
|
119 | if self.count > 0 and self.usages == 0: | |
120 | self._abort() |
|
120 | self._abort() | |
121 |
|
121 | |||
122 | def running(self): |
|
122 | def running(self): | |
123 | return self.count > 0 |
|
123 | return self.count > 0 | |
124 |
|
124 | |||
125 | @active |
|
125 | @active | |
126 | def close(self): |
|
126 | def close(self): | |
127 | '''commit the transaction''' |
|
127 | '''commit the transaction''' | |
128 | self.count -= 1 |
|
128 | self.count -= 1 | |
129 | if self.count != 0: |
|
129 | if self.count != 0: | |
130 | return |
|
130 | return | |
131 | self.file.close() |
|
131 | self.file.close() | |
132 | self.entries = [] |
|
132 | self.entries = [] | |
133 | if self.after: |
|
133 | if self.after: | |
134 | self.after() |
|
134 | self.after() | |
135 | if os.path.isfile(self.journal): |
|
135 | if os.path.isfile(self.journal): | |
136 | os.unlink(self.journal) |
|
136 | os.unlink(self.journal) | |
137 | self.journal = None |
|
137 | self.journal = None | |
138 |
|
138 | |||
139 | @active |
|
139 | @active | |
140 | def abort(self): |
|
140 | def abort(self): | |
141 | '''abort the transaction (generally called on error, or when the |
|
141 | '''abort the transaction (generally called on error, or when the | |
142 | transaction is not explicitly committed before going out of |
|
142 | transaction is not explicitly committed before going out of | |
143 | scope)''' |
|
143 | scope)''' | |
144 | self._abort() |
|
144 | self._abort() | |
145 |
|
145 | |||
146 | def _abort(self): |
|
146 | def _abort(self): | |
147 | self.count = 0 |
|
147 | self.count = 0 | |
148 | self.usages = 0 |
|
148 | self.usages = 0 | |
149 | self.file.close() |
|
149 | self.file.close() | |
150 |
|
150 | |||
151 | try: |
|
151 | try: | |
152 | if not self.entries: |
|
152 | if not self.entries: | |
153 | if self.journal: |
|
153 | if self.journal: | |
154 | os.unlink(self.journal) |
|
154 | os.unlink(self.journal) | |
155 | return |
|
155 | return | |
156 |
|
156 | |||
157 | self.report(_("transaction abort!\n")) |
|
157 | self.report(_("transaction abort!\n")) | |
158 |
|
158 | |||
159 | try: |
|
159 | try: | |
160 | _playback(self.journal, self.report, self.opener, |
|
160 | _playback(self.journal, self.report, self.opener, | |
161 | self.entries, False) |
|
161 | self.entries, False) | |
162 | self.report(_("rollback completed\n")) |
|
162 | self.report(_("rollback completed\n")) | |
163 | except: |
|
163 | except: | |
164 | self.report(_("rollback failed - please run hg recover\n")) |
|
164 | self.report(_("rollback failed - please run hg recover\n")) | |
165 | finally: |
|
165 | finally: | |
166 | self.journal = None |
|
166 | self.journal = None | |
167 |
|
167 | |||
168 |
|
168 | |||
169 | def rollback(opener, file, report): |
|
169 | def rollback(opener, file, report): | |
170 | entries = [] |
|
170 | entries = [] | |
171 |
|
171 | |||
172 | for l in open(file).readlines(): |
|
172 | for l in open(file).readlines(): | |
173 | f, o = l.split('\0') |
|
173 | f, o = l.split('\0') | |
174 | entries.append((f, int(o), None)) |
|
174 | entries.append((f, int(o), None)) | |
175 |
|
175 | |||
176 | _playback(file, report, opener, entries) |
|
176 | _playback(file, report, opener, entries) |
@@ -1,306 +1,306 | |||||
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 |
|
6 | |||
7 | - Mercurial [hg] |
|
7 | - Mercurial [hg] | |
8 | - CVS [cvs] |
|
8 | - CVS [cvs] | |
9 | - Darcs [darcs] |
|
9 | - Darcs [darcs] | |
10 | - git [git] |
|
10 | - git [git] | |
11 | - Subversion [svn] |
|
11 | - Subversion [svn] | |
12 | - Monotone [mtn] |
|
12 | - Monotone [mtn] | |
13 | - GNU Arch [gnuarch] |
|
13 | - GNU Arch [gnuarch] | |
14 | - Bazaar [bzr] |
|
14 | - Bazaar [bzr] | |
15 | - Perforce [p4] |
|
15 | - Perforce [p4] | |
16 |
|
16 | |||
17 | Accepted destination formats [identifiers]: |
|
17 | Accepted destination formats [identifiers]: | |
18 |
|
18 | |||
19 | - Mercurial [hg] |
|
19 | - Mercurial [hg] | |
20 | - Subversion [svn] (history on branches is not preserved) |
|
20 | - Subversion [svn] (history on branches is not preserved) | |
21 |
|
21 | |||
22 | If no revision is given, all revisions will be converted. Otherwise, |
|
22 | If no revision is given, all revisions will be converted. Otherwise, | |
23 | convert will only import up to the named revision (given in a format |
|
23 | convert will only import up to the named revision (given in a format | |
24 | understood by the source). |
|
24 | understood by the source). | |
25 |
|
25 | |||
26 | If no destination directory name is specified, it defaults to the basename |
|
26 | If no destination directory name is specified, it defaults to the basename | |
27 | of the source with '-hg' appended. If the destination repository doesn't |
|
27 | of the source with '-hg' appended. If the destination repository doesn't | |
28 | exist, it will be created. |
|
28 | exist, it will be created. | |
29 |
|
29 | |||
30 | By default, all sources except Mercurial will use --branchsort. Mercurial |
|
30 | By default, all sources except Mercurial will use --branchsort. Mercurial | |
31 | uses --sourcesort to preserve original revision numbers order. Sort modes |
|
31 | uses --sourcesort to preserve original revision numbers order. Sort modes | |
32 | have the following effects: |
|
32 | have the following effects: | |
33 |
|
33 | |||
34 | --branchsort convert from parent to child revision when possible, which |
|
34 | --branchsort convert from parent to child revision when possible, which | |
35 | means branches are usually converted one after the other. It |
|
35 | means branches are usually converted one after the other. It | |
36 | generates more compact repositories. |
|
36 | generates more compact repositories. | |
37 | --datesort sort revisions by date. Converted repositories have good- |
|
37 | --datesort sort revisions by date. Converted repositories have good- | |
38 | looking changelogs but are often an order of magnitude |
|
38 | looking changelogs but are often an order of magnitude | |
39 | larger than the same ones generated by --branchsort. |
|
39 | larger than the same ones generated by --branchsort. | |
40 | --sourcesort try to preserve source revisions order, only supported by |
|
40 | --sourcesort try to preserve source revisions order, only supported by | |
41 | Mercurial sources. |
|
41 | Mercurial sources. | |
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 file that |
|
44 | (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file that | |
45 | maps each source commit ID to the destination ID for that revision, like |
|
45 | maps each source commit ID to the destination ID for that revision, like | |
46 | so: |
|
46 | so: | |
47 |
|
47 | |||
48 | <source ID> <destination ID> |
|
48 | <source ID> <destination ID> | |
49 |
|
49 | |||
50 | If the file doesn't exist, it's automatically created. It's updated on |
|
50 | If the file doesn't exist, it's automatically created. It's updated on | |
51 | each commit copied, so convert-repo can be interrupted and can be run |
|
51 | each commit copied, so convert-repo can be interrupted and can be run | |
52 | repeatedly to copy new commits. |
|
52 | repeatedly to copy new commits. | |
53 |
|
53 | |||
54 | The [username mapping] file is a simple text file that maps each source |
|
54 | The [username mapping] file is a simple text file that maps each source | |
55 | commit author to a destination commit author. It is handy for source SCMs |
|
55 | commit author to a destination commit author. It is handy for source SCMs | |
56 | that use unix logins to identify authors (eg: CVS). One line per author |
|
56 | that use unix logins to identify authors (eg: CVS). One line per author | |
57 | mapping and the line format is: srcauthor=whatever string you want |
|
57 | mapping and the line format is: srcauthor=whatever string you want | |
58 |
|
58 | |||
59 | The filemap is a file that allows filtering and remapping of files and |
|
59 | The filemap is a file that allows filtering and remapping of files and | |
60 | directories. Each line can contain one of the following directives: |
|
60 | directories. Each line can contain one of the following directives: | |
61 |
|
61 | |||
62 | include path/to/file-or-dir |
|
62 | include path/to/file-or-dir | |
63 |
|
63 | |||
64 | exclude path/to/file-or-dir |
|
64 | exclude path/to/file-or-dir | |
65 |
|
65 | |||
66 | rename path/to/source path/to/destination |
|
66 | rename path/to/source path/to/destination | |
67 |
|
67 | |||
68 |
Comment lines start with '#'. A specifi |
|
68 | Comment lines start with '#'. A specified path matches if it equals the | |
69 | full relative name of a file or one of its parent directories. The |
|
69 | full relative name of a file or one of its parent directories. The | |
70 | 'include' or 'exclude' directive with the longest matching path applies, |
|
70 | 'include' or 'exclude' directive with the longest matching path applies, | |
71 | so line order does not matter. |
|
71 | so line order does not matter. | |
72 |
|
72 | |||
73 | The 'include' directive causes a file, or all files under a directory, to |
|
73 | The 'include' directive causes a file, or all files under a directory, to | |
74 | be included in the destination repository, and the exclusion of all other |
|
74 | be included in the destination repository, and the exclusion of all other | |
75 | files and directories not explicitly included. The 'exclude' directive |
|
75 | files and directories not explicitly included. The 'exclude' directive | |
76 | causes files or directories to be omitted. The 'rename' directive renames |
|
76 | causes files or directories to be omitted. The 'rename' directive renames | |
77 | a file or directory if is converted. To rename from a subdirectory into |
|
77 | a file or directory if it is converted. To rename from a subdirectory into | |
78 | the root of the repository, use '.' as the path to rename to. |
|
78 | the root of the repository, use '.' as the path to rename to. | |
79 |
|
79 | |||
80 | The splicemap is a file that allows insertion of synthetic history, |
|
80 | The splicemap is a file that allows insertion of synthetic history, | |
81 | letting you specify the parents of a revision. This is useful if you want |
|
81 | letting you specify the parents of a revision. This is useful if you want | |
82 | to e.g. give a Subversion merge two parents, or graft two disconnected |
|
82 | to e.g. give a Subversion merge two parents, or graft two disconnected | |
83 | series of history together. Each entry contains a key, followed by a |
|
83 | series of history together. Each entry contains a key, followed by a | |
84 | space, followed by one or two comma-separated values. The key is the |
|
84 | space, followed by one or two comma-separated values. The key is the | |
85 | revision ID in the source revision control system whose parents should be |
|
85 | revision ID in the source revision control system whose parents should be | |
86 | modified (same format as a key in .hg/shamap). The values are the revision |
|
86 | modified (same format as a key in .hg/shamap). The values are the revision | |
87 | IDs (in either the source or destination revision control system) that |
|
87 | IDs (in either the source or destination revision control system) that | |
88 | should be used as the new parents for that node. For example, if you have |
|
88 | should be used as the new parents for that node. For example, if you have | |
89 | merged "release-1.0" into "trunk", then you should specify the revision on |
|
89 | merged "release-1.0" into "trunk", then you should specify the revision on | |
90 | "trunk" as the first parent and the one on the "release-1.0" branch as the |
|
90 | "trunk" as the first parent and the one on the "release-1.0" branch as the | |
91 | second. |
|
91 | second. | |
92 |
|
92 | |||
93 | The branchmap is a file that allows you to rename a branch when it is |
|
93 | The branchmap is a file that allows you to rename a branch when it is | |
94 | being brought in from whatever external repository. When used in |
|
94 | being brought in from whatever external repository. When used in | |
95 | conjunction with a splicemap, it allows for a powerful combination to help |
|
95 | conjunction with a splicemap, it allows for a powerful combination to help | |
96 | fix even the most badly mismanaged repositories and turn them into nicely |
|
96 | fix even the most badly mismanaged repositories and turn them into nicely | |
97 | structured Mercurial repositories. The branchmap contains lines of the |
|
97 | structured Mercurial repositories. The branchmap contains lines of the | |
98 | form "original_branch_name new_branch_name". "original_branch_name" is the |
|
98 | form "original_branch_name new_branch_name". "original_branch_name" is the | |
99 | name of the branch in the source repository, and "new_branch_name" is the |
|
99 | name of the branch in the source repository, and "new_branch_name" is the | |
100 | name of the branch is the destination repository. This can be used to (for |
|
100 | name of the branch is the destination repository. This can be used to (for | |
101 | instance) move code in one repository from "default" to a named branch. |
|
101 | instance) move code in one repository from "default" to a named branch. | |
102 |
|
102 | |||
103 | Mercurial Source |
|
103 | Mercurial Source | |
104 | ---------------- |
|
104 | ---------------- | |
105 |
|
105 | |||
106 | --config convert.hg.ignoreerrors=False (boolean) |
|
106 | --config convert.hg.ignoreerrors=False (boolean) | |
107 | ignore integrity errors when reading. Use it to fix Mercurial |
|
107 | ignore integrity errors when reading. Use it to fix Mercurial | |
108 | repositories with missing revlogs, by converting from and to |
|
108 | repositories with missing revlogs, by converting from and to | |
109 | Mercurial. |
|
109 | Mercurial. | |
110 |
|
110 | |||
111 | --config convert.hg.saverev=False (boolean) |
|
111 | --config convert.hg.saverev=False (boolean) | |
112 | store original revision ID in changeset (forces target IDs to change) |
|
112 | store original revision ID in changeset (forces target IDs to change) | |
113 |
|
113 | |||
114 | --config convert.hg.startrev=0 (hg revision identifier) |
|
114 | --config convert.hg.startrev=0 (hg revision identifier) | |
115 | convert start revision and its descendants |
|
115 | convert start revision and its descendants | |
116 |
|
116 | |||
117 | CVS Source |
|
117 | CVS Source | |
118 | ---------- |
|
118 | ---------- | |
119 |
|
119 | |||
120 | CVS source will use a sandbox (i.e. a checked-out copy) from CVS to |
|
120 | CVS source will use a sandbox (i.e. a checked-out copy) from CVS to | |
121 | indicate the starting point of what will be converted. Direct access to |
|
121 | indicate the starting point of what will be converted. Direct access to | |
122 | the repository files is not needed, unless of course the repository is |
|
122 | the repository files is not needed, unless of course the repository is | |
123 | :local:. The conversion uses the top level directory in the sandbox to |
|
123 | :local:. The conversion uses the top level directory in the sandbox to | |
124 | find the CVS repository, and then uses CVS rlog commands to find files to |
|
124 | find the CVS repository, and then uses CVS rlog commands to find files to | |
125 | convert. This means that unless a filemap is given, all files under the |
|
125 | convert. This means that unless a filemap is given, all files under the | |
126 | starting directory will be converted, and that any directory |
|
126 | starting directory will be converted, and that any directory | |
127 | reorganization in the CVS sandbox is ignored. |
|
127 | reorganization in the CVS sandbox is ignored. | |
128 |
|
128 | |||
129 | The options shown are the defaults. |
|
129 | The options shown are the defaults. | |
130 |
|
130 | |||
131 | --config convert.cvsps.cache=True (boolean) |
|
131 | --config convert.cvsps.cache=True (boolean) | |
132 | Set to False to disable remote log caching, for testing and debugging |
|
132 | Set to False to disable remote log caching, for testing and debugging | |
133 | purposes. |
|
133 | purposes. | |
134 |
|
134 | |||
135 | --config convert.cvsps.fuzz=60 (integer) |
|
135 | --config convert.cvsps.fuzz=60 (integer) | |
136 | Specify the maximum time (in seconds) that is allowed between commits |
|
136 | Specify the maximum time (in seconds) that is allowed between commits | |
137 | with identical user and log message in a single changeset. When very |
|
137 | with identical user and log message in a single changeset. When very | |
138 | large files were checked in as part of a changeset then the default |
|
138 | large files were checked in as part of a changeset then the default | |
139 | may not be long enough. |
|
139 | may not be long enough. | |
140 |
|
140 | |||
141 | --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}' |
|
141 | --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}' | |
142 | Specify a regular expression to which commit log messages are matched. |
|
142 | Specify a regular expression to which commit log messages are matched. | |
143 | If a match occurs, then the conversion process will insert a dummy |
|
143 | If a match occurs, then the conversion process will insert a dummy | |
144 | revision merging the branch on which this log message occurs to the |
|
144 | revision merging the branch on which this log message occurs to the | |
145 | branch indicated in the regex. |
|
145 | branch indicated in the regex. | |
146 |
|
146 | |||
147 | --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}' |
|
147 | --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}' | |
148 | Specify a regular expression to which commit log messages are matched. |
|
148 | Specify a regular expression to which commit log messages are matched. | |
149 | If a match occurs, then the conversion process will add the most |
|
149 | If a match occurs, then the conversion process will add the most | |
150 | recent revision on the branch indicated in the regex as the second |
|
150 | recent revision on the branch indicated in the regex as the second | |
151 | parent of the changeset. |
|
151 | parent of the changeset. | |
152 |
|
152 | |||
153 | --config hook.cvslog |
|
153 | --config hook.cvslog | |
154 | Specify a Python function to be called at the end of gathering the CVS |
|
154 | Specify a Python function to be called at the end of gathering the CVS | |
155 | log. The function is passed a list with the log entries, and can |
|
155 | log. The function is passed a list with the log entries, and can | |
156 | modify the entries in-place, or add or delete them. |
|
156 | modify the entries in-place, or add or delete them. | |
157 |
|
157 | |||
158 | --config hook.cvschangesets |
|
158 | --config hook.cvschangesets | |
159 | Specify a Python function to be called after the changesets are |
|
159 | Specify a Python function to be called after the changesets are | |
160 | calculated from the the CVS log. The function is passed a list with |
|
160 | calculated from the the CVS log. The function is passed a list with | |
161 | the changeset entries, and can modify the changesets in-place, or add |
|
161 | the changeset entries, and can modify the changesets in-place, or add | |
162 | or delete them. |
|
162 | or delete them. | |
163 |
|
163 | |||
164 | An additional "debugcvsps" Mercurial command allows the builtin changeset |
|
164 | An additional "debugcvsps" Mercurial command allows the builtin changeset | |
165 | merging code to be run without doing a conversion. Its parameters and |
|
165 | merging code to be run without doing a conversion. Its parameters and | |
166 | output are similar to that of cvsps 2.1. Please see the command help for |
|
166 | output are similar to that of cvsps 2.1. Please see the command help for | |
167 | more details. |
|
167 | more details. | |
168 |
|
168 | |||
169 | Subversion Source |
|
169 | Subversion Source | |
170 | ----------------- |
|
170 | ----------------- | |
171 |
|
171 | |||
172 | Subversion source detects classical trunk/branches/tags layouts. By |
|
172 | Subversion source detects classical trunk/branches/tags layouts. By | |
173 | default, the supplied "svn://repo/path/" source URL is converted as a |
|
173 | default, the supplied "svn://repo/path/" source URL is converted as a | |
174 | single branch. If "svn://repo/path/trunk" exists it replaces the default |
|
174 | single branch. If "svn://repo/path/trunk" exists it replaces the default | |
175 | branch. If "svn://repo/path/branches" exists, its subdirectories are |
|
175 | branch. If "svn://repo/path/branches" exists, its subdirectories are | |
176 | listed as possible branches. If "svn://repo/path/tags" exists, it is |
|
176 | listed as possible branches. If "svn://repo/path/tags" exists, it is | |
177 | looked for tags referencing converted branches. Default "trunk", |
|
177 | looked for tags referencing converted branches. Default "trunk", | |
178 | "branches" and "tags" values can be overridden with following options. Set |
|
178 | "branches" and "tags" values can be overridden with following options. Set | |
179 | them to paths relative to the source URL, or leave them blank to disable |
|
179 | them to paths relative to the source URL, or leave them blank to disable | |
180 | auto detection. |
|
180 | auto detection. | |
181 |
|
181 | |||
182 | --config convert.svn.branches=branches (directory name) |
|
182 | --config convert.svn.branches=branches (directory name) | |
183 | specify the directory containing branches |
|
183 | specify the directory containing branches | |
184 |
|
184 | |||
185 | --config convert.svn.tags=tags (directory name) |
|
185 | --config convert.svn.tags=tags (directory name) | |
186 | specify the directory containing tags |
|
186 | specify the directory containing tags | |
187 |
|
187 | |||
188 | --config convert.svn.trunk=trunk (directory name) |
|
188 | --config convert.svn.trunk=trunk (directory name) | |
189 | specify the name of the trunk branch |
|
189 | specify the name of the trunk branch | |
190 |
|
190 | |||
191 | Source history can be retrieved starting at a specific revision, instead |
|
191 | Source history can be retrieved starting at a specific revision, instead | |
192 | of being integrally converted. Only single branch conversions are |
|
192 | of being integrally converted. Only single branch conversions are | |
193 | supported. |
|
193 | supported. | |
194 |
|
194 | |||
195 | --config convert.svn.startrev=0 (svn revision number) |
|
195 | --config convert.svn.startrev=0 (svn revision number) | |
196 | specify start Subversion revision. |
|
196 | specify start Subversion revision. | |
197 |
|
197 | |||
198 | Perforce Source |
|
198 | Perforce Source | |
199 | --------------- |
|
199 | --------------- | |
200 |
|
200 | |||
201 | The Perforce (P4) importer can be given a p4 depot path or a client |
|
201 | The Perforce (P4) importer can be given a p4 depot path or a client | |
202 | specification as source. It will convert all files in the source to a flat |
|
202 | specification as source. It will convert all files in the source to a flat | |
203 | Mercurial repository, ignoring labels, branches and integrations. Note |
|
203 | Mercurial repository, ignoring labels, branches and integrations. Note | |
204 | that when a depot path is given you then usually should specify a target |
|
204 | that when a depot path is given you then usually should specify a target | |
205 | directory, because otherwise the target may be named ...-hg. |
|
205 | directory, because otherwise the target may be named ...-hg. | |
206 |
|
206 | |||
207 | It is possible to limit the amount of source history to be converted by |
|
207 | It is possible to limit the amount of source history to be converted by | |
208 | specifying an initial Perforce revision. |
|
208 | specifying an initial Perforce revision. | |
209 |
|
209 | |||
210 | --config convert.p4.startrev=0 (perforce changelist number) |
|
210 | --config convert.p4.startrev=0 (perforce changelist number) | |
211 | specify initial Perforce revision. |
|
211 | specify initial Perforce revision. | |
212 |
|
212 | |||
213 | Mercurial Destination |
|
213 | Mercurial Destination | |
214 | --------------------- |
|
214 | --------------------- | |
215 |
|
215 | |||
216 | --config convert.hg.clonebranches=False (boolean) |
|
216 | --config convert.hg.clonebranches=False (boolean) | |
217 | dispatch source branches in separate clones. |
|
217 | dispatch source branches in separate clones. | |
218 |
|
218 | |||
219 | --config convert.hg.tagsbranch=default (branch name) |
|
219 | --config convert.hg.tagsbranch=default (branch name) | |
220 | tag revisions branch name |
|
220 | tag revisions branch name | |
221 |
|
221 | |||
222 | --config convert.hg.usebranchnames=True (boolean) |
|
222 | --config convert.hg.usebranchnames=True (boolean) | |
223 | preserve branch names |
|
223 | preserve branch names | |
224 |
|
224 | |||
225 | options: |
|
225 | options: | |
226 |
|
226 | |||
227 | -A --authors FILE username mapping filename |
|
227 | -A --authors FILE username mapping filename | |
228 | -d --dest-type TYPE destination repository type |
|
228 | -d --dest-type TYPE destination repository type | |
229 | --filemap FILE remap file names using contents of file |
|
229 | --filemap FILE remap file names using contents of file | |
230 | -r --rev REV import up to target revision REV |
|
230 | -r --rev REV import up to target revision REV | |
231 | -s --source-type TYPE source repository type |
|
231 | -s --source-type TYPE source repository type | |
232 | --splicemap FILE splice synthesized history into place |
|
232 | --splicemap FILE splice synthesized history into place | |
233 | --branchmap FILE change branch names while converting |
|
233 | --branchmap FILE change branch names while converting | |
234 | --branchsort try to sort changesets by branches |
|
234 | --branchsort try to sort changesets by branches | |
235 | --datesort try to sort changesets by date |
|
235 | --datesort try to sort changesets by date | |
236 | --sourcesort preserve source changesets order |
|
236 | --sourcesort preserve source changesets order | |
237 |
|
237 | |||
238 | use "hg -v help convert" to show global options |
|
238 | use "hg -v help convert" to show global options | |
239 | adding a |
|
239 | adding a | |
240 | assuming destination a-hg |
|
240 | assuming destination a-hg | |
241 | initializing destination a-hg repository |
|
241 | initializing destination a-hg repository | |
242 | scanning source... |
|
242 | scanning source... | |
243 | sorting... |
|
243 | sorting... | |
244 | converting... |
|
244 | converting... | |
245 | 4 a |
|
245 | 4 a | |
246 | 3 b |
|
246 | 3 b | |
247 | 2 c |
|
247 | 2 c | |
248 | 1 d |
|
248 | 1 d | |
249 | 0 e |
|
249 | 0 e | |
250 | pulling from ../a |
|
250 | pulling from ../a | |
251 | searching for changes |
|
251 | searching for changes | |
252 | no changes found |
|
252 | no changes found | |
253 | % should fail |
|
253 | % should fail | |
254 | initializing destination bogusfile repository |
|
254 | initializing destination bogusfile repository | |
255 | abort: cannot create new bundle repository |
|
255 | abort: cannot create new bundle repository | |
256 | % should fail |
|
256 | % should fail | |
257 | abort: Permission denied: bogusdir |
|
257 | abort: Permission denied: bogusdir | |
258 | % should succeed |
|
258 | % should succeed | |
259 | initializing destination bogusdir repository |
|
259 | initializing destination bogusdir repository | |
260 | scanning source... |
|
260 | scanning source... | |
261 | sorting... |
|
261 | sorting... | |
262 | converting... |
|
262 | converting... | |
263 | 4 a |
|
263 | 4 a | |
264 | 3 b |
|
264 | 3 b | |
265 | 2 c |
|
265 | 2 c | |
266 | 1 d |
|
266 | 1 d | |
267 | 0 e |
|
267 | 0 e | |
268 | % test pre and post conversion actions |
|
268 | % test pre and post conversion actions | |
269 | run hg source pre-conversion action |
|
269 | run hg source pre-conversion action | |
270 | run hg sink pre-conversion action |
|
270 | run hg sink pre-conversion action | |
271 | run hg sink post-conversion action |
|
271 | run hg sink post-conversion action | |
272 | run hg source post-conversion action |
|
272 | run hg source post-conversion action | |
273 | % converting empty dir should fail nicely |
|
273 | % converting empty dir should fail nicely | |
274 | assuming destination emptydir-hg |
|
274 | assuming destination emptydir-hg | |
275 | initializing destination emptydir-hg repository |
|
275 | initializing destination emptydir-hg repository | |
276 | emptydir does not look like a CVS checkout |
|
276 | emptydir does not look like a CVS checkout | |
277 | emptydir does not look like a Git repository |
|
277 | emptydir does not look like a Git repository | |
278 | emptydir does not look like a Subversion repository |
|
278 | emptydir does not look like a Subversion repository | |
279 | emptydir is not a local Mercurial repository |
|
279 | emptydir is not a local Mercurial repository | |
280 | emptydir does not look like a darcs repository |
|
280 | emptydir does not look like a darcs repository | |
281 | emptydir does not look like a monotone repository |
|
281 | emptydir does not look like a monotone repository | |
282 | emptydir does not look like a GNU Arch repository |
|
282 | emptydir does not look like a GNU Arch repository | |
283 | emptydir does not look like a Bazaar repository |
|
283 | emptydir does not look like a Bazaar repository | |
284 | cannot find required "p4" tool |
|
284 | cannot find required "p4" tool | |
285 | abort: emptydir: missing or unsupported repository |
|
285 | abort: emptydir: missing or unsupported repository | |
286 | % convert with imaginary source type |
|
286 | % convert with imaginary source type | |
287 | initializing destination a-foo repository |
|
287 | initializing destination a-foo repository | |
288 | abort: foo: invalid source repository type |
|
288 | abort: foo: invalid source repository type | |
289 | % convert with imaginary sink type |
|
289 | % convert with imaginary sink type | |
290 | abort: foo: invalid destination repository type |
|
290 | abort: foo: invalid destination repository type | |
291 |
|
291 | |||
292 | % testing: convert must not produce duplicate entries in fncache |
|
292 | % testing: convert must not produce duplicate entries in fncache | |
293 | initializing destination b repository |
|
293 | initializing destination b repository | |
294 | scanning source... |
|
294 | scanning source... | |
295 | sorting... |
|
295 | sorting... | |
296 | converting... |
|
296 | converting... | |
297 | 4 a |
|
297 | 4 a | |
298 | 3 b |
|
298 | 3 b | |
299 | 2 c |
|
299 | 2 c | |
300 | 1 d |
|
300 | 1 d | |
301 | 0 e |
|
301 | 0 e | |
302 | % contents of fncache file: |
|
302 | % contents of fncache file: | |
303 | data/a.i |
|
303 | data/a.i | |
304 | data/b.i |
|
304 | data/b.i | |
305 | % test bogus URL |
|
305 | % test bogus URL | |
306 | abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository |
|
306 | abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository |
General Comments 0
You need to be logged in to leave comments.
Login now