Mercurial > hg
comparison hgext/fsmonitor/__init__.py @ 43397:09ab61c0ab4b stable
fsmonitor: normalize clock value to bytes
We normalize the value returned by watchman because
we perform a number of compares with this value in code.
So the easiest path forward is to normalize to bytes so we
don't have to update many call sites.
With this commit, the fsmonitor extension appears to be working
with Python 3! Although there are still some failures in edge
cases...
Differential Revision: https://phab.mercurial-scm.org/D7213
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 02 Nov 2019 14:55:45 -0700 |
parents | 2b5aab5e9e36 |
children | 90fba2248693 |
comparison
equal
deleted
inserted
replaced
43396:2b5aab5e9e36 | 43397:09ab61c0ab4b |
---|---|
381 self._watchmanclient.clearconnection() | 381 self._watchmanclient.clearconnection() |
382 return bail(b'exception during run') | 382 return bail(b'exception during run') |
383 else: | 383 else: |
384 # We need to propagate the last observed clock up so that we | 384 # We need to propagate the last observed clock up so that we |
385 # can use it for our next query | 385 # can use it for our next query |
386 state.setlastclock(result[b'clock']) | 386 state.setlastclock(pycompat.sysbytes(result[b'clock'])) |
387 if result[b'is_fresh_instance']: | 387 if result[b'is_fresh_instance']: |
388 if state.walk_on_invalidate: | 388 if state.walk_on_invalidate: |
389 state.invalidate() | 389 state.invalidate() |
390 return bail(b'fresh instance') | 390 return bail(b'fresh instance') |
391 fresh_instance = True | 391 fresh_instance = True |