##// END OF EJS Templates
py3: use python 3 compatible variables in hgext/fsmontor/__init__.py...
Pulkit Goyal -
r30666:6ada1658 default
parent child Browse files
Show More
@@ -94,15 +94,16 b' from __future__ import absolute_import'
94 import hashlib
94 import hashlib
95 import os
95 import os
96 import stat
96 import stat
97 import sys
98
97
99 from mercurial.i18n import _
98 from mercurial.i18n import _
100 from mercurial import (
99 from mercurial import (
101 context,
100 context,
101 encoding,
102 extensions,
102 extensions,
103 localrepo,
103 localrepo,
104 merge,
104 merge,
105 pathutil,
105 pathutil,
106 pycompat,
106 scmutil,
107 scmutil,
107 util,
108 util,
108 )
109 )
@@ -292,7 +293,7 b' def overridewalk(orig, self, match, subr'
292 if normalize:
293 if normalize:
293 foldmap = dict((normcase(k), k) for k in results)
294 foldmap = dict((normcase(k), k) for k in results)
294
295
295 switch_slashes = os.sep == '\\'
296 switch_slashes = pycompat.ossep == '\\'
296 # The order of the results is, strictly speaking, undefined.
297 # The order of the results is, strictly speaking, undefined.
297 # For case changes on a case insensitive filesystem we may receive
298 # For case changes on a case insensitive filesystem we may receive
298 # two entries, one with exists=True and another with exists=False.
299 # two entries, one with exists=True and another with exists=False.
@@ -392,8 +393,8 b' def overridestatus('
392
393
393 def _cmpsets(l1, l2):
394 def _cmpsets(l1, l2):
394 try:
395 try:
395 if 'FSMONITOR_LOG_FILE' in os.environ:
396 if 'FSMONITOR_LOG_FILE' in encoding.environ:
396 fn = os.environ['FSMONITOR_LOG_FILE']
397 fn = encoding.environ['FSMONITOR_LOG_FILE']
397 f = open(fn, 'wb')
398 f = open(fn, 'wb')
398 else:
399 else:
399 fn = 'fsmonitorfail.log'
400 fn = 'fsmonitorfail.log'
@@ -434,7 +435,7 b' def overridestatus('
434 updatestate = (parentworking and match.always() and
435 updatestate = (parentworking and match.always() and
435 not isinstance(ctx2, (context.workingcommitctx,
436 not isinstance(ctx2, (context.workingcommitctx,
436 context.memctx)) and
437 context.memctx)) and
437 'HG_PENDING' not in os.environ)
438 'HG_PENDING' not in encoding.environ)
438
439
439 try:
440 try:
440 if self._fsmonitorstate.walk_on_invalidate:
441 if self._fsmonitorstate.walk_on_invalidate:
@@ -545,7 +546,7 b' def wrapdirstate(orig, self):'
545
546
546 def extsetup(ui):
547 def extsetup(ui):
547 wrapfilecache(localrepo.localrepository, 'dirstate', wrapdirstate)
548 wrapfilecache(localrepo.localrepository, 'dirstate', wrapdirstate)
548 if sys.platform == 'darwin':
549 if pycompat.sysplatform == 'darwin':
549 # An assist for avoiding the dangling-symlink fsevents bug
550 # An assist for avoiding the dangling-symlink fsevents bug
550 extensions.wrapfunction(os, 'symlink', wrapsymlink)
551 extensions.wrapfunction(os, 'symlink', wrapsymlink)
551
552
@@ -9,21 +9,6 b' New errors are not allowed. Warnings are'
9
9
10 $ hg locate -X contrib/python-zstandard -X hgext/fsmonitor/pywatchman |
10 $ hg locate -X contrib/python-zstandard -X hgext/fsmonitor/pywatchman |
11 > sed 's-\\-/-g' | xargs "$check_code" --warnings --per-file=0 || false
11 > sed 's-\\-/-g' | xargs "$check_code" --warnings --per-file=0 || false
12 hgext/fsmonitor/__init__.py:295:
13 > switch_slashes = os.sep == '\\'
14 use pycompat.ossep instead (py3)
15 hgext/fsmonitor/__init__.py:395:
16 > if 'FSMONITOR_LOG_FILE' in os.environ:
17 use encoding.environ instead (py3)
18 hgext/fsmonitor/__init__.py:396:
19 > fn = os.environ['FSMONITOR_LOG_FILE']
20 use encoding.environ instead (py3)
21 hgext/fsmonitor/__init__.py:437:
22 > 'HG_PENDING' not in os.environ)
23 use encoding.environ instead (py3)
24 hgext/fsmonitor/__init__.py:548:
25 > if sys.platform == 'darwin':
26 use pycompat.sysplatform instead (py3)
27 Skipping i18n/polib.py it has no-che?k-code (glob)
12 Skipping i18n/polib.py it has no-che?k-code (glob)
28 mercurial/demandimport.py:309:
13 mercurial/demandimport.py:309:
29 > if os.environ.get('HGDEMANDIMPORT') != 'disable':
14 > if os.environ.get('HGDEMANDIMPORT') != 'disable':
General Comments 0
You need to be logged in to leave comments. Login now