( )⚙ D1019 logtoprocess: do not use platform.system()

This is an archive of the discontinued Mercurial Phabricator instance.

logtoprocess: do not use platform.system()
ClosedPublic

Authored by quark on Oct 11 2017, 8:57 PM.

Details

Summary

See the previous patch for the reason.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

quark created this revision.Oct 11 2017, 8:57 PM
ryanmce requested changes to this revision.Oct 12 2017, 10:53 AM
ryanmce added a subscriber: ryanmce.

I'm +1 on this direction but think we shouldn't have == 'nt' as the "is this windows?" check here.

hgext/logtoprocess.py
54

seems like this should be pycompat.iswindows (which probably doesn't exist yet, but should) because comparisons to things that should be constants scattered throughout the code scare me.

This revision now requires changes to proceed.Oct 12 2017, 10:53 AM
quark added inline comments.Oct 12 2017, 10:57 AM
hgext/logtoprocess.py
54

This check is common in the code base:

mercurial/scmutil.py
44:if pycompat.osname == 'nt':
294:    abort = pycompat.osname == 'nt' or lval == 'abort'

mercurial/i18n.py
32:if (pycompat.osname == 'nt'

mercurial/rcutil.py
18:if pycompat.osname == 'nt':

mercurial/subrepo.py
1350:            elif pycompat.osname == 'nt':

mercurial/color.py
213:    if pycompat.osname == 'nt':
382:if pycompat.osname == 'nt':

mercurial/vfs.py
546:        defaultenabled = pycompat.osname == 'nt'

mercurial/util.py
95:if pycompat.osname == 'nt':
1351:if pycompat.osname == 'nt':

mercurial/ui.py
1044:        if pycompat.osname == 'nt' and not shell:

mercurial/sslutil.py
480:                pycompat.osname == 'nt'):
720:    if pycompat.osname == 'nt':

hgext/win32mbcs.py
193:        if pycompat.osname == 'nt':

hgext/logtoprocess.py
55:    if pycompat.osname == 'nt':

hgext/schemes.py
119:        if (pycompat.osname == 'nt' and len(scheme) == 1 and scheme.isalpha()

mercurial/hgweb/server.py
269:    if pycompat.osname == 'nt':

hgext/convert/subversion.py
106:        if pycompat.osname == 'nt':
257:            if (pycompat.osname == 'nt' and path[:1] == '/'

hgext/largefiles/lfutil.py
78:    if pycompat.osname == 'nt':
quark requested review of this revision.Oct 12 2017, 4:12 PM

It's changed by D1034.

This revision was automatically updated to reflect the committed changes.