Patchwork D6458: py3: fix test-convert-svn-sink.t

login
register
mail settings
Submitter phabricator
Date May 29, 2019, 6:41 p.m.
Message ID <differential-rev-PHID-DREV-li3ceuy2kjoxgzwwixbg-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40271/
State Superseded
Headers show

Comments

phabricator - May 29, 2019, 6:41 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  In cases where the root commit is empty commit, None will be returned as
  parents. This was implemented by https://phab.mercurial-scm.org/rHG2c13e91ede6e646aa667be722b02375368df9187.
  
  This breaks test on py3 because `b'%s' % None` does not work. It does not matter
  whether we return `None` or `'None'` as we skipped converting to svn step by
  doing an early return. So let's return `'None'`.
  
  I tried to patch all the users to convert `None` to `'None'`, but there were
  more users than I expected. I hit 3 of them and decided to fix it this way
  around.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6458

AFFECTED FILES
  hgext/convert/subversion.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: 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
@@ -1333,7 +1333,7 @@ 
                 rev = self.commit_re.search(output).group(1)
             except AttributeError:
                 if not files:
-                    return parents[0] if parents else None
+                    return parents[0] if parents else 'None'
                 self.ui.warn(_('unexpected svn output:\n'))
                 self.ui.warn(output)
                 raise error.Abort(_('unable to cope with svn output'))