comparison hgext/convert/__init__.py @ 5355:6b6104430964

convert: support darcs as a source repo
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 02 Oct 2007 13:49:11 -0700
parents f0931c0240b4
children 6aba1835a7b3
comparison
equal deleted inserted replaced
5354:4fbd27bf04b1 5355:6b6104430964
5 # This software may be used and distributed according to the terms 5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference. 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 from common import NoRepo, converter_source, converter_sink 8 from common import NoRepo, converter_source, converter_sink
9 from cvs import convert_cvs 9 from cvs import convert_cvs
10 from darcs import darcs_source
10 from git import convert_git 11 from git import convert_git
11 from hg import mercurial_source, mercurial_sink 12 from hg import mercurial_source, mercurial_sink
12 from subversion import convert_svn, debugsvnlog 13 from subversion import convert_svn, debugsvnlog
13 14
14 import os, shlex, shutil 15 import os, shlex, shutil
16 from mercurial.i18n import _ 17 from mercurial.i18n import _
17 18
18 commands.norepo += " convert debugsvnlog" 19 commands.norepo += " convert debugsvnlog"
19 20
20 converters = [convert_cvs, convert_git, convert_svn, mercurial_source, 21 converters = [convert_cvs, convert_git, convert_svn, mercurial_source,
21 mercurial_sink] 22 mercurial_sink, darcs_source]
22 23
23 def convertsource(ui, path, **opts): 24 def convertsource(ui, path, **opts):
24 for c in converters: 25 for c in converters:
25 try: 26 try:
26 return c.getcommit and c(ui, path, **opts) 27 return c.getcommit and c(ui, path, **opts)
369 370
370 def convert(ui, src, dest=None, revmapfile=None, **opts): 371 def convert(ui, src, dest=None, revmapfile=None, **opts):
371 """Convert a foreign SCM repository to a Mercurial one. 372 """Convert a foreign SCM repository to a Mercurial one.
372 373
373 Accepted source formats: 374 Accepted source formats:
374 - GIT
375 - CVS 375 - CVS
376 - SVN 376 - Darcs
377 - git
378 - Subversion
377 379
378 Accepted destination formats: 380 Accepted destination formats:
379 - Mercurial 381 - Mercurial
380 382
381 If no revision is given, all revisions will be converted. Otherwise, 383 If no revision is given, all revisions will be converted. Otherwise,