Skip to content
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

Patch context is applied as well #55

Open
SeverinLeonhardt opened this issue Jan 26, 2018 · 0 comments
Open

Patch context is applied as well #55

SeverinLeonhardt opened this issue Jan 26, 2018 · 0 comments

Comments

@SeverinLeonhardt
Copy link

Given file.txt:

a
b
c

And this patch (my.diff):

--- file.txt
+++ file.txt
@@ -1,3 +1,4 @@
 a
 b
+b1
 d

Which is applied using:

import patch
p = patch.fromfile("my.diff")
p.apply(".")

file.txt now looks like this:

a
b
b1
d

The patch only adds b1 but the following context was also put into the file. After applying the patch file.txt should not contain d but end with c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant