From jspaans at thehealthagency.com Tue Apr 1 17:23:22 2008 From: jspaans at thehealthagency.com (Jasper Spaans) Date: Tue, 1 Apr 2008 17:23:22 +0200 Subject: [py-dev] svnwc.auth patchlet Message-ID: Hi py-dev, I'm currently exploring the py.path module, and am trying to get it svnwc to work with svn locking. The following would be nice to have, as the current version doesn't provide a method to find out if a file has been locked: --- path/svn/wccommand.py~ 2008-04-01 17:13:09.000000000 +0200 +++ path/svn/wccommand.py 2008-04-01 17:13:09.000000000 +0200 @@ -644,7 +644,10 @@ if 'lastchangeddate' in d: self.mtime = parse_wcinfotime(d['lastchangeddate']) self.time = self.mtime * 1000000 - + if 'lockowner' in d: + self.lock = { 'owner': d['lockowner'], + 'mtime': parse_wcinfotime(d['lockcreated']) } + def __eq__(self, other): return self.__dict__ == other.__dict__ Proof of concept of the output: >>> import py >>> x = py.path.svnwc('/tmp/svnstoragetest-TMUVVD/root.xml') >>> dir(x.info()) ['__doc__', '__eq__', '__init__', '__module__', 'created_rev', 'kind', 'last_author', 'lock', 'mtime', 'path', 'rev', 'size', 'time', 'url'] >>> x.info().lock {'owner': 'foo', 'mtime': 1207067232} Cheers, -- Jasper Spaans http://www.thehealthagency.com/ From cfbolz at gmx.de Tue Apr 1 18:32:31 2008 From: cfbolz at gmx.de (Carl Friedrich Bolz) Date: Tue, 01 Apr 2008 18:32:31 +0200 Subject: [py-dev] svnwc.auth patchlet In-Reply-To: References: Message-ID: <47F2639F.8000609@gmx.de> Hi Jasper, Jasper Spaans wrote: > I'm currently exploring the py.path module, and am trying to get it > svnwc to work with svn locking. The following would be nice to have, > as the current version doesn't provide a method to find out if a file > has been locked: > > --- path/svn/wccommand.py~ 2008-04-01 17:13:09.000000000 +0200 > +++ path/svn/wccommand.py 2008-04-01 17:13:09.000000000 +0200 > @@ -644,7 +644,10 @@ > if 'lastchangeddate' in d: > self.mtime = parse_wcinfotime(d['lastchangeddate']) > self.time = self.mtime * 1000000 > - > + if 'lockowner' in d: > + self.lock = { 'owner': d['lockowner'], > + 'mtime': parse_wcinfotime(d['lockcreated']) } > + > def __eq__(self, other): > return self.__dict__ == other.__dict__ > > > Proof of concept of the output: > >>> import py > >>> x = py.path.svnwc('/tmp/svnstoragetest-TMUVVD/root.xml') > >>> dir(x.info()) > ['__doc__', '__eq__', '__init__', '__module__', 'created_rev', 'kind', > 'last_author', 'lock', 'mtime', 'path', 'rev', 'size', 'time', 'url'] > >>> x.info().lock > {'owner': 'foo', 'mtime': 1207067232} Could you write a few tests for that feature too? Otherwise I can't really apply the patch. Thanks, Carl Friedrich From jspaans at thehealthagency.com Tue Apr 1 18:59:45 2008 From: jspaans at thehealthagency.com (Jasper Spaans) Date: Tue, 1 Apr 2008 18:59:45 +0200 Subject: [py-dev] svnwc.auth patchlet In-Reply-To: <47F2639F.8000609@gmx.de> References: <47F2639F.8000609@gmx.de> Message-ID: Hi Carl Friedrich, > Could you write a few tests for that feature too? Otherwise I can't > really apply the patch. See the attached file for a reimplementation and some tests. Cheers, -- Jasper Spaans http://www.thehealthagency.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: svn.info.lock.patch Type: application/octet-stream Size: 2500 bytes Desc: not available URL: