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

Subversion support #63

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

Conversation

thebjorn
Copy link
Contributor

This assumes standard svn repository layout (/trunk, /branches, /tags),
and that development is done on either trunk or branches.

This assumes standard svn repository layout (/trunk, /branches, /tags),
and that development is done on either trunk or branches.
Subversion performs a tag by copying to /tags, and this requires
message.
@@ -5,3 +5,4 @@ include/
lib/
.Python
bumpversion.egg-info/
*.pyc
Copy link
Owner

Choose a reason for hiding this comment

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

Hm ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm indeed.. It was added by the GitHub windows client... (I'll remove it).

@peritus
Copy link
Owner

peritus commented Dec 16, 2014

This needs tests and documentation.

@thebjorn
Copy link
Contributor Author

Ok. I'll see if I can't add tests + docs sometime later today or tomorrow.

@thebjorn
Copy link
Contributor Author

So I'm looking at the tests, and they're taking advantage of the fact that git and hg have very similar command syntax, so parametrizing on the command name makes sense. They all start with:

tmpdir.chdir()
check_call([vcs, "init"])

similar functionality for subversion would be

svnadmin create --fs-type fsfs some-other-dir
cd ..
svn import tmpdir file:///some-other-dir/tmpdir -m ""
rm -rf tmpdir
svn checkout file:///some-other-dir/tmpdir tmpdir
cd tmpdir

I see a couple of places where there are if vcs == "git", but obviously the above would be too much to put into every test function..(?)

A second option would be to write separate test functions for subversion, however, that seems like a bad idea.

A third option would be to parametrize the tests on objects that abstracted the needed vcs functionality (as opposed to strings like it is now), i.e.

class Git:
    def __init__(self, directory):
        directory.chdir()
        check_call(["git", "init"])
    def list_tags(self):
        return check_output(["git", "tag"])

@pytest.fixture
def git(tmpdir):
    return Git(tmpdir)

class Hg:
    ...
    def list_tags(self):
        return check_output(["git", "tags"])

That seems like a very radical change for this pull-request though.

Any advice on how to proceed?

@and1er
Copy link

and1er commented Jan 10, 2018

Is it appropriate to separate VCS tests: independent Git, Mercurial and Subversion test could be adaptive for each VCS particular features?

This pull request is pending more than 3 years. Many developers with Subversion still need to write own wrappers for committing and tagging. I'm one of them.

@thebjorn
Copy link
Contributor Author

I no longer have any interest in this PR. If someone wants to take it over and run with it you're welcome to treat this PR as your own. (FWIW, I now believe it is a mistake to combine upversioning and source tagging..)

@and1er
Copy link

and1er commented Jan 11, 2018

@thebjorn, okay, thank you for the response.
I will try to finish PR (or create my own with references to this PR, I haven't done this before). Maybe. Because I actually wrap version bumping by a task and it is more convenient to commit and tag nearby.

@thebjorn
Copy link
Contributor Author

@and1er if you're doing a PR, it might be better received over at https://github.com/c4urself/bump2version which seems to be under more active development.

ps: if you're using invoke, then you might be interested in the upversion task in https://github.com/datakortet/dk-tasklib/blob/master/dktasklib/upversion.py#L65, usage e.g. inv upversion --minor. It knows about the regular places you'd find version numbers, and can easily be configured

ns.configure({
    'pkg': Package(),
    'versionfiles': [
        'path/to/file/with/version/number.xml'
    ], ...
})

I've also implemented option 3 from above in a project that's not published yet, but if there is interest I can probably publish it early next month..

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.

3 participants