Skip to content

Commit cdc6458

Browse files
authored
Release 1.0.5 (#58)
1 parent 427934e commit cdc6458

File tree

5 files changed

+75
-68
lines changed

5 files changed

+75
-68
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Nothing yet :)
44

5+
# 1.0.5
6+
7+
- PR #57 bugfix:min line in binary diff (Thanks, @babenek and @abbradar)
8+
59
# 1.0.4
610

711
- PR #53 git binary patch support (Thanks, @babenek)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "whatthepatch"
3-
version = "1.0.4"
3+
version = "1.0.5"
44
maintainers = [{ name = "Christopher S. Corley", email = "[email protected]" }]
55
requires-python = ">=3.7"
66
readme = "README.rst"

release.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
with python3Packages;
33
buildPythonPackage rec {
44
pname = "whatthepatch";
5-
version = "1.0.4";
5+
version = "1.0.5";
66
format = "pyproject";
77
src = ./.;
88

tests/casefiles/git-bin.patch

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
fox.bin | Bin 0 -> 44 bytes
3+
fox.txt | 2 +-
4+
lorem.bin | Bin 0 -> 446 bytes
5+
lorem.zip | Bin 431 -> 432 bytes
6+
4 files changed, 1 insertion(+), 1 deletion(-)
7+
create mode 100644 fox.bin
8+
create mode 100644 lorem.bin
9+
10+
diff --git a/fox.bin b/fox.bin
11+
new file mode 100644
12+
index 0000000000000000000000000000000000000000..e7683ad05fd121a9ca86cab5a827d471d29b4d4f
13+
GIT binary patch
14+
literal 44
15+
ycmWH^NL45-%}mZ#NGi%N&r?XtuTaP;%`GTa$S+GRQYZmR=Ok8DDx~D6GXMZ<wh!6>
16+
17+
literal 0
18+
HcmV?d00001
19+
20+
diff --git a/fox.txt b/fox.txt
21+
index ff3bb63..8fe2a4b 100644
22+
--- a/fox.txt
23+
+++ b/fox.txt
24+
@@ -1 +1 @@
25+
-The quick brown fox jumps over the lazy dog
26+
\ No newline at end of file
27+
+The quick brown fox jumps over the lazy dog.
28+
\ No newline at end of file
29+
diff --git a/lorem.bin b/lorem.bin
30+
new file mode 100644
31+
index 0000000000000000000000000000000000000000..aef2724fd9ff72caf4eb1ac8333f0b5b322d82fb
32+
GIT binary patch
33+
literal 446
34+
zcmXw#&2d992!vD07T|eRB)42s0Fkh>Gy1ax9+w~Fm)wMaW%v8+Q!6-@SL9y$#G*l}
35+
z+6Ae%rODKMLNW(eV!J^Lqq#K40+haL&oHecme~?Bvp0hqihPGW)J|zdm0J@?;oarH
36+
zmq8nAXrppJ9#KlY;O<;#ecAL3ed<g!G4=*8MQZA&@*d*izVwphh+(LN@fx1`86ZyC
37+
zf%h#bZVFBhPiIy(OdV5yv}K(UJU$-1_=s~Fb|NWsEk$A}|AZot<LWnxp>0DLGNbT$
38+
z;NzKem<F)LV9-+%O)-~zFiWULtcEc=v$joflZvCs%aENL{d#4hAnVe(yS0~XLpC4=
39+
Lj`hdY>+$vrMRcVJ
40+
41+
literal 0
42+
HcmV?d00001
43+
44+
diff --git a/lorem.zip b/lorem.zip
45+
index 0f6beb70488e2b29fcaadf724b6f48ef0ab5bc4e..3c8a65bf1a97bb4180c83a0e31352b4edb4c245e 100644
46+
GIT binary patch
47+
delta 275
48+
zcmZ3_yn#6)z?+#xgn@y9gP}7+C2a4}O*1$c85s5gF(-ozLr#8CYOY>MMM-D~Cj+xl
49+
z?ABymATF)oW?*D_!OXw_CQK(BEOa*HaEZRjWV65P$+T=Pg^u?VBeY_ymt>hupAyrM
50+
zu_ldGFZao&vTKV}cPYzE-4`VHX!@1~7xxOUc%}T}z;fqZ+pf4>{#%je`L@mdh12$@
51+
z##~QSCtp2z)oM{#R?hTKa+j9=zO;TxpG;eTRQ}78>li9e@lU*`!E<hhw&gFg7Dwam
52+
z8SImV7?t(so$}Jyl=3cb^RC<rY)d+m{}%R^{b303W@M6M#^TAz$&AWOMzNDS7!}#P
53+
Jfj(wn0067{YH|Po
54+
55+
delta 274
56+
zcmdnMyq-BCz?+#xgn@y9gW*b=N|;w+e?B`S1H&F5=46mz$jL8C&DATZC<zVWWMKXf
57+
zwKe%I5SLbPGcdBeU}j(d6Q&am7CIYpxJ2J%vRS9J^XV)mjz|9|Mrg$d2bs?H_R@1O
58+
z3ERvx-K;3mI{Tu~UBN!DcuoF~-cc7`ykS}Oi(}X0%ZjnlS&LuR*=$}?c38P&;q6b7
59+
zte+;GeDx$tHc;Din|CGu%S*K{!-L%UoHcs4e@O{%uz6ZO@ty`xpT$&}TIoXzX1boS
60+
zo-D+utS58IOJh^YyS&Z2axbtg=}i7x*!zt+z?+dtjv0#|C#NtfGku7f+{viO<^}XH
61+
G0|Nj=Vq`=B
62+
63+
--

tests/test_patch.py

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,69 +1450,9 @@ def test_huge_patch(self):
14501450
self.assertGreater(20, time.time() - start_time)
14511451

14521452
def test_git_bin_patch(self):
1453-
text = """---
1454-
fox.bin | Bin 0 -> 44 bytes
1455-
fox.txt | 2 +-
1456-
lorem.bin | Bin 0 -> 446 bytes
1457-
lorem.zip | Bin 431 -> 432 bytes
1458-
4 files changed, 1 insertion(+), 1 deletion(-)
1459-
create mode 100644 fox.bin
1460-
create mode 100644 lorem.bin
1461-
1462-
diff --git a/fox.bin b/fox.bin
1463-
new file mode 100644
1464-
index 0000000000000000000000000000000000000000..e7683ad05fd121a9ca86cab5a827d471d29b4d4f
1465-
GIT binary patch
1466-
literal 44
1467-
ycmWH^NL45-%}mZ#NGi%N&r?XtuTaP;%`GTa$S+GRQYZmR=Ok8DDx~D6GXMZ<wh!6>
1468-
1469-
literal 0
1470-
HcmV?d00001
1471-
1472-
diff --git a/fox.txt b/fox.txt
1473-
index ff3bb63..8fe2a4b 100644
1474-
--- a/fox.txt
1475-
+++ b/fox.txt
1476-
@@ -1 +1 @@
1477-
-The quick brown fox jumps over the lazy dog
1478-
\ No newline at end of file
1479-
+The quick brown fox jumps over the lazy dog.
1480-
\ No newline at end of file
1481-
diff --git a/lorem.bin b/lorem.bin
1482-
new file mode 100644
1483-
index 0000000000000000000000000000000000000000..aef2724fd9ff72caf4eb1ac8333f0b5b322d82fb
1484-
GIT binary patch
1485-
literal 446
1486-
zcmXw#&2d992!vD07T|eRB)42s0Fkh>Gy1ax9+w~Fm)wMaW%v8+Q!6-@SL9y$#G*l}
1487-
z+6Ae%rODKMLNW(eV!J^Lqq#K40+haL&oHecme~?Bvp0hqihPGW)J|zdm0J@?;oarH
1488-
zmq8nAXrppJ9#KlY;O<;#ecAL3ed<g!G4=*8MQZA&@*d*izVwphh+(LN@fx1`86ZyC
1489-
zf%h#bZVFBhPiIy(OdV5yv}K(UJU$-1_=s~Fb|NWsEk$A}|AZot<LWnxp>0DLGNbT$
1490-
z;NzKem<F)LV9-+%O)-~zFiWULtcEc=v$joflZvCs%aENL{d#4hAnVe(yS0~XLpC4=
1491-
Lj`hdY>+$vrMRcVJ
1492-
1493-
literal 0
1494-
HcmV?d00001
1495-
1496-
diff --git a/lorem.zip b/lorem.zip
1497-
index 0f6beb70488e2b29fcaadf724b6f48ef0ab5bc4e..3c8a65bf1a97bb4180c83a0e31352b4edb4c245e 100644
1498-
GIT binary patch
1499-
delta 275
1500-
zcmZ3_yn#6)z?+#xgn@y9gP}7+C2a4}O*1$c85s5gF(-ozLr#8CYOY>MMM-D~Cj+xl
1501-
z?ABymATF)oW?*D_!OXw_CQK(BEOa*HaEZRjWV65P$+T=Pg^u?VBeY_ymt>hupAyrM
1502-
zu_ldGFZao&vTKV}cPYzE-4`VHX!@1~7xxOUc%}T}z;fqZ+pf4>{#%je`L@mdh12$@
1503-
z##~QSCtp2z)oM{#R?hTKa+j9=zO;TxpG;eTRQ}78>li9e@lU*`!E<hhw&gFg7Dwam
1504-
z8SImV7?t(so$}Jyl=3cb^RC<rY)d+m{}%R^{b303W@M6M#^TAz$&AWOMzNDS7!}#P
1505-
Jfj(wn0067{YH|Po
1506-
1507-
delta 274
1508-
zcmdnMyq-BCz?+#xgn@y9gW*b=N|;w+e?B`S1H&F5=46mz$jL8C&DATZC<zVWWMKXf
1509-
zwKe%I5SLbPGcdBeU}j(d6Q&am7CIYpxJ2J%vRS9J^XV)mjz|9|Mrg$d2bs?H_R@1O
1510-
z3ERvx-K;3mI{Tu~UBN!DcuoF~-cc7`ykS}Oi(}X0%ZjnlS&LuR*=$}?c38P&;q6b7
1511-
zte+;GeDx$tHc;Din|CGu%S*K{!-L%UoHcs4e@O{%uz6ZO@ty`xpT$&}TIoXzX1boS
1512-
zo-D+utS58IOJh^YyS&Z2axbtg=}i7x*!zt+z?+dtjv0#|C#NtfGku7f+{viO<^}XH
1513-
G0|Nj=Vq`=B
1453+
with open("tests/casefiles/git-bin.patch") as f:
1454+
text = f.read()
15141455

1515-
--"""
15161456
result = list(wtp.patch.parse_patch(text))
15171457
assert result
15181458
assert len(result) == 4
@@ -1560,12 +1500,12 @@ def test_git_bin_patch_minline(self):
15601500
assert result
15611501
assert len(result) == 1
15621502
assert (
1563-
hashlib.sha1(result[0].changes[0].line).hexdigest()
1564-
== "732e7e005ff8b71ab4b72398db0320f2fa012b81"
1503+
hashlib.sha1(result[0].changes[0].line).hexdigest()
1504+
== "732e7e005ff8b71ab4b72398db0320f2fa012b81"
15651505
)
15661506
assert (
1567-
hashlib.sha1(result[0].changes[1].hunk).hexdigest()
1568-
== "b07b94142cfce2094b5be04e9d30b653a7c63917"
1507+
hashlib.sha1(result[0].changes[1].hunk).hexdigest()
1508+
== "b07b94142cfce2094b5be04e9d30b653a7c63917"
15691509
)
15701510

15711511

0 commit comments

Comments
 (0)