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

multiple issues with git backend #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

multiple issues with git backend #12

wants to merge 7 commits into from

Conversation

swilcox
Copy link
Contributor

@swilcox swilcox commented Oct 1, 2010

This is a fix for multiple issues (both 9 and 10) related the git backend of pyvcs.

The primary way to see the issue(s) has been to create a new empty git repo and then perform a couple of adds/commits on some new files. I pulled in pbiggar's changes to handle not blowing up upon hitting a commit with no parent and fixing the deprecation warnings. I fixed the long line.

Like issue 11 (with the hg backend), there is also a problem with showing the diff of the first commit because it then defaulted to comparing that commit to the current HEAD instead of to an empty file set of empty files.

I essentially created a new special name for this situation and called it 'NULL'. So when diff'ing a commit that has no parent, it now uses 'NULL' as the "name" for the commit instead of None (which would get the HEAD). So viewing the first commit in history now correctly shows the add of files and their contents... because it's now comparing them to empty filesets.

But None still works correctly in the case of just getting the contents of a file without a commit id/name (i.e. getting the latest and greatest). With this change, both the hg and git backends will now behave identically with regard to commits without parents.

pbiggar and others added 7 commits August 23, 2010 18:20
Update to less deprecated syntax in a number of cases (repo[sha] vs
repo.getobject()).
…ommit so diff'ing a file with no parent correctly shows the full ADD rather than showing the difference to the current HEAD
…issues for other systems. Resolution for bzr was referencing the 'null:' revision tree
…fication etc... to test simple repo and the library. This is dependent on a posix type environment (i.e. not windows). But what this does allow for is some basic testing without requiring an existing repo to work
@swilcox
Copy link
Contributor Author

swilcox commented Oct 1, 2010

I've added some test stuff,

tests/simple_git_tests.py
tests/setup_git_test.sh
tests/teardown_git_test.sh

This is obviously not the comprehensive suite everyone would want, but it does (in a posix) environment exercise the git backend in a fairly generic way without referring to someone's specific repo since it actually creates a repo, modifies it, runs the tests and then destroys it. Hate that I had to use shell scripts, but for something quick, this seemed like the only practical thing to do until someone creates something better.

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.

2 participants