By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

python cvs interface?

P: n/a
Hi everyone, this should be a quick question. I'm writing some scripts
to take some file and move them into a CVS repository, but it's pretty
slow, because it uses system calls to execute the CVS commands. Has
anyone ever made a python to CVS interface library that I could use?
I've been trying to google around for something, but predictably I get
a zillion sourceforge repository hits, and it isn't really helping. So
anyway, if anyone knows of a useful module, I'd love to hear about it.

----- Corey

Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies

P: n/a
WinCvs can use python for macros, you might want to look at their code:

You may also want to look at viewcvs, which is written in Python.


Jul 18 '05 #2

P: n/a
Thanks, that looks promising, I'll take a look!

Jul 18 '05 #3

P: n/a
Ah, unfortunately it looks like this program uses something called
gcvs, a gtk cvs interface written in C++, for interfacing to low level
cvs routines. So it probably won't work for me. Oh well. Anyone else
have any suggestions?

Jul 18 '05 #4

P: n/a
>From what it sounds like in your program, you're making an os.system()
function call and waiting for the results, correct? Have you tried
using the plethora of parallel system tools so that you don't have to
wait for a command to finish? Using a function that will launch your
command in a new thread/process may speed up your program considerably.

Simply launch a task, return control to the user, and refresh after it
returns successfully.

Jul 18 '05 #5

P: n/a
Unless your CVS repository is local, the overhead associated with
calling CVS through system calls isn't going to be a bottleneck, and
even then it shouldn't be too bad. Using one of the varieties of
os.popen instead of os.system will make it easier to avoid disk I/O
when communicating with the cvs process.

It will be a hassle to parse CVS' copious output, though. I've wished
for a Python CVS module before, too. Good luck =)

IMHO, the best way to write a Python CVS module would actually be to
call it from the command line; writing a Python C Extension for this
purpose would introduce a negligible performance increase at the cost
of all sorts of other hassles, like expecting users to have the CVS
headers/libraries and a C compiler and possibly something like SWIG or
Boost Python as well.

Jul 18 '05 #6

P: n/a
Well, the problem is that there are a lot of files to deal with, and
I'm already running in parallel, but it still takes a while. Also, cvs
uses some sort of locking scheme to stop parallel updates, so it's hard
to parallelize effectively.

Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.