Show More
@@ -1,450 +1,458 b'' | |||
|
1 | 1 | # convert.py Foreign SCM converter |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | '''import revisions from foreign VCS repositories into Mercurial''' |
|
9 | 9 | |
|
10 | import convcmd | |
|
11 | import cvsps | |
|
12 | import subversion | |
|
13 | from mercurial import cmdutil, templatekw | |
|
10 | from __future__ import absolute_import | |
|
11 | ||
|
12 | from mercurial import ( | |
|
13 | cmdutil, | |
|
14 | templatekw, | |
|
15 | ) | |
|
14 | 16 | from mercurial.i18n import _ |
|
15 | 17 | |
|
18 | from . import ( | |
|
19 | convcmd, | |
|
20 | cvsps, | |
|
21 | subversion, | |
|
22 | ) | |
|
23 | ||
|
16 | 24 | cmdtable = {} |
|
17 | 25 | command = cmdutil.command(cmdtable) |
|
18 | 26 | # Note for extension authors: ONLY specify testedwith = 'internal' for |
|
19 | 27 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
20 | 28 | # be specifying the version(s) of Mercurial they are tested with, or |
|
21 | 29 | # leave the attribute unspecified. |
|
22 | 30 | testedwith = 'internal' |
|
23 | 31 | |
|
24 | 32 | # Commands definition was moved elsewhere to ease demandload job. |
|
25 | 33 | |
|
26 | 34 | @command('convert', |
|
27 | 35 | [('', 'authors', '', |
|
28 | 36 | _('username mapping filename (DEPRECATED) (use --authormap instead)'), |
|
29 | 37 | _('FILE')), |
|
30 | 38 | ('s', 'source-type', '', _('source repository type'), _('TYPE')), |
|
31 | 39 | ('d', 'dest-type', '', _('destination repository type'), _('TYPE')), |
|
32 | 40 | ('r', 'rev', [], _('import up to source revision REV'), _('REV')), |
|
33 | 41 | ('A', 'authormap', '', _('remap usernames using this file'), _('FILE')), |
|
34 | 42 | ('', 'filemap', '', _('remap file names using contents of file'), |
|
35 | 43 | _('FILE')), |
|
36 | 44 | ('', 'full', None, |
|
37 | 45 | _('apply filemap changes by converting all files again')), |
|
38 | 46 | ('', 'splicemap', '', _('splice synthesized history into place'), |
|
39 | 47 | _('FILE')), |
|
40 | 48 | ('', 'branchmap', '', _('change branch names while converting'), |
|
41 | 49 | _('FILE')), |
|
42 | 50 | ('', 'branchsort', None, _('try to sort changesets by branches')), |
|
43 | 51 | ('', 'datesort', None, _('try to sort changesets by date')), |
|
44 | 52 | ('', 'sourcesort', None, _('preserve source changesets order')), |
|
45 | 53 | ('', 'closesort', None, _('try to reorder closed revisions'))], |
|
46 | 54 | _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]'), |
|
47 | 55 | norepo=True) |
|
48 | 56 | def convert(ui, src, dest=None, revmapfile=None, **opts): |
|
49 | 57 | """convert a foreign SCM repository to a Mercurial one. |
|
50 | 58 | |
|
51 | 59 | Accepted source formats [identifiers]: |
|
52 | 60 | |
|
53 | 61 | - Mercurial [hg] |
|
54 | 62 | - CVS [cvs] |
|
55 | 63 | - Darcs [darcs] |
|
56 | 64 | - git [git] |
|
57 | 65 | - Subversion [svn] |
|
58 | 66 | - Monotone [mtn] |
|
59 | 67 | - GNU Arch [gnuarch] |
|
60 | 68 | - Bazaar [bzr] |
|
61 | 69 | - Perforce [p4] |
|
62 | 70 | |
|
63 | 71 | Accepted destination formats [identifiers]: |
|
64 | 72 | |
|
65 | 73 | - Mercurial [hg] |
|
66 | 74 | - Subversion [svn] (history on branches is not preserved) |
|
67 | 75 | |
|
68 | 76 | If no revision is given, all revisions will be converted. |
|
69 | 77 | Otherwise, convert will only import up to the named revision |
|
70 | 78 | (given in a format understood by the source). |
|
71 | 79 | |
|
72 | 80 | If no destination directory name is specified, it defaults to the |
|
73 | 81 | basename of the source with ``-hg`` appended. If the destination |
|
74 | 82 | repository doesn't exist, it will be created. |
|
75 | 83 | |
|
76 | 84 | By default, all sources except Mercurial will use --branchsort. |
|
77 | 85 | Mercurial uses --sourcesort to preserve original revision numbers |
|
78 | 86 | order. Sort modes have the following effects: |
|
79 | 87 | |
|
80 | 88 | --branchsort convert from parent to child revision when possible, |
|
81 | 89 | which means branches are usually converted one after |
|
82 | 90 | the other. It generates more compact repositories. |
|
83 | 91 | |
|
84 | 92 | --datesort sort revisions by date. Converted repositories have |
|
85 | 93 | good-looking changelogs but are often an order of |
|
86 | 94 | magnitude larger than the same ones generated by |
|
87 | 95 | --branchsort. |
|
88 | 96 | |
|
89 | 97 | --sourcesort try to preserve source revisions order, only |
|
90 | 98 | supported by Mercurial sources. |
|
91 | 99 | |
|
92 | 100 | --closesort try to move closed revisions as close as possible |
|
93 | 101 | to parent branches, only supported by Mercurial |
|
94 | 102 | sources. |
|
95 | 103 | |
|
96 | 104 | If ``REVMAP`` isn't given, it will be put in a default location |
|
97 | 105 | (``<dest>/.hg/shamap`` by default). The ``REVMAP`` is a simple |
|
98 | 106 | text file that maps each source commit ID to the destination ID |
|
99 | 107 | for that revision, like so:: |
|
100 | 108 | |
|
101 | 109 | <source ID> <destination ID> |
|
102 | 110 | |
|
103 | 111 | If the file doesn't exist, it's automatically created. It's |
|
104 | 112 | updated on each commit copied, so :hg:`convert` can be interrupted |
|
105 | 113 | and can be run repeatedly to copy new commits. |
|
106 | 114 | |
|
107 | 115 | The authormap is a simple text file that maps each source commit |
|
108 | 116 | author to a destination commit author. It is handy for source SCMs |
|
109 | 117 | that use unix logins to identify authors (e.g.: CVS). One line per |
|
110 | 118 | author mapping and the line format is:: |
|
111 | 119 | |
|
112 | 120 | source author = destination author |
|
113 | 121 | |
|
114 | 122 | Empty lines and lines starting with a ``#`` are ignored. |
|
115 | 123 | |
|
116 | 124 | The filemap is a file that allows filtering and remapping of files |
|
117 | 125 | and directories. Each line can contain one of the following |
|
118 | 126 | directives:: |
|
119 | 127 | |
|
120 | 128 | include path/to/file-or-dir |
|
121 | 129 | |
|
122 | 130 | exclude path/to/file-or-dir |
|
123 | 131 | |
|
124 | 132 | rename path/to/source path/to/destination |
|
125 | 133 | |
|
126 | 134 | Comment lines start with ``#``. A specified path matches if it |
|
127 | 135 | equals the full relative name of a file or one of its parent |
|
128 | 136 | directories. The ``include`` or ``exclude`` directive with the |
|
129 | 137 | longest matching path applies, so line order does not matter. |
|
130 | 138 | |
|
131 | 139 | The ``include`` directive causes a file, or all files under a |
|
132 | 140 | directory, to be included in the destination repository. The default |
|
133 | 141 | if there are no ``include`` statements is to include everything. |
|
134 | 142 | If there are any ``include`` statements, nothing else is included. |
|
135 | 143 | The ``exclude`` directive causes files or directories to |
|
136 | 144 | be omitted. The ``rename`` directive renames a file or directory if |
|
137 | 145 | it is converted. To rename from a subdirectory into the root of |
|
138 | 146 | the repository, use ``.`` as the path to rename to. |
|
139 | 147 | |
|
140 | 148 | ``--full`` will make sure the converted changesets contain exactly |
|
141 | 149 | the right files with the right content. It will make a full |
|
142 | 150 | conversion of all files, not just the ones that have |
|
143 | 151 | changed. Files that already are correct will not be changed. This |
|
144 | 152 | can be used to apply filemap changes when converting |
|
145 | 153 | incrementally. This is currently only supported for Mercurial and |
|
146 | 154 | Subversion. |
|
147 | 155 | |
|
148 | 156 | The splicemap is a file that allows insertion of synthetic |
|
149 | 157 | history, letting you specify the parents of a revision. This is |
|
150 | 158 | useful if you want to e.g. give a Subversion merge two parents, or |
|
151 | 159 | graft two disconnected series of history together. Each entry |
|
152 | 160 | contains a key, followed by a space, followed by one or two |
|
153 | 161 | comma-separated values:: |
|
154 | 162 | |
|
155 | 163 | key parent1, parent2 |
|
156 | 164 | |
|
157 | 165 | The key is the revision ID in the source |
|
158 | 166 | revision control system whose parents should be modified (same |
|
159 | 167 | format as a key in .hg/shamap). The values are the revision IDs |
|
160 | 168 | (in either the source or destination revision control system) that |
|
161 | 169 | should be used as the new parents for that node. For example, if |
|
162 | 170 | you have merged "release-1.0" into "trunk", then you should |
|
163 | 171 | specify the revision on "trunk" as the first parent and the one on |
|
164 | 172 | the "release-1.0" branch as the second. |
|
165 | 173 | |
|
166 | 174 | The branchmap is a file that allows you to rename a branch when it is |
|
167 | 175 | being brought in from whatever external repository. When used in |
|
168 | 176 | conjunction with a splicemap, it allows for a powerful combination |
|
169 | 177 | to help fix even the most badly mismanaged repositories and turn them |
|
170 | 178 | into nicely structured Mercurial repositories. The branchmap contains |
|
171 | 179 | lines of the form:: |
|
172 | 180 | |
|
173 | 181 | original_branch_name new_branch_name |
|
174 | 182 | |
|
175 | 183 | where "original_branch_name" is the name of the branch in the |
|
176 | 184 | source repository, and "new_branch_name" is the name of the branch |
|
177 | 185 | is the destination repository. No whitespace is allowed in the |
|
178 | 186 | branch names. This can be used to (for instance) move code in one |
|
179 | 187 | repository from "default" to a named branch. |
|
180 | 188 | |
|
181 | 189 | Mercurial Source |
|
182 | 190 | ################ |
|
183 | 191 | |
|
184 | 192 | The Mercurial source recognizes the following configuration |
|
185 | 193 | options, which you can set on the command line with ``--config``: |
|
186 | 194 | |
|
187 | 195 | :convert.hg.ignoreerrors: ignore integrity errors when reading. |
|
188 | 196 | Use it to fix Mercurial repositories with missing revlogs, by |
|
189 | 197 | converting from and to Mercurial. Default is False. |
|
190 | 198 | |
|
191 | 199 | :convert.hg.saverev: store original revision ID in changeset |
|
192 | 200 | (forces target IDs to change). It takes a boolean argument and |
|
193 | 201 | defaults to False. |
|
194 | 202 | |
|
195 | 203 | :convert.hg.startrev: specify the initial Mercurial revision. |
|
196 | 204 | The default is 0. |
|
197 | 205 | |
|
198 | 206 | :convert.hg.revs: revset specifying the source revisions to convert. |
|
199 | 207 | |
|
200 | 208 | CVS Source |
|
201 | 209 | ########## |
|
202 | 210 | |
|
203 | 211 | CVS source will use a sandbox (i.e. a checked-out copy) from CVS |
|
204 | 212 | to indicate the starting point of what will be converted. Direct |
|
205 | 213 | access to the repository files is not needed, unless of course the |
|
206 | 214 | repository is ``:local:``. The conversion uses the top level |
|
207 | 215 | directory in the sandbox to find the CVS repository, and then uses |
|
208 | 216 | CVS rlog commands to find files to convert. This means that unless |
|
209 | 217 | a filemap is given, all files under the starting directory will be |
|
210 | 218 | converted, and that any directory reorganization in the CVS |
|
211 | 219 | sandbox is ignored. |
|
212 | 220 | |
|
213 | 221 | The following options can be used with ``--config``: |
|
214 | 222 | |
|
215 | 223 | :convert.cvsps.cache: Set to False to disable remote log caching, |
|
216 | 224 | for testing and debugging purposes. Default is True. |
|
217 | 225 | |
|
218 | 226 | :convert.cvsps.fuzz: Specify the maximum time (in seconds) that is |
|
219 | 227 | allowed between commits with identical user and log message in |
|
220 | 228 | a single changeset. When very large files were checked in as |
|
221 | 229 | part of a changeset then the default may not be long enough. |
|
222 | 230 | The default is 60. |
|
223 | 231 | |
|
224 | 232 | :convert.cvsps.mergeto: Specify a regular expression to which |
|
225 | 233 | commit log messages are matched. If a match occurs, then the |
|
226 | 234 | conversion process will insert a dummy revision merging the |
|
227 | 235 | branch on which this log message occurs to the branch |
|
228 | 236 | indicated in the regex. Default is ``{{mergetobranch |
|
229 | 237 | ([-\\w]+)}}`` |
|
230 | 238 | |
|
231 | 239 | :convert.cvsps.mergefrom: Specify a regular expression to which |
|
232 | 240 | commit log messages are matched. If a match occurs, then the |
|
233 | 241 | conversion process will add the most recent revision on the |
|
234 | 242 | branch indicated in the regex as the second parent of the |
|
235 | 243 | changeset. Default is ``{{mergefrombranch ([-\\w]+)}}`` |
|
236 | 244 | |
|
237 | 245 | :convert.localtimezone: use local time (as determined by the TZ |
|
238 | 246 | environment variable) for changeset date/times. The default |
|
239 | 247 | is False (use UTC). |
|
240 | 248 | |
|
241 | 249 | :hooks.cvslog: Specify a Python function to be called at the end of |
|
242 | 250 | gathering the CVS log. The function is passed a list with the |
|
243 | 251 | log entries, and can modify the entries in-place, or add or |
|
244 | 252 | delete them. |
|
245 | 253 | |
|
246 | 254 | :hooks.cvschangesets: Specify a Python function to be called after |
|
247 | 255 | the changesets are calculated from the CVS log. The |
|
248 | 256 | function is passed a list with the changeset entries, and can |
|
249 | 257 | modify the changesets in-place, or add or delete them. |
|
250 | 258 | |
|
251 | 259 | An additional "debugcvsps" Mercurial command allows the builtin |
|
252 | 260 | changeset merging code to be run without doing a conversion. Its |
|
253 | 261 | parameters and output are similar to that of cvsps 2.1. Please see |
|
254 | 262 | the command help for more details. |
|
255 | 263 | |
|
256 | 264 | Subversion Source |
|
257 | 265 | ################# |
|
258 | 266 | |
|
259 | 267 | Subversion source detects classical trunk/branches/tags layouts. |
|
260 | 268 | By default, the supplied ``svn://repo/path/`` source URL is |
|
261 | 269 | converted as a single branch. If ``svn://repo/path/trunk`` exists |
|
262 | 270 | it replaces the default branch. If ``svn://repo/path/branches`` |
|
263 | 271 | exists, its subdirectories are listed as possible branches. If |
|
264 | 272 | ``svn://repo/path/tags`` exists, it is looked for tags referencing |
|
265 | 273 | converted branches. Default ``trunk``, ``branches`` and ``tags`` |
|
266 | 274 | values can be overridden with following options. Set them to paths |
|
267 | 275 | relative to the source URL, or leave them blank to disable auto |
|
268 | 276 | detection. |
|
269 | 277 | |
|
270 | 278 | The following options can be set with ``--config``: |
|
271 | 279 | |
|
272 | 280 | :convert.svn.branches: specify the directory containing branches. |
|
273 | 281 | The default is ``branches``. |
|
274 | 282 | |
|
275 | 283 | :convert.svn.tags: specify the directory containing tags. The |
|
276 | 284 | default is ``tags``. |
|
277 | 285 | |
|
278 | 286 | :convert.svn.trunk: specify the name of the trunk branch. The |
|
279 | 287 | default is ``trunk``. |
|
280 | 288 | |
|
281 | 289 | :convert.localtimezone: use local time (as determined by the TZ |
|
282 | 290 | environment variable) for changeset date/times. The default |
|
283 | 291 | is False (use UTC). |
|
284 | 292 | |
|
285 | 293 | Source history can be retrieved starting at a specific revision, |
|
286 | 294 | instead of being integrally converted. Only single branch |
|
287 | 295 | conversions are supported. |
|
288 | 296 | |
|
289 | 297 | :convert.svn.startrev: specify start Subversion revision number. |
|
290 | 298 | The default is 0. |
|
291 | 299 | |
|
292 | 300 | Git Source |
|
293 | 301 | ########## |
|
294 | 302 | |
|
295 | 303 | The Git importer converts commits from all reachable branches (refs |
|
296 | 304 | in refs/heads) and remotes (refs in refs/remotes) to Mercurial. |
|
297 | 305 | Branches are converted to bookmarks with the same name, with the |
|
298 | 306 | leading 'refs/heads' stripped. Git submodules are converted to Git |
|
299 | 307 | subrepos in Mercurial. |
|
300 | 308 | |
|
301 | 309 | The following options can be set with ``--config``: |
|
302 | 310 | |
|
303 | 311 | :convert.git.similarity: specify how similar files modified in a |
|
304 | 312 | commit must be to be imported as renames or copies, as a |
|
305 | 313 | percentage between ``0`` (disabled) and ``100`` (files must be |
|
306 | 314 | identical). For example, ``90`` means that a delete/add pair will |
|
307 | 315 | be imported as a rename if more than 90% of the file hasn't |
|
308 | 316 | changed. The default is ``50``. |
|
309 | 317 | |
|
310 | 318 | :convert.git.findcopiesharder: while detecting copies, look at all |
|
311 | 319 | files in the working copy instead of just changed ones. This |
|
312 | 320 | is very expensive for large projects, and is only effective when |
|
313 | 321 | ``convert.git.similarity`` is greater than 0. The default is False. |
|
314 | 322 | |
|
315 | 323 | :convert.git.remoteprefix: remote refs are converted as bookmarks with |
|
316 | 324 | ``convert.git.remoteprefix`` as a prefix followed by a /. The default |
|
317 | 325 | is 'remote'. |
|
318 | 326 | |
|
319 | 327 | :convert.git.skipsubmodules: does not convert root level .gitmodules files |
|
320 | 328 | or files with 160000 mode indicating a submodule. Default is False. |
|
321 | 329 | |
|
322 | 330 | Perforce Source |
|
323 | 331 | ############### |
|
324 | 332 | |
|
325 | 333 | The Perforce (P4) importer can be given a p4 depot path or a |
|
326 | 334 | client specification as source. It will convert all files in the |
|
327 | 335 | source to a flat Mercurial repository, ignoring labels, branches |
|
328 | 336 | and integrations. Note that when a depot path is given you then |
|
329 | 337 | usually should specify a target directory, because otherwise the |
|
330 | 338 | target may be named ``...-hg``. |
|
331 | 339 | |
|
332 | 340 | The following options can be set with ``--config``: |
|
333 | 341 | |
|
334 | 342 | :convert.p4.encoding: specify the encoding to use when decoding standard |
|
335 | 343 | output of the Perforce command line tool. The default is default system |
|
336 | 344 | encoding. |
|
337 | 345 | |
|
338 | 346 | :convert.p4.startrev: specify initial Perforce revision (a |
|
339 | 347 | Perforce changelist number). |
|
340 | 348 | |
|
341 | 349 | Mercurial Destination |
|
342 | 350 | ##################### |
|
343 | 351 | |
|
344 | 352 | The Mercurial destination will recognize Mercurial subrepositories in the |
|
345 | 353 | destination directory, and update the .hgsubstate file automatically if the |
|
346 | 354 | destination subrepositories contain the <dest>/<sub>/.hg/shamap file. |
|
347 | 355 | Converting a repository with subrepositories requires converting a single |
|
348 | 356 | repository at a time, from the bottom up. |
|
349 | 357 | |
|
350 | 358 | .. container:: verbose |
|
351 | 359 | |
|
352 | 360 | An example showing how to convert a repository with subrepositories:: |
|
353 | 361 | |
|
354 | 362 | # so convert knows the type when it sees a non empty destination |
|
355 | 363 | $ hg init converted |
|
356 | 364 | |
|
357 | 365 | $ hg convert orig/sub1 converted/sub1 |
|
358 | 366 | $ hg convert orig/sub2 converted/sub2 |
|
359 | 367 | $ hg convert orig converted |
|
360 | 368 | |
|
361 | 369 | The following options are supported: |
|
362 | 370 | |
|
363 | 371 | :convert.hg.clonebranches: dispatch source branches in separate |
|
364 | 372 | clones. The default is False. |
|
365 | 373 | |
|
366 | 374 | :convert.hg.tagsbranch: branch name for tag revisions, defaults to |
|
367 | 375 | ``default``. |
|
368 | 376 | |
|
369 | 377 | :convert.hg.usebranchnames: preserve branch names. The default is |
|
370 | 378 | True. |
|
371 | 379 | |
|
372 | 380 | :convert.hg.sourcename: records the given string as a 'convert_source' extra |
|
373 | 381 | value on each commit made in the target repository. The default is None. |
|
374 | 382 | |
|
375 | 383 | All Destinations |
|
376 | 384 | ################ |
|
377 | 385 | |
|
378 | 386 | All destination types accept the following options: |
|
379 | 387 | |
|
380 | 388 | :convert.skiptags: does not convert tags from the source repo to the target |
|
381 | 389 | repo. The default is False. |
|
382 | 390 | """ |
|
383 | 391 | return convcmd.convert(ui, src, dest, revmapfile, **opts) |
|
384 | 392 | |
|
385 | 393 | @command('debugsvnlog', [], 'hg debugsvnlog', norepo=True) |
|
386 | 394 | def debugsvnlog(ui, **opts): |
|
387 | 395 | return subversion.debugsvnlog(ui, **opts) |
|
388 | 396 | |
|
389 | 397 | @command('debugcvsps', |
|
390 | 398 | [ |
|
391 | 399 | # Main options shared with cvsps-2.1 |
|
392 | 400 | ('b', 'branches', [], _('only return changes on specified branches')), |
|
393 | 401 | ('p', 'prefix', '', _('prefix to remove from file names')), |
|
394 | 402 | ('r', 'revisions', [], |
|
395 | 403 | _('only return changes after or between specified tags')), |
|
396 | 404 | ('u', 'update-cache', None, _("update cvs log cache")), |
|
397 | 405 | ('x', 'new-cache', None, _("create new cvs log cache")), |
|
398 | 406 | ('z', 'fuzz', 60, _('set commit time fuzz in seconds')), |
|
399 | 407 | ('', 'root', '', _('specify cvsroot')), |
|
400 | 408 | # Options specific to builtin cvsps |
|
401 | 409 | ('', 'parents', '', _('show parent changesets')), |
|
402 | 410 | ('', 'ancestors', '', _('show current changeset in ancestor branches')), |
|
403 | 411 | # Options that are ignored for compatibility with cvsps-2.1 |
|
404 | 412 | ('A', 'cvs-direct', None, _('ignored for compatibility')), |
|
405 | 413 | ], |
|
406 | 414 | _('hg debugcvsps [OPTION]... [PATH]...'), |
|
407 | 415 | norepo=True) |
|
408 | 416 | def debugcvsps(ui, *args, **opts): |
|
409 | 417 | '''create changeset information from CVS |
|
410 | 418 | |
|
411 | 419 | This command is intended as a debugging tool for the CVS to |
|
412 | 420 | Mercurial converter, and can be used as a direct replacement for |
|
413 | 421 | cvsps. |
|
414 | 422 | |
|
415 | 423 | Hg debugcvsps reads the CVS rlog for current directory (or any |
|
416 | 424 | named directory) in the CVS repository, and converts the log to a |
|
417 | 425 | series of changesets based on matching commit log entries and |
|
418 | 426 | dates.''' |
|
419 | 427 | return cvsps.debugcvsps(ui, *args, **opts) |
|
420 | 428 | |
|
421 | 429 | def kwconverted(ctx, name): |
|
422 | 430 | rev = ctx.extra().get('convert_revision', '') |
|
423 | 431 | if rev.startswith('svn:'): |
|
424 | 432 | if name == 'svnrev': |
|
425 | 433 | return str(subversion.revsplit(rev)[2]) |
|
426 | 434 | elif name == 'svnpath': |
|
427 | 435 | return subversion.revsplit(rev)[1] |
|
428 | 436 | elif name == 'svnuuid': |
|
429 | 437 | return subversion.revsplit(rev)[0] |
|
430 | 438 | return rev |
|
431 | 439 | |
|
432 | 440 | def kwsvnrev(repo, ctx, **args): |
|
433 | 441 | """:svnrev: String. Converted subversion revision number.""" |
|
434 | 442 | return kwconverted(ctx, 'svnrev') |
|
435 | 443 | |
|
436 | 444 | def kwsvnpath(repo, ctx, **args): |
|
437 | 445 | """:svnpath: String. Converted subversion revision project path.""" |
|
438 | 446 | return kwconverted(ctx, 'svnpath') |
|
439 | 447 | |
|
440 | 448 | def kwsvnuuid(repo, ctx, **args): |
|
441 | 449 | """:svnuuid: String. Converted subversion revision repository identifier.""" |
|
442 | 450 | return kwconverted(ctx, 'svnuuid') |
|
443 | 451 | |
|
444 | 452 | def extsetup(ui): |
|
445 | 453 | templatekw.keywords['svnrev'] = kwsvnrev |
|
446 | 454 | templatekw.keywords['svnpath'] = kwsvnpath |
|
447 | 455 | templatekw.keywords['svnuuid'] = kwsvnuuid |
|
448 | 456 | |
|
449 | 457 | # tell hggettext to extract docstrings from these functions: |
|
450 | 458 | i18nfunctions = [kwsvnrev, kwsvnpath, kwsvnuuid] |
@@ -1,133 +1,132 b'' | |||
|
1 | 1 | #require test-repo |
|
2 | 2 | |
|
3 | 3 | $ cd "$TESTDIR"/.. |
|
4 | 4 | |
|
5 | 5 | $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py |
|
6 | 6 | contrib/check-code.py not using absolute_import |
|
7 | 7 | contrib/check-code.py requires print_function |
|
8 | 8 | contrib/debugshell.py not using absolute_import |
|
9 | 9 | contrib/import-checker.py not using absolute_import |
|
10 | 10 | contrib/import-checker.py requires print_function |
|
11 | 11 | contrib/memory.py not using absolute_import |
|
12 | 12 | contrib/perf.py not using absolute_import |
|
13 | 13 | contrib/python-hook-examples.py not using absolute_import |
|
14 | 14 | contrib/revsetbenchmarks.py not using absolute_import |
|
15 | 15 | contrib/revsetbenchmarks.py requires print_function |
|
16 | 16 | contrib/showstack.py not using absolute_import |
|
17 | 17 | contrib/synthrepo.py not using absolute_import |
|
18 | 18 | contrib/win32/hgwebdir_wsgi.py not using absolute_import |
|
19 | 19 | doc/check-seclevel.py not using absolute_import |
|
20 | 20 | doc/gendoc.py not using absolute_import |
|
21 | 21 | doc/hgmanpage.py not using absolute_import |
|
22 | 22 | hgext/__init__.py not using absolute_import |
|
23 | 23 | hgext/color.py not using absolute_import |
|
24 | hgext/convert/__init__.py not using absolute_import | |
|
25 | 24 | hgext/eol.py not using absolute_import |
|
26 | 25 | hgext/extdiff.py not using absolute_import |
|
27 | 26 | hgext/factotum.py not using absolute_import |
|
28 | 27 | hgext/fetch.py not using absolute_import |
|
29 | 28 | hgext/gpg.py not using absolute_import |
|
30 | 29 | hgext/graphlog.py not using absolute_import |
|
31 | 30 | hgext/hgcia.py not using absolute_import |
|
32 | 31 | hgext/hgk.py not using absolute_import |
|
33 | 32 | hgext/highlight/__init__.py not using absolute_import |
|
34 | 33 | hgext/highlight/highlight.py not using absolute_import |
|
35 | 34 | hgext/histedit.py not using absolute_import |
|
36 | 35 | hgext/largefiles/__init__.py not using absolute_import |
|
37 | 36 | hgext/largefiles/basestore.py not using absolute_import |
|
38 | 37 | hgext/largefiles/lfcommands.py not using absolute_import |
|
39 | 38 | hgext/largefiles/lfutil.py not using absolute_import |
|
40 | 39 | hgext/largefiles/localstore.py not using absolute_import |
|
41 | 40 | hgext/largefiles/overrides.py not using absolute_import |
|
42 | 41 | hgext/largefiles/proto.py not using absolute_import |
|
43 | 42 | hgext/largefiles/remotestore.py not using absolute_import |
|
44 | 43 | hgext/largefiles/reposetup.py not using absolute_import |
|
45 | 44 | hgext/largefiles/uisetup.py not using absolute_import |
|
46 | 45 | hgext/largefiles/wirestore.py not using absolute_import |
|
47 | 46 | hgext/mq.py not using absolute_import |
|
48 | 47 | hgext/notify.py not using absolute_import |
|
49 | 48 | hgext/patchbomb.py not using absolute_import |
|
50 | 49 | hgext/rebase.py not using absolute_import |
|
51 | 50 | hgext/share.py not using absolute_import |
|
52 | 51 | hgext/transplant.py not using absolute_import |
|
53 | 52 | hgext/win32mbcs.py not using absolute_import |
|
54 | 53 | hgext/win32text.py not using absolute_import |
|
55 | 54 | i18n/check-translation.py not using absolute_import |
|
56 | 55 | i18n/polib.py not using absolute_import |
|
57 | 56 | setup.py not using absolute_import |
|
58 | 57 | tests/filterpyflakes.py requires print_function |
|
59 | 58 | tests/generate-working-copy-states.py requires print_function |
|
60 | 59 | tests/get-with-headers.py requires print_function |
|
61 | 60 | tests/heredoctest.py requires print_function |
|
62 | 61 | tests/hypothesishelpers.py not using absolute_import |
|
63 | 62 | tests/hypothesishelpers.py requires print_function |
|
64 | 63 | tests/killdaemons.py not using absolute_import |
|
65 | 64 | tests/md5sum.py not using absolute_import |
|
66 | 65 | tests/mockblackbox.py not using absolute_import |
|
67 | 66 | tests/printenv.py not using absolute_import |
|
68 | 67 | tests/readlink.py not using absolute_import |
|
69 | 68 | tests/readlink.py requires print_function |
|
70 | 69 | tests/revlog-formatv0.py not using absolute_import |
|
71 | 70 | tests/run-tests.py not using absolute_import |
|
72 | 71 | tests/seq.py not using absolute_import |
|
73 | 72 | tests/seq.py requires print_function |
|
74 | 73 | tests/silenttestrunner.py not using absolute_import |
|
75 | 74 | tests/silenttestrunner.py requires print_function |
|
76 | 75 | tests/sitecustomize.py not using absolute_import |
|
77 | 76 | tests/svn-safe-append.py not using absolute_import |
|
78 | 77 | tests/svnxml.py not using absolute_import |
|
79 | 78 | tests/test-ancestor.py requires print_function |
|
80 | 79 | tests/test-atomictempfile.py not using absolute_import |
|
81 | 80 | tests/test-batching.py not using absolute_import |
|
82 | 81 | tests/test-batching.py requires print_function |
|
83 | 82 | tests/test-bdiff.py not using absolute_import |
|
84 | 83 | tests/test-bdiff.py requires print_function |
|
85 | 84 | tests/test-context.py not using absolute_import |
|
86 | 85 | tests/test-context.py requires print_function |
|
87 | 86 | tests/test-demandimport.py not using absolute_import |
|
88 | 87 | tests/test-demandimport.py requires print_function |
|
89 | 88 | tests/test-doctest.py not using absolute_import |
|
90 | 89 | tests/test-duplicateoptions.py not using absolute_import |
|
91 | 90 | tests/test-duplicateoptions.py requires print_function |
|
92 | 91 | tests/test-filecache.py not using absolute_import |
|
93 | 92 | tests/test-filecache.py requires print_function |
|
94 | 93 | tests/test-filelog.py not using absolute_import |
|
95 | 94 | tests/test-filelog.py requires print_function |
|
96 | 95 | tests/test-hg-parseurl.py not using absolute_import |
|
97 | 96 | tests/test-hg-parseurl.py requires print_function |
|
98 | 97 | tests/test-hgweb-auth.py not using absolute_import |
|
99 | 98 | tests/test-hgweb-auth.py requires print_function |
|
100 | 99 | tests/test-hgwebdir-paths.py not using absolute_import |
|
101 | 100 | tests/test-hybridencode.py not using absolute_import |
|
102 | 101 | tests/test-hybridencode.py requires print_function |
|
103 | 102 | tests/test-lrucachedict.py not using absolute_import |
|
104 | 103 | tests/test-lrucachedict.py requires print_function |
|
105 | 104 | tests/test-manifest.py not using absolute_import |
|
106 | 105 | tests/test-minirst.py not using absolute_import |
|
107 | 106 | tests/test-minirst.py requires print_function |
|
108 | 107 | tests/test-parseindex2.py not using absolute_import |
|
109 | 108 | tests/test-parseindex2.py requires print_function |
|
110 | 109 | tests/test-pathencode.py not using absolute_import |
|
111 | 110 | tests/test-pathencode.py requires print_function |
|
112 | 111 | tests/test-propertycache.py not using absolute_import |
|
113 | 112 | tests/test-propertycache.py requires print_function |
|
114 | 113 | tests/test-revlog-ancestry.py not using absolute_import |
|
115 | 114 | tests/test-revlog-ancestry.py requires print_function |
|
116 | 115 | tests/test-run-tests.py not using absolute_import |
|
117 | 116 | tests/test-simplemerge.py not using absolute_import |
|
118 | 117 | tests/test-status-inprocess.py not using absolute_import |
|
119 | 118 | tests/test-status-inprocess.py requires print_function |
|
120 | 119 | tests/test-symlink-os-yes-fs-no.py not using absolute_import |
|
121 | 120 | tests/test-trusted.py not using absolute_import |
|
122 | 121 | tests/test-trusted.py requires print_function |
|
123 | 122 | tests/test-ui-color.py not using absolute_import |
|
124 | 123 | tests/test-ui-color.py requires print_function |
|
125 | 124 | tests/test-ui-config.py not using absolute_import |
|
126 | 125 | tests/test-ui-config.py requires print_function |
|
127 | 126 | tests/test-ui-verbosity.py not using absolute_import |
|
128 | 127 | tests/test-ui-verbosity.py requires print_function |
|
129 | 128 | tests/test-url.py not using absolute_import |
|
130 | 129 | tests/test-url.py requires print_function |
|
131 | 130 | tests/test-walkrepo.py requires print_function |
|
132 | 131 | tests/test-wireproto.py requires print_function |
|
133 | 132 | tests/tinyproxy.py requires print_function |
General Comments 0
You need to be logged in to leave comments.
Login now