Skip to content

#5320 Import Python Patch #5761

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 11 commits into from
Oct 23, 2019
Merged

Conversation

uilianries
Copy link
Member

@uilianries uilianries commented Sep 17, 2019

The easiest way to fix our problem related to patching is by the
upstream. However, neither the upstream and their forks are maintaining
the project since 3 years ago.

So idea here is importing the original implementation and merging with the current PR in upstream.

This current PR is able to fix add/rem files using patch apply

Changelog: Fix: Add and remove out-of-tree git patches (#5320)
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

- The easiest way to fix our problem related to patching is by the
upstream. However, neither the upstream and forks are maintaining
the project since 3 years ago. So idea here is importing the original
implementation and merging with the current PR in upstream.

Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
@lasote lasote modified the milestone: 1.20 Sep 23, 2019
@SSE4
Copy link
Contributor

SSE4 commented Sep 23, 2019

another option: https://github.com/libgit2/pygit2

@memsharded
Copy link
Member

What am I missing here? I cannot find such patch-ng.

@uilianries
Copy link
Member Author

uilianries commented Sep 30, 2019

We need to publish first our fork: https://github.com/conan-io/python-patch-ng

@lasote lasote assigned lasote and unassigned jgsogo Oct 1, 2019
@lasote
Copy link
Contributor

lasote commented Oct 1, 2019

I assign to myself to review the fork and publish to pypi

@danimtb danimtb added this to the 1.20 milestone Oct 4, 2019
@lasote lasote assigned uilianries and unassigned lasote Oct 10, 2019
@lasote
Copy link
Contributor

lasote commented Oct 10, 2019

I've published the patch-ng. Looks like it broke some test. Check please

@lasote
Copy link
Contributor

lasote commented Oct 15, 2019

We need a test for #5320. I'm not opposed to have it here in Conan.

@lasote lasote assigned lasote and unassigned uilianries Oct 16, 2019
Signed-off-by: Uilian Ries <[email protected]>
client.run("install .")
client.run("build .")
bar_content = load(os.path.join(client.current_folder, "bar.txt"))
self.assertIn(dedent("""Yo no creo en brujas, pero que las hay, las hay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These asserts here are useless... right? I want to assert the final files in the cache. So do this asserts in the build() method or access to the recipe folder in the cache.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, they are the result of patch method. I can internalize in build() but I think it will result on same thing. The original file only contains a part of the phrase, after applying the patch the phrase is complete, so the patch need to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, ok. I missed that is a local build() method.

@lasote lasote merged commit 7c55843 into conan-io:develop Oct 23, 2019
@lasote lasote mentioned this pull request Oct 23, 2019
3 tasks
@uilianries uilianries deleted the hotfix/git-patch-strip branch October 24, 2019 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants