justinludwig / powerline-svnstatus Goto Github PK
View Code? Open in Web Editor NEWA Powerline segment for showing the status of a Subversion working directory
License: MIT License
A Powerline segment for showing the status of a Subversion working directory
License: MIT License
the svn command are run on the current folder of the daemon, not the current folder of the shell
proc = Popen(['svn', 'info'], stdout=PIPE, stderr=PIPE)
You correctly check there is a cwd in the segment info, but don't use it. Solution: use it
proc = Popen(['svn', 'info', cwd], stdout=PIPE, stderr=PIPE)
same apply for svn status
script is assuming that if svn status returns something, the folder is dirty. However, if it returns only external references (marked X), it should not consider folder dirty:
dispatcher > workbench > war > copan/trunk > X 1 > LANG=C svn status
X js
Performing status on external item at 'js':
dispatcher > workbench > war > copan/trunk > X 1 >
First operation done during svn status parsing is looking for the string 'URL: '. But on french language, string is 'URL :', because french language mandate space before semicolumn and not after. On a french station, this plugin will just consider path as not an svn path. This could be widely different depending on other languages i suspect.
svn info
Chemin : .
Chemin racine de la copie de travail : /home/xxxx/Workspaces/coba/coba-root
URL : https://xxxx/svn-ptx/coba/trunk
Relative URL: ^/trunk
Solution, force SVN to run in "C" environment to fallback to classical english output:
def make_env(self, segment_info):
myenv = segment_info["environ"].copy()
myenv["LANG"]="C"
myenv["LC_MESSAGES"]="C"
return myenv
proc = Popen(['svn', 'info'], stdout=PIPE, stderr=PIPE, env=self.make_env(segment_info))
proc = Popen(['svn', 'status'], stdout=PIPE, stderr=PIPE, env=self.make_env(segment_info))
The code assume that each line of svn status will provide a file / folder status with one letter and it will try to classify it. If you are running with a svn external, the svn status looks like this
`? .project
X admin
M automatix/java/com/acunia/automatix/server/eshipco/ESEngine.java
M automatix/java/com/acunia/automatix/server/eshipco/EWAEngine.java
M automatix/library.properties
? automatix/resource/setup/server-devDavidD.properties
? automatix/resource/setup/server-localhost.properties
A automatix-eshipco
A + automatix-eshipco/build.xml
A + automatix-eshipco/library.properties
Performing status on external item at 'admin/build':
`
it's choking on last line. In build_status_segment, pair[0] is an empty string and pair[0][0] is sending an exception.
Quick fix: use --ignore-externals to get svn status
proc = Popen(['svn', 'status', '--ignore-externals', cwd], stdout=PIPE, stderr=PIPE)
and handle empty pairs as a safenet
general_group = 'svnstatus_%s' % pair[0][0] if pair[0] else 'svnstatus_'
It would be great if there would be an option to display other information in the first segment than just the "branch" of the SVN repository. At the moment, the segment is hardcoded to look for a line in svn status
that starts with URL and then applies a regex to that. It might be nice if there would be an option to set which line to search for, maybe?
The reason I am interested in this, is that the SVN repositories I have do not use branches at all. Therefore, the revision number is the most useful information I could have in my prompt.
Thanks in advance for considering this!
It would be nice if I could disable this for some paths.
ex. I have mounted some external big repository and it takes few minutes to run svn status on it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.