py3: fix drag & drop in the Repository Registry

Before this change, dragging & dropping repositories across groups in the
registry was not working on py3: at drop, the message b'Start tag expected.'
was printed in the console, but nothing happened.

The reason is that QMimeData::data() returns a QByteArray containing an XML
document that was passed through str() and directly fed to
repotreemodel.readXml(), which instead expects either a unicode string or
bytes.

This change converts the QByteArray to bytes(), and restores the drag & drop
functionality in the Repo Registry.

--HG--
branch : stable
10 jobs for branch/stable in 4 minutes and 33 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
failed #86701
allowed to fail
pytype-py3-hg-default

00:00:38

failed #86700
allowed to fail
pytype-py3-hg-stable

00:00:39

passed #86692
tests-py2-hg-5.3

00:02:33

passed #86693
tests-py2-hg-5.4

00:02:35

failed #86695
allowed to fail
tests-py2-hg-default

00:01:18

failed #86694
tests-py2-hg-stable

00:01:17

failed #86696
allowed to fail
tests-py3-hg-5.3

00:00:43

failed #86697
allowed to fail
tests-py3-hg-5.4

00:01:17

failed #86699
allowed to fail
tests-py3-hg-default

00:01:16

failed #86698
allowed to fail
tests-py3-hg-stable

00:01:52

 
Name Stage Failure
failed
pytype-py3-hg-default Test
  File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/hglib.py", line 344, in <module>
readmergestate = mergemod.mergestate.read
File "/usr/lib/python3.7/importlib/util.py", line 256, in __getattribute__
return getattr(self, attr)
AttributeError: module 'mercurial.merge' has no attribute 'mergestate'
make: *** [Makefile:26: local] Error 1
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py3-hg-stable Test
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/hglib.py", line 344, in <module>
readmergestate = mergemod.mergestate.read
File "/usr/lib/python3.7/importlib/util.py", line 256, in __getattribute__
return getattr(self, attr)
AttributeError: module 'mercurial.merge' has no attribute 'mergestate'
make: *** [Makefile:26: local] Error 1
ERROR: Job failed: exit code 1
failed
pytype-py3-hg-stable Test
  File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/hglib.py", line 344, in <module>
readmergestate = mergemod.mergestate.read
File "/usr/lib/python3.7/importlib/util.py", line 256, in __getattribute__
return getattr(self, attr)
AttributeError: module 'mercurial.merge' has no attribute 'mergestate'
make: *** [Makefile:26: local] Error 1
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py3-hg-default Test
  File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/hglib.py", line 344, in <module>
readmergestate = mergemod.mergestate.read
File "/usr/lib/python3.7/importlib/util.py", line 256, in __getattribute__
return getattr(self, attr)
AttributeError: module 'mercurial.merge' has no attribute 'mergestate'
make: *** [Makefile:26: local] Error 1
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py3-hg-5.4 Test
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/terminal.py", line 2, in <module>
from mercurial import util
File "/ci/repos/mercurial/mercurial/util.py", line 38, in <module>
from .pycompat import (
File "/ci/repos/mercurial/mercurial/pycompat.py", line 154, in <module>
stdout = sys.stdout.buffer
AttributeError: '_io.StringIO' object has no attribute 'buffer'
ERROR: Job failed: exit code 1
failed
tests-py3-hg-5.3 Test

----------------------------------------------------------------------
Ran 142 tests in 0.396s

FAILED (errors=132)
make: *** [Makefile:35: tests] Error 1
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py2-hg-default Test
  File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/hglib.py", line 344, in <module>
readmergestate = mergemod.mergestate.read
File "/ci/repos/mercurial/hgdemandimport/demandimportpy2.py", line 158, in __getattr__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'mergestate'
make: *** [Makefile:26: local] Error 1
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py2-hg-stable Test
  File "/builds/mercurial/tortoisehg/thg/tortoisehg/util/hglib.py", line 344, in <module>
readmergestate = mergemod.mergestate.read
File "/ci/repos/mercurial/hgdemandimport/demandimportpy2.py", line 158, in __getattr__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'mergestate'
make: *** [Makefile:26: local] Error 1
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1