Bug 2647 - hg convert failes with libsvn assertion failure "assertion failed (*path != '/')"
Summary: hg convert failes with libsvn assertion failure "assertion failed (*path != '...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 16:03 UTC by Randy Syring
Modified: 2012-05-13 04:47 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments
(34 bytes, text/html)
2011-03-14 10:07 UTC, muppetwonder
Details
(34 bytes, text/html)
2011-03-14 10:11 UTC, muppetwonder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Syring 2011-02-16 16:03 UTC
<...snip...>
964 
963 * CHD-462: clarifying delete of REST keys - copied style from contact
situations as it worked well
962 * Stable milestone
svn: In file
'/build/buildd/subversion-1.6.15dfsg~ppa/subversion/libsvn_ra/ra_loader.c'
line 595: assertion failed (*path != '/')

Repo that caused this: http://svn.webgroupmedia.com/cerb4/
Comment 1 Augie Fackler 2011-02-16 16:12 UTC
I plan on taking a look at this.
Comment 2 muppetwonder 2011-03-10 15:21 UTC
Experienced same problem trying to convert a private Subversion repository. 
Modified hgext/convert/subversion.py to correct problem: added several 
additional places where .strip('/') needs to be called.

In particular the assertion trigged at line 595 of ra_loader.c is called 
from 

            if self.module != new_module:
                self.module = new_module
                self.reparent(self.module)
            io = StringIO()
            info = svn.ra.get_file(self.ra, file, revnum, io)
                                            ^^^^

Adding a strip call fixes this problem.

Will submit a patch if I have time, but currently trying to finish this 
project.
Comment 3 Patrick Mézard 2011-03-11 15:03 UTC
@muppetwonder: good catch! Could you test the following patch on your
repository:

==========
diff -r 3cbb3c57a50e hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Fri Mar 11 15:48:44 2011 +0000
+++ b/hgext/convert/subversion.py	Fri Mar 11 21:50:13 2011 +0100
@@ -866,7 +866,9 @@
         pool = Pool()
         rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
         entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool)
-        return ((path + '/' + p) for p, e in entries.iteritems()
+        if path:
+            path += '/'
+        return ((path + p) for p, e in entries.iteritems()
                 if e.kind == svn.core.svn_node_file)
 
     def getrelpath(self, path, module=None):
==========

and if it works, provide me with a proper name like

  Matt Mackall <mpm@selenic.com>

so I could credit you for the analysis?
Comment 4 muppetwonder 2011-03-14 10:07 UTC
Hi Patrick,

Thanks for the patch.

It does appear to work. I didn't have time to let it get through the entire
conversion process again as that would have taken more than 12 hours.
Without the patch, it fails quite early in the process, like within 15
minutes. Thus, I am satisfied that this patch fixes the issue.

Clinton Chau (clinton@clearcanvas.ca)

On Fri, Mar 11, 2011 at 4:03 PM, <"Patrick Mézard <
bugs@mercurial.selenic.com>"@mercurial.selenic.com> wrote:

>
> Patrick Mézard <pmezard@gmail.com> added the comment:
>
> @muppetwonder: good catch! Could you test the following patch on your
> repository:
>
> ==========
> diff -r 3cbb3c57a50e hgext/convert/subversion.py
> --- a/hgext/convert/subversion.py       Fri Mar 11 15:48:44 2011 +0000
> +++ b/hgext/convert/subversion.py       Fri Mar 11 21:50:13 2011 +0100
> @@ -866,7 +866,9 @@
>         pool = Pool()
>         rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
>         entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx,
> pool)
> -        return ((path + '/' + p) for p, e in entries.iteritems()
> +        if path:
> +            path += '/'
> +        return ((path + p) for p, e in entries.iteritems()
>                 if e.kind == svn.core.svn_node_file)
>
>     def getrelpath(self, path, module=None):
> ==========
>
> and if it works, provide me with a proper name like
>
>  Matt Mackall <mpm@selenic.com>
>
> so I could credit you for the analysis?
>
> ----------
> assignedto: durin42 ->
> nosy: +pmezard
>
> ____________________________________________________
> Mercurial issue tracker <bugs@mercurial.selenic.com>
> <http://mercurial.selenic.com/bts/issue2647>
> ____________________________________________________
>
Comment 5 muppetwonder 2011-03-14 10:11 UTC
Apologies if you are getting this twice. Gmail had problems parsing
Patrick's email address.

On Mon, Mar 14, 2011 at 12:06 PM, Clinton Chau <clinton@clearcanvas.ca>wrote:

> Hi Patrick,
>
> Thanks for the patch.
>
> It does appear to work. I didn't have time to let it get through the entire
> conversion process again as that would have taken more than 12 hours.
> Without the patch, it fails quite early in the process, like within 15
> minutes. Thus, I am satisfied that this patch fixes the issue.
>
> Clinton Chau (clinton@clearcanvas.ca)
>
>
> On Fri, Mar 11, 2011 at 4:03 PM, <"Patrick Mézard <
> bugs@mercurial.selenic.com>"@mercurial.selenic.com> wrote:
>
>>
>> Patrick Mézard <pmezard@gmail.com> added the comment:
>>
>> @muppetwonder: good catch! Could you test the following patch on your
>> repository:
>>
>> ==========
>> diff -r 3cbb3c57a50e hgext/convert/subversion.py
>> --- a/hgext/convert/subversion.py       Fri Mar 11 15:48:44 2011 +0000
>> +++ b/hgext/convert/subversion.py       Fri Mar 11 21:50:13 2011 +0100
>> @@ -866,7 +866,9 @@
>>         pool = Pool()
>>         rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
>>         entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx,
>> pool)
>> -        return ((path + '/' + p) for p, e in entries.iteritems()
>> +        if path:
>> +            path += '/'
>> +        return ((path + p) for p, e in entries.iteritems()
>>                 if e.kind == svn.core.svn_node_file)
>>
>>     def getrelpath(self, path, module=None):
>> ==========
>>
>> and if it works, provide me with a proper name like
>>
>>  Matt Mackall <mpm@selenic.com>
>>
>> so I could credit you for the analysis?
>>
>> ----------
>> assignedto: durin42 ->
>> nosy: +pmezard
>>
>> ____________________________________________________
>> Mercurial issue tracker <bugs@mercurial.selenic.com>
>> <http://mercurial.selenic.com/bts/issue2647>
>> ____________________________________________________
>>
>
>
>
> --
> ClearCanvas Inc.
> 439 University Ave Suite 1920
> Toronto, ON  M5G 1Y8
> clinton@clearcanvas.ca
> www.clearcanvas.ca
> <%2B1%20866%20584%205688> <%2B1%20866%20584%205688>+1 866 584 5688 (fax)
>  <%2B1%20647%20547%202987> <%2B1%20647%20547%202987>+1 647 547 2987 (bus)
>
>
Comment 6 Patrick Mézard 2011-03-15 05:05 UTC
In crew-stable: http://hg.intevation.org/mercurial/crew/rev/9777df929035
Comment 7 HG Bot 2011-03-15 16:00 UTC
Fixed by http://selenic.com/repo/hg/rev/9777df929035
Patrick Mezard <pmezard@gmail.com>
convert/svn: fix _iterfiles() output in root dir case (issue2647)

(please test the fix)
Comment 8 Bugzilla 2012-05-12 09:17 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:17 EDT  ---

This bug was previously known as _bug_ 2647 at http://mercurial.selenic.com/bts/issue2647
Imported an attachment (id=1523)
Imported an attachment (id=1524)