Skip to content

Merge kolanich/fixes #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__pycache__
*.pyc
*.pyo
./*.egg-info
./build
./dist
./.eggs
5 changes: 3 additions & 2 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ def _normalize_filenames(self):
for i,p in enumerate(self.items):
if debugmode:
debug(" patch type = " + p.type)
debug(" source = " + p.source)
debug(" target = " + p.target)
debug(" source = " + str(p.source, encoding="utf-8"))
debug(" target = " + str(p.target, encoding="utf-8"))
if p.type in (HG, GIT):
# TODO: figure out how to deal with /dev/null entries
debug("stripping a/ and b/ prefixes")
Expand Down Expand Up @@ -892,6 +892,7 @@ def apply(self, strip=0, root=None):
if line.rstrip(b"\r\n") == hunkfind[hunklineno]:
hunklineno+=1
else:
errors += 1
info("file %d/%d:\t %s" % (i+1, total, filename))
info(" hunk no.%d doesn't match source file at line %d" % (hunkno+1, lineno+1))
info(" expected: %s" % hunkfind[hunklineno])
Expand Down
14 changes: 14 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[metadata]
name = patch
version = 1.16
author = anatoly techtonik <[email protected]>
license = MIT
description = Patch utility to apply unified diffs
url = https://github.com/techtonik/python-patch/
classifiers =
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3

[options]
py_modules = patch
setup_requires = setuptools; setuptools_scm
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python3
from setuptools import setup
if __name__ == "__main__":
setup(use_scm_version = True)