Patchwork D7213: fsmonitor: normalize clock value to bytes

login
register
mail settings
Submitter phabricator
Date Nov. 2, 2019, 10:04 p.m.
Message ID <differential-rev-PHID-DREV-lhizh2zaw6x3sotfxexq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42698/
State Superseded
Headers show

Comments

phabricator - Nov. 2, 2019, 10:04 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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...

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -383,7 +383,7 @@ 
     else:
         # We need to propagate the last observed clock up so that we
         # can use it for our next query
-        state.setlastclock(result[b'clock'])
+        state.setlastclock(pycompat.sysbytes(result[b'clock']))
         if result[b'is_fresh_instance']:
             if state.walk_on_invalidate:
                 state.invalidate()