I am trying to convert a mercurial (hg) repository to Subversion (svn). (The reason for this is I'm using a tool that uses SVNKit, and I want to run it on the data from the hg repo.)
So to do this I ran the Mercurial convert extension:
hg convert --dest-type svn mercurialrepo svnrepo
It all seems to be working correctly as it starts with this output:
initializing svn working copy 'svnrepo-wc'
scanning source...
sorting...
converting...
4336 Some commit message
4335 Some other commit message
Up until the point it gives me the message abort: svn exited with status 1
:
4175 Another commit message
abort: svn exited with status 1
Any idea what this means and/or how to solve it?
Moreover it looks as though he converted 160 revisions, but when I go into the svn working copy and do svn log
it only shows 35 revisions!
Update: adding the --debug and --traceback flags as per DJanssens' suggestion:
This is the last one that went fine:
4302 Removed file ProjectService in ext
source: afb26afbb72ba500fcb0b42c3c386540fbfa11fa
converting: 34/4337 revisions (0.78%)
getting files: historia4-web/src/main/webapp/META-INF/maven/be.vlaanderen.awv.historia4/historia4-web/pom.properties 1/3 (33.33%)
getting files: historia4-web/src/main/webapp/index.jsp 2/3 (66.67%)
getting files: historia4-web/src/main/webapp/js/be/vlaanderen/awv/historia4/services/ProjectService.js 3/3 (100.00%)
running: 'svn' 'delete' 'historia4-web/src/main/webapp/js/be/vlaanderen/awv/historia4/services/ProjectService.js'
D historia4-web/src/main/webapp/js/be/vlaanderen/awv/historia4/services/ProjectService.js
running: 'svn' 'commit' '--username=schoovlo' '--file=/var/folders/q1/pxdczzk90xz28qdkk3r0krsw0000gn/T/hg-convert-SVLDzc' '--encoding=utf-8'
Sending historia4-web/src/main/webapp/META-INF/maven/be.vlaanderen.awv.historia4/historia4-web/pom.properties
Sending historia4-web/src/main/webapp/index.jsp
Deleting historia4-web/src/main/webapp/js/be/vlaanderen/awv/historia4/services/ProjectService.js
Transmitting file data ..
Committed revision 35.
running: 'svn' 'propset' 'hg:convert-branch' 'HISTIV-8-projectDef' '--revprop' '--revision=35'
property 'hg:convert-branch' set on repository revision 35
Here it started doing weird stuff:
4301 HISTIV-8-projectDef afgerond
source: 55f79e40185fe81420008da5489e5736bb938818
converting: 35/4337 revisions (0.81%)
running: 'svn' 'commit' '--username=schoovlo' '--file=/var/folders/q1/pxdczzk90xz28qdkk3r0krsw0000gn/T/hg-convert-VBOvIH' '--encoding=utf-8'
4300 HISTIV-8 merged into default
source: dc46a9b84cebf41cd1cc1a771678a14c2cbce780
converting: 36/4337 revisions (0.83%)
And at the end I get:
4175 Wat wijzigingen en optimalisaties
source: efd1149f1f767e2f3afff2bc1f5573041c446b5f
converting: 161/4337 revisions (3.71%)
getting files: historia2-data-import/src/main/java/be/vlaanderen/awv/etl/common/transformers/CachedLookupTransformer.groovy 1/2 (50.00%)
getting files: historia2-data-import/src/main/java/be/vlaanderen/awv/etl/common/transformers/SourceDestColumnMapper.java 2/2 (100.00%)
running: 'svn' 'delete' 'historia2-data-import/src/main/java/be/vlaanderen/awv/etl/common/transformers/CachedLookupTransformer.groovy' 'historia2-data-import/src/main/java/be/vlaanderen/awv/etl/common/transformers/SourceDestColumnMapper.java'
svn: E155007: '/Users/quinten/Desktop/EXPERIMENT/TEST_SELECTION_QMINO/QMINO/cloneSVN/cloneSVN-wc/historia2-data-import/src/main/java/be/vlaanderen/awv/etl/common/transformers/CachedLookupTransformer.groovy' is not a working copy
run hg source post-conversion action
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 138, in _runcatch
return _dispatch(req)
File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 819, in _dispatch
cmdpats, cmdoptions)
File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 599, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 910, in _runcommand
return checkargs()
File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 881, in checkargs
return cmdfunc()
File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 816, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/Library/Python/2.7/site-packages/mercurial/util.py", line 518, in check
return func(*args, **kwargs)
File "/Library/Python/2.7/site-packages/hgext/convert/__init__.py", line 283, in convert
return convcmd.convert(ui, src, dest, revmapfile, **opts)
File "/Library/Python/2.7/site-packages/hgext/convert/convcmd.py", line 527, in convert
c.convert(sortmode)
File "/Library/Python/2.7/site-packages/hgext/convert/convcmd.py", line 444, in convert
self.copy(c)
File "/Library/Python/2.7/site-packages/hgext/convert/convcmd.py", line 412, in copy
source, self.map)
File "/Library/Python/2.7/site-packages/hgext/convert/subversion.py", line 1257, in putcommit
self.xargs(self.delete, 'delete')
File "/Library/Python/2.7/site-packages/hgext/convert/common.py", line 386, in xargs
self.run0(cmd, *(list(args) + l), **kwargs)
File "/Library/Python/2.7/site-packages/hgext/convert/common.py", line 341, in run0
self.checkexit(status, output)
File "/Library/Python/2.7/site-packages/hgext/convert/common.py", line 337, in checkexit
raise util.Abort('%s %s' % (self.command, msg))
Abort: svn exited with status 1
abort: svn exited with status 1
So apparently it doesn't like the *.groovy files. My next move was to exclude the problematic files using the filemap option:
hg convert --debug --traceback --filemap filemap --dest-type svn . cloneSVN
With filemap a file containing:
exclude whateverfileismakingtheproblem
But then the same problem occurs a little ways down the road with a different file.
The way I see it now, the problem is that at some point there is a revisions in which a file X is deleted. But there was a problem earlier, when the converter for some reason skipped the revison in which file X was added. So svn is then complaining that we're deleting something that isn't there to be deleted in the first place.
--debug
and--traceback
options? – DJanssens--debug
option could save some time. Let's hope an expert can shed some light on the issue. I guess the extra debug information can only help speeding this process up. Goodluck! – DJanssensabort: svn exited with status 1
just means that when mercurial called svn, svn reported an error. Nothing specific, just an error. The error wassvn: E155007: '/Users/quinten/Desktop/EXPERIMENT/TEST_SELECTION_QMINO/QMINO/cloneSVN/cloneSVN-wc/historia2-data-import/src/main/java/be/vlaanderen/awv/etl/common/transformers/CachedLookupTransformer.groovy' is not a working copy
, but I think you worked that out. Is that path a directory? Is it something to do with mercurial not storing empty directories? – Paul S