[PATCH 0 of 2] document convert-repo interfaces

Daniel Holth dholth at fastmail.fm
Mon May 21 03:49:43 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Edouard Gomez wrote:
> Note that i tested the git and cvs backends, they work fine. I had
> a problem with the SVN backend on the rawstudio.org project:
>
> I typed : $ convert-repo -d https://rawstudio.org/svn/rawstudio
> rawstudio.hg
>
> And the error dump: branch:                  hg: bcb8ab45ad09 p1:
> f57a104eba2e Reverted MMX from revision 109. Traceback (most recent
> call last): File "/data/opt/mercurial/bin/convert-repo", line 1307,
> in ? command(*args, **opts) File
> "/data/opt/mercurial/bin/convert-repo", line 1269, in command
> c.convert() File "/data/opt/mercurial/bin/convert-repo", line 1202,
> in convert self.copy(c) File
> "/data/opt/mercurial/bin/convert-repo", line 1167, in copy data =
> self.source.getfile(f, v) File
> "/data/opt/mercurial/bin/convert-repo", line 522, in getfile data,
> mode = self._getfile(file, rev) File
> "/data/opt/mercurial/bin/convert-repo", line 505, in _getfile info
> = svn.ra.get_file(self.ra, file, revnum, io) File
> "/var/lib/python-support/python2.4/libsvn/ra.py", line 392, in
> svn_ra_get_file return apply(_ra.svn_ra_get_file, args)
> libsvn._core.SubversionException: ("PROPFIND request failed on
> '/svn/rawstudio/!svn/bc/114/trunk/src/gconf_interface.c'", 175007)
>
> Any hint about the error ?
The short answer is that convert-repo was never tested for https://.
It works best on a local repository. If you have a real need to
convert this repository, you should first attempt to obtain a local
copy using the 'svnsync' tool included in SVN >= 1.4. This will also
be a lot kinder on the project's resources, since convert-repo will
currently fetch the entire SVN log each time.

This particular problem has to do with the SVN api returning a
different error code for "file not found" for a remote repository.



convert-repo -d https://rawstudio.org/svn/rawstudio rawstudio.hg

Mine doesn't accept -d. To only convert from rev 113 which caused the
error:

hg init rawstudio.hg
./convert-repo https://rawstudio.org/svn/rawstudio@113 rawstudio.hg

But the command will convert the SVN directory structure used to
represent branches and tags. It would be much more useful to convert
each branch separately. It ought to be smart enough to accept

./convert-repo https://rawstudio.org/svn/rawstudio/trunk@113 rawstudio.hg

But it won't accept this for http:// repositories. The code should
start taking path elements off the end and trying to reconnect until
it separates the real URL from the internal SVN path, something the
svn binary obviously knows how to do.

My convert-repo svn code follows the given path backwards in time.
When you point it at a branch, it will eventually find the place where
trunk/ was copied to branches/branchname, and it gives each revision
an identifier based on the repository's UUID and the internal path
like so:
"svn:8a4ba00d-8eff-0310-be1c-c3c89572a5aa/branches/branchname at 10504".
That way you may convert each branch into a single destination
repository and it only converts the shared history once.


About your error:

libsvn._core.SubversionException: ("PROPFIND request failed on
'/svn/rawstudio/!svn/bc/114/trunk/src/gconf_interface.c'", 175007)

dwholth at dev:~/FROM_NEW_DEV/src/hg/contrib$ svn log -vr 114
https://rawstudio.org/svn/rawstudio/------------------------------------------------------------------------
r114 | akv | 2006-03-13 03:13:49 -0500 (Mon, 13 Mar 2006) | 1 line
Changed paths:
   M /trunk/src/Makefile
   A /trunk/src/conf_interface.c (from /trunk/src/gconf_interface.c:108)
   A /trunk/src/conf_interface.h (from /trunk/src/gconf_interface.h:108)
   D /trunk/src/gconf_interface.c
   D /trunk/src/gconf_interface.h
   M /trunk/src/gtk-interface.c

Let's investigate:

>>> from svn import * errors = [c for c in dir(core) if
>>> c.startswith('SVN_ERR')] [e for e in errors if getattr(core, e)
>>> == 175007] ['SVN_ERR_RA_DAV_PATH_NOT_FOUND'] [e for e in errors
>>> if getattr(core, e) == 160013] ['SVN_ERR_FS_NOT_FOUND']

The file isn't found. Turns out there's a different 'not found' code
for remote repositories. Patch:

diff -r 9d60d2dd06f3 contrib/convert-repo
- --- a/contrib/convert-repo      Sun May 20 23:04:02 2007 -0400
+++ b/contrib/convert-repo      Sun May 20 23:39:15 2007 -0400
@@ -418,7 +418,9 @@ class convert_svn(converter_source):
             mode = ("svn:executable" in info) and 'x' or ''
             mode = ("svn:special" in info) and 'l' or mode
         except SubversionException, e:
- -            if e.apr_err == 160013: # File not found
+            notfound = (svn.core.SVN_ERR_FS_NOT_FOUND,
+                svn.core.SVN_ERR_RA_DAV_PATH_NOT_FOUND)
+            if e.apr_err in notfound: # File not found
                 raise IOError()
             raise
         data = io.getvalue()

n.b. http://dingoskidneys.com/cgi-bin/hgwebdir.cgi/queue-convert-svn/

Thanks for the bug report,

Daniel Holth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGURbWVh4W2pVfoMsRAu9BAJoC6VPBwXEPHpbKrJvE4NkOx7XhBgCfbXD2
6BYsKzijIqhenN+jAzUG6os=
=nIWn
-----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20070520/1dbf176f/attachment.html>


More information about the Mercurial-devel mailing list