Sitelet https://web.archive.org/web/20201209095607/https://github.com/powerline/powerline/pull/1142
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

Support for Subversion #1142

Open
wants to merge 4 commits into
base: develop
from
Open

Support for Subversion #1142

wants to merge 4 commits into from

Conversation

@fladi
Copy link

@fladi fladi commented Nov 6, 2014

This adds a new VCS module called svn.py that uses PySVN to gather information if the current working directory is part of a Subversion repository.

As there is no clear definition of a branch in Subversion, this module uses the difference between the actual (remote) repository root URL and the URL of the checked out copy as the branch name. If the Subversion repository follows the usual conventions, this would lead to names like /trunk, /branch/feature/foo or /tag/1.0.1. The currently checked our revision number is displayed after the branch name (as in /trunk:r1234). If the local copy was checked out from the remote repository root URL, the branch name will simply be /.

:None: clean (status is empty)
With file argument: returns status of this file: The status codes are
those returned by bzr status -S

This comment has been minimized.

@ZyX-I

ZyX-I Nov 6, 2014
Contributor

bzr status?

}
s = self.client.status(join(directory, path))
if s:
s = s .pop()

This comment has been minimized.

@ZyX-I

ZyX-I Nov 6, 2014
Contributor

Invalid space here. Please use the lint checker as described in documentation (also duplicated in /.local.vimrc for syntastic) on all files.


def revision(self, directory, config_file):
info = self.client.info(directory)
return u"/{path}:r{revision}".format(

This comment has been minimized.

@ZyX-I

ZyX-I Nov 6, 2014
Contributor

You should not use u"": first, almost everywhere single quotes are used. Second, there is from __future__ import unicode_literals at the top.

@@ -217,6 +217,7 @@ def tree_status(repo, pl):
('git', '.git', os.path.exists),
('mercurial', '.hg', os.path.isdir),
('bzr', '.bzr', os.path.isdir),
('svn', '.svn', os.path.isdir),

This comment has been minimized.

@ZyX-I

ZyX-I Nov 6, 2014
Contributor

Should be using full name here: 'subversion', not 'svn'. With this change all module names will be the same as package names in almost every linux system (for some reason there are git, mercurial, subversion and bzr packages even though full name is bazaar).

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Nov 6, 2014

Also missing documentation update: it should mention that pysvn is required to support subversion.

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Nov 6, 2014

In any case, good job!

@fladi fladi force-pushed the fladi:subversion branch from cc999c5 to 04be87f Nov 7, 2014
@fladi fladi force-pushed the fladi:subversion branch from 04be87f to c5afa80 Nov 7, 2014
@fladi
Copy link
Author

@fladi fladi commented Nov 7, 2014

I addressed your issues and rebased my commits to be more concise in their changes.

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Nov 7, 2014

And forgot a thing: pysvn and subversion should be installed in travis (script test/install.sh, first should be installed via pip (otherwise you will get pysvn only for one Python version AFAIK), second via apt-get).

Maybe also libsvn-dev, I am not sure whether it is required by pip to compile pysvn.

@fladi fladi force-pushed the fladi:subversion branch 4 times, most recently from befd150 to c5afa80 Nov 8, 2014
@fladi
Copy link
Author

@fladi fladi commented Nov 8, 2014

I'm not aware of a way to install pysvn using pip. Installing it using apt-get does not work as the tests are run inside a virtualenv. Right now I have no idea on how to make the tests work on travis.

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Nov 8, 2014

Then I guess it will be better to distribute binaries in test/binaries/pysvn. I was going to do this for zsh (+ zpython) and Vim some day (current Vim tests all use one system version of Python which is not good) (and, maybe, fish), but did not yet convinced myself that I should do this now.

I can say I know binaries compiled on rather modern Gentoo (mostly stable versions) for itself worked well in neovim project dependencies (until they set up the bot that does compilation in travis). But I do not think that compiling pysvn in install step will raise build time enough. Thus it looks like putting pysvn-1.7.9.tar.gz there and running pip install test/binaries/pysvn/pysvn-1.7.9.tar.gz should work. Should require putting apt-get install … line above the pip install lines.

@fladi
Copy link
Author

@fladi fladi commented Nov 19, 2014

After looking further into the installation process of PySVN, I'd say, that I'd not recommend installing it directly from source (shiver). Feel free to close this PR as I think that me basing it on PySVN was the wrong decision in the first place.

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Nov 20, 2014

@fladi Have you actually tried doing this in travis? I saw reports that pip install works for pysvn (as well as complaints about installation process).

@fladi
Copy link
Author

@fladi fladi commented Nov 21, 2014

Installing it with pip only installs the wrapper for the CXX extension, not the C++ library itself ... thats done by a (64kb) setup_configure.py that has to be called with paths to the various library header files. I tried doing it on travis but gave up after several failed attempts.

@ccope
Copy link

@ccope ccope commented Nov 21, 2014

Judging from this person's travis config (and green build), apt-get'ing pysvn can work: https://github.com/yadt/yadt-config-rpm-maker/blob/master/.travis.yml

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Nov 21, 2014

@ccope This person is using only one Python version. I think it happens to be the same as system version.

@ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Jan 7, 2015

@fladi If you know how to build pysvn you can post a script here so that it can be used with https://github.com/powerline/bot-ci (do not run PR there (more precise: if you run the PR do not expect it to build): uploading build results requires deployment key, deployment key requires encryption and encrypted environment variables are not available in PRs thus PRs builds are disabled there because they should fail otherwise).

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.