[Request] [+ ] D8573: fsmonitor: coerce `clock` variable to byte-string (issue6321)
sheehan (Connor Sheehan)
phabricator at mercurial-scm.org
Wed May 20 15:28:50 UTC 2020
sheehan created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
Callers of `fsmonitor.state.setlastclock` pass their arguments
wrapped in `pycompat.sysbytes` to ensure the value is a `bytes`
on Python 3. However in `fsmonitor.poststatus.__call__`, if the
return value of `getlastclock()` is `None`, we use the value of
`fsmonitor.poststatus._startclock` instead, which is not converted
to a byte string in the same manner. This commit converts the
value of `startclock` to a byte string using `pycompat.sysbytes`
in the constructor for `poststatus`, to avoid the "`str` + `bytes`"
error from issue 6321.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8573
AFFECTED FILES
hgext/fsmonitor/__init__.py
CHANGE DETAILS
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -667,7 +667,7 @@
class poststatus(object):
def __init__(self, startclock):
- self._startclock = startclock
+ self._startclock = pycompat.sysbytes(startclock)
def __call__(self, wctx, status):
clock = wctx.repo()._fsmonitorstate.getlastclock() or self._startclock
To: sheehan, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200520/641a6765/attachment.html>
More information about the Mercurial-patches
mailing list