Rev 1396: Deal with directories. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4

Jelmer Vernooij jelmer at samba.org
Tue Jul 1 14:00:38 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/0.4

------------------------------------------------------------
revno: 1396
revision-id: jelmer at samba.org-20080701130037-moq9z20astml644a
parent: jelmer at samba.org-20080701124651-uh04jxaw3czphkgs
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Tue 2008-07-01 15:00:37 +0200
message:
  Deal with directories.
modified:
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
  versionedfiles.py              versionedfiles.py-20080626134117-j8g0ntz1pj228iox-1
=== modified file 'errors.py'
--- a/errors.py	2008-06-23 03:18:12 +0000
+++ b/errors.py	2008-07-01 13:00:37 +0000
@@ -58,6 +58,7 @@
 ERR_UNKNOWN_CAPABILITY = 200026
 ERR_AUTHN_NO_PROVIDER = 215001
 ERR_RA_DAV_RELOCATED = 175011
+ERR_FS_NOT_FILE = 160017
 
 
 class NotSvnBranchPath(NotBranchError):

=== modified file 'versionedfiles.py'
--- a/versionedfiles.py	2008-06-28 03:03:24 +0000
+++ b/versionedfiles.py	2008-07-01 13:00:37 +0000
@@ -17,6 +17,8 @@
 from bzrlib.trace import mutter
 from bzrlib.versionedfile import FulltextContentFactory, VersionedFiles, AbsentContentFactory
 
+from bzrlib.plugins.svn.errors import ERR_FS_NOT_FILE
+
 from cStringIO import StringIO
 
 class SvnTexts(VersionedFiles):
@@ -40,9 +42,15 @@
             mutter('map %r', map)
             for k,(v,ck) in map.items():
                 if v == fileid:
-                    stream = StringIO()
-                    self.repository.transport.get_file(urlutils.join(branch, k), stream, revnum)
-                    lines = stream.readlines()
+                    try:
+                        stream = StringIO()
+                        self.repository.transport.get_file(urlutils.join(branch, k), stream, revnum)
+                        lines = stream.readlines()
+                    except SubversionException, (_, num):
+                        if num == ERR_FS_NOT_FILE:
+                            lines = []
+                        else:
+                            raise
                     break
             if lines is None:
                 raise Exception("Inconsistent key specified: (%r,%r)" % (fileid, revid))




More information about the bazaar-commits mailing list