Mercurial > hg-git
view setup.py @ 1046:cf982a23e15c
gitdirstate: show pattern error in hgignore file as expected
Before this revision, invalid pattern in hgignore file causes
unintentional failure for UnboundLocalError of ignorefunc, if hggit is
used with Mercurial 3.5 or later.
In such case:
- checking source of invalid pattern at failure uses "pats" list for
hgignore files, but
- "pats" list is empty, if ignoremod is None (= Mercurial 3.5 or later)
- therefore, checking with matchmod.match() overlooks invalid pattern
Then, "return ignorefunc" is executed without assignment to
ignorefunc, and causes UnboundLocalError.
To show pattern error in hgignore file as expected even with Mercurial
3.5 or later, this revision puts '(FILE, ["include: FILE"])' tuples
into "pats" (to avoid code duplication, putting into allpats is
shared, too).
This makes checking source of invalid pattern at failure work as
expected for hgignore files.
Fixes #197
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 05 Aug 2017 02:13:11 +0900 |
parents | 5cc9594cc811 |
children | 21264429a8d4 |
line wrap: on
line source
try: from setuptools import setup except: from distutils.core import setup try: from collections import OrderedDict extra_req = [] except ImportError: extra_req = ['ordereddict>=1.1'] from os.path import dirname, join def get_version(relpath): root = dirname(__file__) for line in open(join(root, relpath), 'rb'): line = line.decode('utf-8') if '__version__' in line: return line.split("'")[1] setup( name='hg-git', version=get_version('hggit/__init__.py'), author='The hg-git Authors', maintainer='Augie Fackler', maintainer_email='durin42@gmail.com', url='http://hg-git.github.com/', description='push to and pull from a Git repository using Mercurial', long_description=""" This extension lets you communicate (push and pull) with a Git server. This way you can use Git hosting for your project or collaborate with a project that is in Git. A bridger of worlds, this plugin be. """.strip(), keywords='hg git mercurial', license='GPLv2', packages=['hggit'], package_data={ 'hggit': ['help/git.rst'] }, include_package_data=True, install_requires=['dulwich>=0.9.7'] + extra_req, )