# HG changeset patch # User Alexis S. L. Carvalho # Date 1191550897 10800 # Node ID 6874368120dcaeb93ac2543b1a9527828f3a5e00 # Parent a5a7f7fd55547e6ed3e3db117ae174d929c2ba51 convert_cvs: add --filemap support diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -266,3 +266,9 @@ class convert_cvs(converter_source): def gettags(self): return self.tags + + def getchangedfiles(self, rev, i): + files = self.files[rev].keys() + files.sort() + return files + diff --git a/tests/test-convert-cvs b/tests/test-convert-cvs --- a/tests/test-convert-cvs +++ b/tests/test-convert-cvs @@ -29,11 +29,24 @@ cd .. echo % checkout source directory cvs -q checkout src +echo % commit a new revision changing b/c +cd src +echo c >> b/c +cvs -q commit -mci0 . | grep '<--' |\ + sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' +cd .. + echo % convert fresh repo hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' cat src-hg/a cat src-hg/b/c +echo % convert fresh repo with --filemap +echo include b/c > filemap +hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' +cat src-hg/b/c +hg -R src-filemap log --template '#rev# #desc# files: #files#\n' + echo % commit new file revisions cd src echo a >> a @@ -47,5 +60,8 @@ hg convert src src-hg | sed -e 's/connec cat src-hg/a cat src-hg/b/c +echo % convert again with --filemap +hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' +cat src-hg/b/c +hg -R src-filemap log --template '#rev# #desc# files: #files#\n' - diff --git a/tests/test-convert-cvs.out b/tests/test-convert-cvs.out --- a/tests/test-convert-cvs.out +++ b/tests/test-convert-cvs.out @@ -9,17 +9,37 @@ No conflicts created by this import % checkout source directory U src/a U src/b/c +% commit a new revision changing b/c +checking in src/b/c,v % convert fresh repo initializing destination src-hg repository connecting to cvsrepo scanning source... sorting... converting... -1 Initial revision -0 import +2 Initial revision +1 import +0 ci0 updating tags a c +c +% convert fresh repo with --filemap +initializing destination src-filemap repository +connecting to cvsrepo +scanning source... +sorting... +converting... +2 Initial revision +1 import +rolling back last transaction +0 ci0 +updating tags +c +c +2 update tags files: .hgtags +1 ci0 files: b/c +0 Initial revision files: b/c % commit new file revisions checking in src/a,v checking in src/b/c,v @@ -30,8 +50,22 @@ scanning source... sorting... converting... 0 ci1 -updating tags a a c c +c +% convert again with --filemap +destination src-filemap is a Mercurial repository +connecting to cvsrepo +scanning source... +sorting... +converting... +0 ci1 +c +c +c +3 ci1 files: b/c +2 update tags files: .hgtags +1 ci0 files: b/c +0 Initial revision files: b/c