Skip to content

Commit

Permalink
Merge pull request #40 from cscorley/issue-39-fix-context-diffs
Browse files Browse the repository at this point in the history
Fix bug where context diffs would not parse
  • Loading branch information
cscorley authored Nov 14, 2020
2 parents 503e5aa + 62ec16e commit fa7a29e
Show file tree
Hide file tree
Showing 6 changed files with 821 additions and 644 deletions.
12 changes: 7 additions & 5 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# next

- PR #37 Replace nose with pytest (Thanks, @MeggyCal)
- PR #39 Fix bug where context diffs would not parse (Thanks, @FallenSky2077)

# 1.0.0

Expand All @@ -18,15 +19,16 @@ Dev-only:
# 0.0.6

- PR #13 Support for reverse patching (Thanks, @graingert)
- This is a breaking change that converted the parsed tuples into
namedtuples and added the hunk number to that tuple
- This is a breaking change that converted the parsed tuples into namedtuples
and added the hunk number to that tuple
- PR #20 Support up to Python 3.7, drop support for 3.3 (Thanks, @graingert)
- Issue #18 fix for empty file adds in git

# 0.0.5

- PR #6 Added better support for binary files. (Thanks, @ramusus)
- PR #3 Added support for git index revision ids that have more than 7 characters (Thanks, @jopereria)
- PR #3 Added support for git index revision ids that have more than 7
characters (Thanks, @jopereria)

# 0.0.4

Expand All @@ -51,5 +53,5 @@ Dev-only:
# 0.0.1

- The very first release that included parsing support for patches in unified
diff format, context diff format, ed diff format, git, bazaar, subversion,
and cvs.
diff format, context diff format, ed diff format, git, bazaar, subversion, and
cvs.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="whatthepatch",
version="1.0.0",
version="1.0.1",
author="Christopher S. Corley",
author_email="[email protected]",
description="A patch parsing and application library.",
Expand Down
20 changes: 20 additions & 0 deletions tests/casefiles/issue39-bash42-003.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*** ../bash-4.2-patched/lib/glob/gmisc.c 2011-02-05 16:11:17.000000000 -0500
--- lib/glob/gmisc.c 2011-02-18 23:53:42.000000000 -0500
***************
*** 295,300 ****
{
pat++;
if (*pat == ']') /* right bracket can appear as equivalence class */
! pat++;
in_equiv = 1;
}
--- 331,340 ----
{
pat++;
+ bracklen++;
if (*pat == ']') /* right bracket can appear as equivalence class */
! {
! pat++;
! bracklen++;
! }
in_equiv = 1;
2 changes: 1 addition & 1 deletion tests/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUp(self):
self.lao = f.read().splitlines()

with open("tests/casefiles/tzu") as f:
self.tzu = f.read().splitlines()
self.tzu = f.read().splitlines()

def test_truth(self):
self.assertEqual(type(self.lao), list)
Expand Down
Loading

0 comments on commit fa7a29e

Please sign in to comment.