path module

holger krekel pyth at
Sat Jul 26 09:49:09 CEST 2003

Van Gale wrote:
> holger krekel wrote:
> > Yes, i think adding platform specific methods to a Path object makes sense.  
> > A friend and me started working on (local and subversion) Path 
> > implementations last week.  
> > ...
> Interesting, I started a project modifying Jason's Path module to work 
> on subversion trees as well.  I didn't get too far before putting the 
> project on a back-burner so I'm glad to hear someone else is thinking 
> the same way :)

It's even working although i am not sure we stay with the
subversion-python bindings as they are fragile and incomplete at places. 
We might switch to using the commandline "svn" utility for the time beeing.  
> My extensions to Path included an additional argument to "open" that 
> included a version number, and a mechanism for retrieving some kind of 
> "metadata" associated with the file.

We instantiate the Path like so

    path = SvnPath('', rev=X)

where X is either -1 (default) meaning it should grab the latest
revision or some positive revision number.  When you 'visit' or
'listdir' or 'open' on that 'path' you stay in the same revision
and thus get a consistent view.  this is obviously a nice property. 
Btw, via the above URL you'll get our current implementation with 
lots of unittests.  You currently need subversion-python-bindings 
which are not exactly easy to get going unless you already have a 
server-side install.

> I also made another Path module that implements a "poor mans cms" if 
> subversion/rcs/cvs are not available.  It uses hidden files with version 
> numbers in the filename to emulate a real version control system.

I thought about this too.  Right now we just want to make it easy and
complete enough. 



More information about the Python-list mailing list