Mercurial > hg-stable
changeset 41099:f8f61cf246f5
registrar: minor cleanup to the merge function
Pointed out by Yuya.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 02 Jan 2019 21:49:40 -0500 |
parents | e0d00ec2d614 |
children | 6a63ba61e71f |
files | mercurial/registrar.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/registrar.py Wed Jan 02 10:31:14 2019 +0100 +++ b/mercurial/registrar.py Wed Jan 02 21:49:40 2019 -0500 @@ -80,11 +80,11 @@ current one, or a ProgrammmingError is raised. Additionally, the types of the two registrars must match. """ - if type(self) != type(registrarbase): + if not isinstance(registrarbase, type(self)): msg = "cannot merge different types of registrar" raise error.ProgrammingError(msg) - dups = set(registrarbase._table.keys()).intersection(self._table.keys()) + dups = set(registrarbase._table).intersection(self._table) if dups: msg = 'duplicate registration for names: "%s"' % '", "'.join(dups)