comparison hgext/convert/__init__.py @ 5377:756a43a30e34

convert: readd --filemap To handle merges correctly, this revision adds a filemap_source class that wraps a converter_source and does the work necessary to calculate the subgraph we're interested in. The wrapped converter_source must provide a new getchangedfiles method that, given a revision rev, and an index N, returns the list of files that are different in rev and its Nth parent. The implementation depends on the ability to skip some revisions and to change the parents field of the commit objects that we returned earlier. To make the conversion restartable, we assume the revisons in the revmapfile are topologically sorted.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 04 Oct 2007 23:21:37 -0300
parents d60a067227a5
children 8a2915f57dfc
comparison
equal deleted inserted replaced
5376:d60a067227a5 5377:756a43a30e34
9 from cvs import convert_cvs 9 from cvs import convert_cvs
10 from darcs import darcs_source 10 from darcs import darcs_source
11 from git import convert_git 11 from git import convert_git
12 from hg import mercurial_source, mercurial_sink 12 from hg import mercurial_source, mercurial_sink
13 from subversion import convert_svn, debugsvnlog 13 from subversion import convert_svn, debugsvnlog
14 import filemap
14 15
15 import os, shutil 16 import os, shutil
16 from mercurial import hg, ui, util, commands 17 from mercurial import hg, ui, util, commands
17 from mercurial.i18n import _ 18 from mercurial.i18n import _
18 19
376 except Exception: 377 except Exception:
377 if created: 378 if created:
378 shutil.rmtree(dest, True) 379 shutil.rmtree(dest, True)
379 raise 380 raise
380 381
382 fmap = opts.get('filemap')
383 if fmap:
384 srcc = filemap.filemap_source(ui, srcc, fmap)
385
381 if not revmapfile: 386 if not revmapfile:
382 try: 387 try:
383 revmapfile = destc.revmapfile() 388 revmapfile = destc.revmapfile()
384 except: 389 except:
385 revmapfile = os.path.join(destc, "map") 390 revmapfile = os.path.join(destc, "map")