Patchwork [6,of,6] py3: fix comparison between int and None

login
register
mail settings
Submitter Manuel Jacob
Date June 16, 2020, 12:49 p.m.
Message ID <c2975b8fa87cc33aa473.1592311768@tmp>
Download mbox | patch
Permalink /patch/46520/
State Accepted
Headers show

Comments

Manuel Jacob - June 16, 2020, 12:49 p.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1592311130 -7200
#      Tue Jun 16 14:38:50 2020 +0200
# Branch stable
# Node ID c2975b8fa87cc33aa4739b17f3abe422915c2403
# Parent  442b269db244464da7c4950db8ec3099f5cf16d5
# EXP-Topic convert-svn
py3: fix comparison between int and None

If stop is None, the condition was always false on Python 2, as None compares
smaller than ints. Therefore we make the condition false if stop is None.

Patch

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -817,7 +817,7 @@ 
                         # We do not know the latest changed revision,
                         # keep the first one with changed paths.
                         break
-                    if revnum <= stop:
+                    if stop is not None and revnum <= stop:
                         break
 
                     for p in paths: