[py-svn] r51999 - py/branch/guido-svn-auth/py/path/svn

guido at codespeak.net guido at codespeak.net
Sat Mar 1 14:27:30 CET 2008


Author: guido
Date: Sat Mar  1 14:27:30 2008
New Revision: 51999

Modified:
   py/branch/guido-svn-auth/py/path/svn/urlcommand.py
Log:
Removing a bit of redundancy.


Modified: py/branch/guido-svn-auth/py/path/svn/urlcommand.py
==============================================================================
--- py/branch/guido-svn-auth/py/path/svn/urlcommand.py	(original)
+++ py/branch/guido-svn-auth/py/path/svn/urlcommand.py	Sat Mar  1 14:27:30 2008
@@ -97,6 +97,10 @@
     def _encodedurl(self):
         return self._escape(self.strpath)
 
+    def _norev_delentry(self, path):
+        auth = self.auth and self.auth.makecmdoptions() or None
+        self._lsnorevcache.delentry((str(path), auth))
+
     def open(self, mode='r'):
         """ return an opened file with the given mode. """
         assert 'w' not in mode and 'a' not in mode, "XXX not implemented for svn cmdline"
@@ -127,8 +131,7 @@
         commit_msg=kwargs.get('msg', "mkdir by py lib invocation")
         createpath = self.join(*args)
         createpath._svnwrite('mkdir', '-m', commit_msg)
-        auth = self.auth and self.auth.makecmdoptions() or None
-        self._lsnorevcache.delentry((createpath.dirpath().strpath, auth))
+        self._norev_delentry(createpath.dirpath())
         return createpath
 
     def copy(self, target, msg='copied by py lib invocation'):
@@ -137,8 +140,7 @@
             raise py.error.EINVAL(target, "revisions are immutable")
         self._svncmdexecauth('svn copy -m "%s" "%s" "%s"' %(msg,
                              self._escape(self), self._escape(target)))
-        auth = self.auth and self.auth.makecmdoptions() or None
-        self._lsnorevcache.delentry((target.dirpath().strpath, auth))
+        self._norev_delentry(target.dirpath())
 
     def rename(self, target, msg="renamed by py lib invocation"):
         """ rename this path to target with checkin message msg. """
@@ -146,9 +148,8 @@
             raise py.error.EINVAL(self, "revisions are immutable")
         self._svncmdexecauth('svn move -m "%s" --force "%s" "%s"' %(
                              msg, self._escape(self), self._escape(target)))
-        auth = self.auth and self.auth.makecmdoptions() or None
-        self._lsnorevcache.delentry((self.dirpath().strpath, auth))
-        self._lsnorevcache.delentry((self.strpath, auth))
+        self._norev_delentry(self.dirpath())
+        self._norev_delentry(self)
 
     def remove(self, rec=1, msg='removed by py lib invocation'):
         """ remove a file or directory (or a directory tree if rec=1) with
@@ -156,8 +157,7 @@
         if self.rev is not None:
             raise py.error.EINVAL(self, "revisions are immutable")
         self._svncmdexecauth('svn rm -m "%s" "%s"' %(msg, self._escape(self)))
-        auth = self.auth and self.auth.makecmdoptions() or None
-        self._lsnorevcache.delentry((self.dirpath().strpath, auth))
+        self._norev_delentry(self.dirpath())
 
     def export(self, topath):
         """ export to a local path
@@ -201,8 +201,7 @@
                     self._escape(tempdir.join(basename)), 
                     x.join(basename)._encodedurl())
             self._svncmdexecauth(cmd) 
-            auth = self.auth and self.auth.makecmdoptions() or None
-            self._lsnorevcache.delentry((x.strpath, auth)) # !!!
+            self._norev_delentry(x)
         finally:    
             tempdir.remove() 
         return target


More information about the py-svn mailing list