Mercurial > hg
diff hgext/fsmonitor/__init__.py @ 51129:1625fe807c04
py3: pass unicode strings to hasattr() throughout
I guess we missed these instances because they're not covered by tests.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 13 Nov 2023 09:19:11 -0800 |
parents | d718eddf01d9 |
children | 493034cc3265 |
line wrap: on
line diff
--- a/hgext/fsmonitor/__init__.py Mon Nov 06 23:17:10 2023 +0100 +++ b/hgext/fsmonitor/__init__.py Mon Nov 13 09:19:11 2023 -0800 @@ -332,7 +332,7 @@ matchfn = match.matchfn matchalways = match.always() dmap = self._map - if hasattr(dmap, b'_map'): + if hasattr(dmap, '_map'): # for better performance, directly access the inner dirstate map if the # standard dirstate implementation is in use. dmap = dmap._map @@ -744,7 +744,7 @@ def wrapdirstate(orig, self): ds = orig(self) # only override the dirstate when Watchman is available for the repo - if hasattr(self, b'_fsmonitorstate'): + if hasattr(self, '_fsmonitorstate'): makedirstate(self, ds) return ds @@ -811,7 +811,7 @@ self.oldnode = self.repo[b'.'].node() if self.repo.currentwlock() is None: - if hasattr(self.repo, b'wlocknostateupdate'): + if hasattr(self.repo, 'wlocknostateupdate'): self._lock = self.repo.wlocknostateupdate() else: self._lock = self.repo.wlock() @@ -839,7 +839,7 @@ self._lock.release() def _state(self, cmd, commithash, status=b'ok'): - if not hasattr(self.repo, b'_watchmanclient'): + if not hasattr(self.repo, '_watchmanclient'): return False try: self.repo._watchmanclient.command(