[Svnmerge] Error with svnmerge init

Giovanni Bajo rasky at develer.com
Wed Nov 30 06:51:09 PST 2005


Archie Cobbs <archie at dellroad.org> wrote:

> Giovanni Bajo wrote:
>> Must be a regexp problem. Can you try changing this regexp:
>>
>> <path .*action="A".*>
>>
>> in function get_copyfrom() with this:
>>
>> <path [^>]*action="A"[^>]*>
>
> Seems to do something...
>
> Traceback (most recent call last):
>    File "/usr/bin/svnmerge", line 1226, in ?
>      main(sys.argv[1:])
>    File "/usr/bin/svnmerge", line 1182, in main
>      cf_head, cf_rev = get_copyfrom(branch_dir)
>    File "/usr/bin/svnmerge", line 452, in get_copyfrom
>      head = re.search(r'copyfrom-path="([^"]*)"', m.group(1)).group(1)
> AttributeError: 'NoneType' object has no attribute 'group'


Right. This is fixed in my repository:

------------------------------------------------------------------------
r189 | giovannibajo | 2005-11-01 23:46:03 +0100 (Tue, 01 Nov 2005) | 1 line

Fix bug when copyfrom info is not available

Index: svnmerge.py
===================================================================
--- svnmerge.py (revision 188)
+++ svnmerge.py (revision 189)
@@ -449,12 +449,13 @@ def get_copyfrom(dir):
     rlpath = url_to_rlpath(target_to_url(dir))
     out = launchsvn('log -v --xml --stop-on-copy "%s"' % dir,
split_lines=False)
     out = out.replace("\n", " ")
-    m = re.search(r'(<path .*action="A".*>%s</path>)' % rlpath, out)
-    if not m:
+    try:
+        m = re.search(r'(<path .*action="A".*>%s</path>)' % rlpath, out)
+        head = re.search(r'copyfrom-path="([^"]*)"', m.group(1)).group(1)
+        rev = re.search(r'copyfrom-rev="([^"]*)"', m.group(1)).group(1)
+        return head,rev
+    except AttributeError:
         return None,None
-    head = re.search(r'copyfrom-path="([^"]*)"', m.group(1)).group(1)
-    rev = re.search(r'copyfrom-rev="([^"]*)"', m.group(1)).group(1)
-    return head,rev


Try merging it in: svn merge -r188:189
svn://pyinstaller.hpcf.upr.edu/svnmerge/svnmerge.py
You'll have to revert the regexp modification and do it later or it'll
conflict, of course :)

I should *really* find some time to merge everything into Subversion's
repository and close my own.
-- 
Giovanni Bajo




More information about the Svnmerge mailing list