Mercurial > hg
annotate tests/test-convert.t @ 17474:f85816af6294
obsolete: add a high level function to create an obsolete marker
This function is designed to be used by all code that creates new
obsolete markers in the local repository.
It is not used by debugobsolete because debugobsolete allows the
use of an unknown hash as argument.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 24 Aug 2012 21:16:23 +0200 |
parents | e7cfe3587ea4 |
children | b623e323c561 |
rev | line source |
---|---|
12510 | 1 $ cat >> $HGRCPATH <<EOF |
2 > [extensions] | |
3 > convert= | |
4 > [convert] | |
5 > hg.saverev=False | |
6 > EOF | |
7 $ hg help convert | |
8 hg convert [OPTION]... SOURCE [DEST [REVMAP]] | |
9 | |
10 convert a foreign SCM repository to a Mercurial one. | |
11 | |
12 Accepted source formats [identifiers]: | |
13 | |
14 - Mercurial [hg] | |
15 - CVS [cvs] | |
16 - Darcs [darcs] | |
17 - git [git] | |
18 - Subversion [svn] | |
19 - Monotone [mtn] | |
20 - GNU Arch [gnuarch] | |
21 - Bazaar [bzr] | |
22 - Perforce [p4] | |
23 | |
24 Accepted destination formats [identifiers]: | |
25 | |
26 - Mercurial [hg] | |
27 - Subversion [svn] (history on branches is not preserved) | |
28 | |
29 If no revision is given, all revisions will be converted. Otherwise, | |
30 convert will only import up to the named revision (given in a format | |
31 understood by the source). | |
32 | |
33 If no destination directory name is specified, it defaults to the basename | |
34 of the source with "-hg" appended. If the destination repository doesn't | |
35 exist, it will be created. | |
36 | |
37 By default, all sources except Mercurial will use --branchsort. Mercurial | |
38 uses --sourcesort to preserve original revision numbers order. Sort modes | |
39 have the following effects: | |
40 | |
41 --branchsort convert from parent to child revision when possible, which | |
13011
4936a04b6792
minirst: improved support for option lists.
Erik Zielke <ez@aragost.com>
parents:
12924
diff
changeset
|
42 means branches are usually converted one after the other. |
4936a04b6792
minirst: improved support for option lists.
Erik Zielke <ez@aragost.com>
parents:
12924
diff
changeset
|
43 It generates more compact repositories. |
12510 | 44 --datesort sort revisions by date. Converted repositories have good- |
45 looking changelogs but are often an order of magnitude | |
46 larger than the same ones generated by --branchsort. | |
47 --sourcesort try to preserve source revisions order, only supported by | |
48 Mercurial sources. | |
49 | |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
50 If "REVMAP" isn't given, it will be put in a default location |
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
51 ("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that |
12510 | 52 maps each source commit ID to the destination ID for that revision, like |
53 so: | |
54 | |
55 <source ID> <destination ID> | |
56 | |
57 If the file doesn't exist, it's automatically created. It's updated on | |
58 each commit copied, so "hg convert" can be interrupted and can be run | |
59 repeatedly to copy new commits. | |
60 | |
61 The authormap is a simple text file that maps each source commit author to | |
62 a destination commit author. It is handy for source SCMs that use unix | |
17424
e7cfe3587ea4
fix trivial spelling errors
Mads Kiilerich <mads@kiilerich.com>
parents:
17345
diff
changeset
|
63 logins to identify authors (e.g.: CVS). One line per author mapping and |
e7cfe3587ea4
fix trivial spelling errors
Mads Kiilerich <mads@kiilerich.com>
parents:
17345
diff
changeset
|
64 the line format is: |
12510 | 65 |
66 source author = destination author | |
67 | |
68 Empty lines and lines starting with a "#" are ignored. | |
69 | |
70 The filemap is a file that allows filtering and remapping of files and | |
71 directories. Each line can contain one of the following directives: | |
72 | |
73 include path/to/file-or-dir | |
74 | |
75 exclude path/to/file-or-dir | |
76 | |
77 rename path/to/source path/to/destination | |
78 | |
79 Comment lines start with "#". A specified path matches if it equals the | |
80 full relative name of a file or one of its parent directories. The | |
81 "include" or "exclude" directive with the longest matching path applies, | |
82 so line order does not matter. | |
83 | |
84 The "include" directive causes a file, or all files under a directory, to | |
85 be included in the destination repository, and the exclusion of all other | |
86 files and directories not explicitly included. The "exclude" directive | |
87 causes files or directories to be omitted. The "rename" directive renames | |
88 a file or directory if it is converted. To rename from a subdirectory into | |
89 the root of the repository, use "." as the path to rename to. | |
90 | |
91 The splicemap is a file that allows insertion of synthetic history, | |
92 letting you specify the parents of a revision. This is useful if you want | |
93 to e.g. give a Subversion merge two parents, or graft two disconnected | |
94 series of history together. Each entry contains a key, followed by a | |
95 space, followed by one or two comma-separated values: | |
96 | |
97 key parent1, parent2 | |
98 | |
99 The key is the revision ID in the source revision control system whose | |
100 parents should be modified (same format as a key in .hg/shamap). The | |
101 values are the revision IDs (in either the source or destination revision | |
102 control system) that should be used as the new parents for that node. For | |
103 example, if you have merged "release-1.0" into "trunk", then you should | |
104 specify the revision on "trunk" as the first parent and the one on the | |
105 "release-1.0" branch as the second. | |
106 | |
107 The branchmap is a file that allows you to rename a branch when it is | |
108 being brought in from whatever external repository. When used in | |
109 conjunction with a splicemap, it allows for a powerful combination to help | |
110 fix even the most badly mismanaged repositories and turn them into nicely | |
111 structured Mercurial repositories. The branchmap contains lines of the | |
112 form: | |
113 | |
114 original_branch_name new_branch_name | |
115 | |
116 where "original_branch_name" is the name of the branch in the source | |
117 repository, and "new_branch_name" is the name of the branch is the | |
118 destination repository. No whitespace is allowed in the branch names. This | |
119 can be used to (for instance) move code in one repository from "default" | |
120 to a named branch. | |
121 | |
122 Mercurial Source | |
17267
979b107eaea2
doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17251
diff
changeset
|
123 ################ |
12510 | 124 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
125 The Mercurial source recognizes the following configuration options, which |
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
126 you can set on the command line with "--config": |
12510 | 127 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
128 convert.hg.ignoreerrors |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
129 ignore integrity errors when reading. Use it to fix |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
130 Mercurial repositories with missing revlogs, by converting |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
131 from and to Mercurial. Default is False. |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
132 convert.hg.saverev |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
133 store original revision ID in changeset (forces target IDs |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
134 to change). It takes a boolean argument and defaults to |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
135 False. |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
136 convert.hg.startrev |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
137 convert start revision and its descendants. It takes a hg |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
138 revision identifier and defaults to 0. |
12510 | 139 |
140 CVS Source | |
17267
979b107eaea2
doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17251
diff
changeset
|
141 ########## |
12510 | 142 |
143 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to | |
144 indicate the starting point of what will be converted. Direct access to | |
145 the repository files is not needed, unless of course the repository is | |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
146 ":local:". The conversion uses the top level directory in the sandbox to |
12510 | 147 find the CVS repository, and then uses CVS rlog commands to find files to |
148 convert. This means that unless a filemap is given, all files under the | |
149 starting directory will be converted, and that any directory | |
150 reorganization in the CVS sandbox is ignored. | |
151 | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
152 The following options can be used with "--config": |
12510 | 153 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
154 convert.cvsps.cache |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
155 Set to False to disable remote log caching, for testing and |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
156 debugging purposes. Default is True. |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
157 convert.cvsps.fuzz |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
158 Specify the maximum time (in seconds) that is allowed |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
159 between commits with identical user and log message in a |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
160 single changeset. When very large files were checked in as |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
161 part of a changeset then the default may not be long enough. |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
162 The default is 60. |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
163 convert.cvsps.mergeto |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
164 Specify a regular expression to which commit log messages |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
165 are matched. If a match occurs, then the conversion process |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
166 will insert a dummy revision merging the branch on which |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
167 this log message occurs to the branch indicated in the |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
168 regex. Default is "{{mergetobranch ([-\w]+)}}" |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
169 convert.cvsps.mergefrom |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
170 Specify a regular expression to which commit log messages |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
171 are matched. If a match occurs, then the conversion process |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
172 will add the most recent revision on the branch indicated in |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
173 the regex as the second parent of the changeset. Default is |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
174 "{{mergefrombranch ([-\w]+)}}" |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
175 hook.cvslog Specify a Python function to be called at the end of |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
176 gathering the CVS log. The function is passed a list with |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
177 the log entries, and can modify the entries in-place, or add |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
178 or delete them. |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
179 hook.cvschangesets |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
180 Specify a Python function to be called after the changesets |
17251
98166640b356
help: fix some instances of 'the the'
Mads Kiilerich <mads@kiilerich.com>
parents:
17002
diff
changeset
|
181 are calculated from the CVS log. The function is passed a |
98166640b356
help: fix some instances of 'the the'
Mads Kiilerich <mads@kiilerich.com>
parents:
17002
diff
changeset
|
182 list with the changeset entries, and can modify the |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
183 changesets in-place, or add or delete them. |
12510 | 184 |
185 An additional "debugcvsps" Mercurial command allows the builtin changeset | |
186 merging code to be run without doing a conversion. Its parameters and | |
187 output are similar to that of cvsps 2.1. Please see the command help for | |
188 more details. | |
189 | |
190 Subversion Source | |
17267
979b107eaea2
doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17251
diff
changeset
|
191 ################# |
12510 | 192 |
193 Subversion source detects classical trunk/branches/tags layouts. By | |
194 default, the supplied "svn://repo/path/" source URL is converted as a | |
195 single branch. If "svn://repo/path/trunk" exists it replaces the default | |
196 branch. If "svn://repo/path/branches" exists, its subdirectories are | |
197 listed as possible branches. If "svn://repo/path/tags" exists, it is | |
198 looked for tags referencing converted branches. Default "trunk", | |
199 "branches" and "tags" values can be overridden with following options. Set | |
200 them to paths relative to the source URL, or leave them blank to disable | |
201 auto detection. | |
202 | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
203 The following options can be set with "--config": |
12510 | 204 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
205 convert.svn.branches |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
206 specify the directory containing branches. The default is |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
207 "branches". |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
208 convert.svn.tags |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
209 specify the directory containing tags. The default is |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
210 "tags". |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
211 convert.svn.trunk |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
212 specify the name of the trunk branch. The default is |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
213 "trunk". |
12510 | 214 |
215 Source history can be retrieved starting at a specific revision, instead | |
216 of being integrally converted. Only single branch conversions are | |
217 supported. | |
218 | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
219 convert.svn.startrev |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
220 specify start Subversion revision number. The default is 0. |
12510 | 221 |
222 Perforce Source | |
17267
979b107eaea2
doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17251
diff
changeset
|
223 ############### |
12510 | 224 |
225 The Perforce (P4) importer can be given a p4 depot path or a client | |
226 specification as source. It will convert all files in the source to a flat | |
227 Mercurial repository, ignoring labels, branches and integrations. Note | |
228 that when a depot path is given you then usually should specify a target | |
12924
2f1174b2c4fa
convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents:
12922
diff
changeset
|
229 directory, because otherwise the target may be named "...-hg". |
12510 | 230 |
231 It is possible to limit the amount of source history to be converted by | |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
232 specifying an initial Perforce revision: |
12510 | 233 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
234 convert.p4.startrev |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
235 specify initial Perforce revision (a Perforce changelist |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
236 number). |
12510 | 237 |
238 Mercurial Destination | |
17267
979b107eaea2
doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17251
diff
changeset
|
239 ##################### |
12510 | 240 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
241 The following options are supported: |
12510 | 242 |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
243 convert.hg.clonebranches |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
244 dispatch source branches in separate clones. The default is |
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
245 False. |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
246 convert.hg.tagsbranch |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
247 branch name for tag revisions, defaults to "default". |
12922
58f0c60b7f40
convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents:
12787
diff
changeset
|
248 convert.hg.usebranchnames |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15443
diff
changeset
|
249 preserve branch names. The default is True. |
12510 | 250 |
251 options: | |
252 | |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
253 -s --source-type TYPE source repository type |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
254 -d --dest-type TYPE destination repository type |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
255 -r --rev REV import up to target revision REV |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
256 -A --authormap FILE remap usernames using this file |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
257 --filemap FILE remap file names using contents of file |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
258 --splicemap FILE splice synthesized history into place |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
259 --branchmap FILE change branch names while converting |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
260 --branchsort try to sort changesets by branches |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
261 --datesort try to sort changesets by date |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
13494
diff
changeset
|
262 --sourcesort preserve source changesets order |
12510 | 263 |
15202
0150741caace
help: unify the two -v notes for command help
Matt Mackall <mpm@selenic.com>
parents:
15145
diff
changeset
|
264 use "hg -v help convert" to show more info |
12510 | 265 $ hg init a |
266 $ cd a | |
267 $ echo a > a | |
268 $ hg ci -d'0 0' -Ama | |
269 adding a | |
270 $ hg cp a b | |
271 $ hg ci -d'1 0' -mb | |
272 $ hg rm a | |
273 $ hg ci -d'2 0' -mc | |
274 $ hg mv b a | |
275 $ hg ci -d'3 0' -md | |
276 $ echo a >> a | |
277 $ hg ci -d'4 0' -me | |
278 $ cd .. | |
279 $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded' | |
280 assuming destination a-hg | |
281 initializing destination a-hg repository | |
282 scanning source... | |
283 sorting... | |
284 converting... | |
285 4 a | |
286 3 b | |
287 2 c | |
288 1 d | |
289 0 e | |
290 $ hg --cwd a-hg pull ../a | |
291 pulling from ../a | |
292 searching for changes | |
293 no changes found | |
7905
d596b1f2935a
convert: missing p4 tool is only slightly fatal
Mads Kiilerich <mads@kiilerich.com>
parents:
5805
diff
changeset
|
294 |
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
295 conversion to existing file should fail |
12510 | 296 |
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
297 $ touch bogusfile |
12510 | 298 $ hg convert a bogusfile |
299 initializing destination bogusfile repository | |
300 abort: cannot create new bundle repository | |
301 [255] | |
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
302 |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
303 #if unix-permissions |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
304 |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
305 conversion to dir without permissions should fail |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
306 |
12510 | 307 $ mkdir bogusdir |
308 $ chmod 000 bogusdir | |
309 | |
310 $ hg convert a bogusdir | |
311 abort: Permission denied: bogusdir | |
312 [255] | |
313 | |
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
314 user permissions should succeed |
9962
a7178eccf2dc
convert: better error on invalid repository type
Patrick Mezard <pmezard@gmail.com>
parents:
8674
diff
changeset
|
315 |
12510 | 316 $ chmod 700 bogusdir |
317 $ hg convert a bogusdir | |
318 initializing destination bogusdir repository | |
319 scanning source... | |
320 sorting... | |
321 converting... | |
322 4 a | |
323 3 b | |
324 2 c | |
325 1 d | |
326 0 e | |
327 | |
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
328 #endif |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
329 |
12510 | 330 test pre and post conversion actions |
331 | |
332 $ echo 'include b' > filemap | |
333 $ hg convert --debug --filemap filemap a partialb | \ | |
334 > grep 'run hg' | |
335 run hg source pre-conversion action | |
336 run hg sink pre-conversion action | |
337 run hg sink post-conversion action | |
338 run hg source post-conversion action | |
339 | |
340 converting empty dir should fail "nicely | |
341 | |
342 $ mkdir emptydir | |
343 | |
344 override $PATH to ensure p4 not visible; use $PYTHON in case we're | |
345 running from a devel copy, not a temp installation | |
9962
a7178eccf2dc
convert: better error on invalid repository type
Patrick Mezard <pmezard@gmail.com>
parents:
8674
diff
changeset
|
346 |
12510 | 347 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir |
348 assuming destination emptydir-hg | |
349 initializing destination emptydir-hg repository | |
350 emptydir does not look like a CVS checkout | |
351 emptydir does not look like a Git repository | |
352 emptydir does not look like a Subversion repository | |
353 emptydir is not a local Mercurial repository | |
354 emptydir does not look like a darcs repository | |
355 emptydir does not look like a monotone repository | |
356 emptydir does not look like a GNU Arch repository | |
357 emptydir does not look like a Bazaar repository | |
358 cannot find required "p4" tool | |
359 abort: emptydir: missing or unsupported repository | |
360 [255] | |
361 | |
362 convert with imaginary source type | |
363 | |
364 $ hg convert --source-type foo a a-foo | |
365 initializing destination a-foo repository | |
366 abort: foo: invalid source repository type | |
367 [255] | |
368 | |
369 convert with imaginary sink type | |
10577
d5bd1beff794
store: only add new entries to the fncache file
Adrian Buehlmann <adrian@cadifra.com>
parents:
9962
diff
changeset
|
370 |
12510 | 371 $ hg convert --dest-type foo a a-foo |
372 abort: foo: invalid destination repository type | |
373 [255] | |
374 | |
375 testing: convert must not produce duplicate entries in fncache | |
10885
9e4d120e3c32
convert/subversion: fix default URL checker prototype
Patrick Mezard <pmezard@gmail.com>
parents:
10775
diff
changeset
|
376 |
12510 | 377 $ hg convert a b |
378 initializing destination b repository | |
379 scanning source... | |
380 sorting... | |
381 converting... | |
382 4 a | |
383 3 b | |
384 2 c | |
385 1 d | |
386 0 e | |
387 | |
388 contents of fncache file: | |
389 | |
13389
3efc99ac2ac4
tests: sort fncache
Adrian Buehlmann <adrian@cadifra.com>
parents:
13011
diff
changeset
|
390 $ cat b/.hg/store/fncache | sort |
12510 | 391 data/a.i |
392 data/b.i | |
393 | |
394 test bogus URL | |
395 | |
396 $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz | |
397 abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository | |
398 [255] | |
17002
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
399 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
400 test revset converted() lookup |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
401 |
17345
4f8054d3171b
check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents:
17267
diff
changeset
|
402 $ hg --config convert.hg.saverev=True convert a c |
17002
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
403 initializing destination c repository |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
404 scanning source... |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
405 sorting... |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
406 converting... |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
407 4 a |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
408 3 b |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
409 2 c |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
410 1 d |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
411 0 e |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
412 $ echo f > c/f |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
413 $ hg -R c ci -d'0 0' -Amf |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
414 adding f |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
415 created new head |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
416 $ hg -R c log -r "converted(09d945a62ce6)" |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
417 changeset: 1:98c3dd46a874 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
418 user: test |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
419 date: Thu Jan 01 00:00:01 1970 +0000 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
420 summary: b |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
421 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
422 $ hg -R c log -r "converted()" |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
423 changeset: 0:31ed57b2037c |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
424 user: test |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
425 date: Thu Jan 01 00:00:00 1970 +0000 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
426 summary: a |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
427 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
428 changeset: 1:98c3dd46a874 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
429 user: test |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
430 date: Thu Jan 01 00:00:01 1970 +0000 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
431 summary: b |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
432 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
433 changeset: 2:3b9ca06ef716 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
434 user: test |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
435 date: Thu Jan 01 00:00:02 1970 +0000 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
436 summary: c |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
437 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
438 changeset: 3:4e0debd37cf2 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
439 user: test |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
440 date: Thu Jan 01 00:00:03 1970 +0000 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
441 summary: d |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
442 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
443 changeset: 4:9de3bc9349c5 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
444 user: test |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
445 date: Thu Jan 01 00:00:04 1970 +0000 |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
446 summary: e |
0eb522625eb2
revset: add a predicate for finding converted changesets
Matt Harbison <matt_harbison@yahoo.com>
parents:
16986
diff
changeset
|
447 |