I just installed this “checkfiles” plugin and it has a syntax error. I don’t know Python, but I’ve tried a few things and can’t figure it out. I’m wondering if someone else could take a peek and see if anything stands out. It’s the very last line of the code below:
if self.opt_all:
self.check_diffs = False
if self.checked_exts == '""':
self.ui.debug('checkfiles: checked extensions: (all text files)\n')
else:
self.ui.debug('checkfiles: checked extensions: %s\n' % ' '.join(self.checked_exts))
self.ui.debug('checkfiles: ignored extensions: %s\n' % ' '.join(self.ignored_exts))
self.ui.debug('checkfiles: ignored files: %s\n' % ' '.join(self.ignored_files))
self.ui.debug('checkfiles: check diffs only: %r\n' % self.check_diffs)
self.ui.debug('checkfiles: use spaces: %r\n' % self.use_spaces)
if ctx:
self.set_changectx(ctx)
def set_changectx(self, ctx):
self.ctx = ctx
if self.opt_all:
modified, added, removed, deleted, unknown, ignored, clean = self.repo.status(clean=True)
self.files = modified + added + clean # we can't get filecontext for unknown files
else:
self.files = ctx.files() if ctx else [] #THIS IS LINE 120
* failed to import extension checkfiles from /scripts/mercurial-extensions/checkfiles/checkfiles.py: invalid syntax (checkfiles.py, line 120)
The last line is correct modern Python.
It contains a conditional expression which was added in Python 2.5.
So, I think your Hg must be running Python 2.4 or earlier.