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

Move the index to cffi and add conflict information #389

Merged
merged 7 commits into from
Jul 10, 2014

Conversation

carlosmn
Copy link
Member

I wanted to add information for conflicts, so I went and put it into python beforehand.

This commit gives us feature-parity with the version in C.
The method is in Repository, but the merge functionality is separate. We
will introduce more tests in this area later.
Add documentation for the conflicts, and add some for IndexEntry and
Index which went missing during the conversion to cffi.
@carlosmn
Copy link
Member Author

Instead of having Index.has_conflicts as the quick check versus Index.conflicts which creates a collection object, we could make Index.conflicts return None if there are no conflicts, so a query

if index.has_conflicts:
    print("pls fix")

becomes

if index.conflicts:
   print("pls fix")

return centry, path

@classmethod
def _from_c(cls, centry):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not from_c like in Index.from_c? Is more consistent this way

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it's a special function. I went back and forth on that one, but this is a private function that only makes sense inside pygit2. The consistency should go the other way.

@jdavid jdavid merged commit 7f922ae into libgit2:master Jul 10, 2014
@carlosmn carlosmn mentioned this pull request Jul 10, 2014
@jdavid
Copy link
Member

jdavid commented Jul 19, 2014

+1 to make conflicts return None and remove has_conflicts

@jdavid
Copy link
Member

jdavid commented Jul 22, 2014

Ok just did that.

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

Successfully merging this pull request may close these issues.

None yet

3 participants