Patchwork [2,of,3,stable] convert: fix svn crash when svn.ra.get_log calls back with orig_paths=None

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 17, 2013, 12:57 a.m.
Message ID <1c6f532e2965a133ba77.1384649852@localhost.localdomain>
Download mbox | patch
Permalink /patch/3003/
State Accepted
Commit d54467c1a19803de109fb8a297537d052cecc189
Headers show

Comments

Mads Kiilerich - Nov. 17, 2013, 12:57 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1384649790 18000
#      Sat Nov 16 19:56:30 2013 -0500
# Branch stable
# Node ID 1c6f532e2965a133ba7780891e6f65e3b179bb58
# Parent  969c649f5fdf7b0a8f066456432ee401511f5255
convert: fix svn crash when svn.ra.get_log calls back with orig_paths=None

get_log started calling back with orig_paths=None on Fedora 20 with
subversion-1.8.3. That broke test-convert-svn-source.t .

There used to be some handling of that situation until e8f4e40f285a apparently
broke it. This patch restores what seems to be the most obvious handling of the
situation.
Augie Fackler - Nov. 17, 2013, 10:46 p.m.
On Sat, Nov 16, 2013 at 07:57:32PM -0500, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1384649790 18000
> #      Sat Nov 16 19:56:30 2013 -0500
> # Branch stable
> # Node ID 1c6f532e2965a133ba7780891e6f65e3b179bb58
> # Parent  969c649f5fdf7b0a8f066456432ee401511f5255
> convert: fix svn crash when svn.ra.get_log calls back with orig_paths=None

queueing this one, I'm going to defer the cvs one to someone that
knows cvs things

>
> get_log started calling back with orig_paths=None on Fedora 20 with
> subversion-1.8.3. That broke test-convert-svn-source.t .
>
> There used to be some handling of that situation until e8f4e40f285a apparently
> broke it. This patch restores what seems to be the most obvious handling of the
> situation.
>
> diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
> --- a/hgext/convert/subversion.py
> +++ b/hgext/convert/subversion.py
> @@ -91,10 +91,11 @@ def get_log_child(fp, url, paths, start,
>                    discover_changed_paths=True, strict_node_history=False):
>      protocol = -1
>      def receiver(orig_paths, revnum, author, date, message, pool):
> +        paths = {}
>          if orig_paths is not None:
>              for k, v in orig_paths.iteritems():
> -                orig_paths[k] = changedpath(v)
> -        pickle.dump((orig_paths, revnum, author, date, message),
> +                paths[k] = changedpath(v)
> +        pickle.dump((paths, revnum, author, date, message),
>                      fp, protocol)
>
>      try:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -91,10 +91,11 @@  def get_log_child(fp, url, paths, start,
                   discover_changed_paths=True, strict_node_history=False):
     protocol = -1
     def receiver(orig_paths, revnum, author, date, message, pool):
+        paths = {}
         if orig_paths is not None:
             for k, v in orig_paths.iteritems():
-                orig_paths[k] = changedpath(v)
-        pickle.dump((orig_paths, revnum, author, date, message),
+                paths[k] = changedpath(v)
+        pickle.dump((paths, revnum, author, date, message),
                     fp, protocol)
 
     try: