Rev 1017: Include working copy version number. in file:///data/jelmer/bzr-svn/pyrex/

Jelmer Vernooij jelmer at samba.org
Fri Mar 21 04:01:30 GMT 2008


At file:///data/jelmer/bzr-svn/pyrex/

------------------------------------------------------------
revno: 1017
revision-id: jelmer at samba.org-20080321040128-415ktwbwm966v8yo
parent: jelmer at samba.org-20080319224647-52s9u285ylc2qnz3
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: pyrex
timestamp: Fri 2008-03-21 05:01:28 +0100
message:
  Include working copy version number.
modified:
  wc.pyx                         wc.pyx-20080313142018-10l8l23vha2j9e6b-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'wc.pyx'
--- a/wc.pyx	2008-03-18 23:48:01 +0000
+++ b/wc.pyx	2008-03-21 04:01:28 +0000
@@ -67,6 +67,7 @@
         char *cachable_props
         char *present_props
 
+    svn_error_t *svn_wc_check_wc(char *path, int *wc_format, apr_pool_t *pool)
 
     svn_version_t *svn_wc_version()
     svn_error_t *svn_wc_adm_open3(svn_wc_adm_access_t **adm_access,
@@ -618,3 +619,10 @@
     check_error(svn_wc_ensure_adm2(path, uuid, url, c_repos, rev, pool))
     apr_pool_destroy(pool)
 
+def check_wc(char *path):
+    cdef apr_pool_t *pool
+    cdef int wc_format
+    pool = Pool(NULL)
+    check_error(svn_wc_check_wc(path, &wc_format, pool))
+    apr_pool_destroy(pool)
+    return wc_format

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-03-18 23:27:43 +0000
+++ b/workingtree.py	2008-03-21 04:01:28 +0000
@@ -60,7 +60,8 @@
 class SvnWorkingTree(WorkingTree):
     """WorkingTree implementation that uses a Subversion Working Copy for storage."""
     def __init__(self, bzrdir, local_path, branch):
-        self._format = SvnWorkingTreeFormat()
+        version = wc.check_wc(local_path)
+        self._format = SvnWorkingTreeFormat(version)
         self.basedir = local_path
         self.bzrdir = bzrdir
         self._branch = branch
@@ -712,16 +713,19 @@
 
 class SvnWorkingTreeFormat(WorkingTreeFormat):
     """Subversion working copy format."""
+    def __init__(self, version):
+        self.version = version
+
     def __get_matchingbzrdir(self):
         return SvnWorkingTreeDirFormat()
 
     _matchingbzrdir = property(__get_matchingbzrdir)
 
     def get_format_description(self):
-        return "Subversion Working Copy"
+        return "Subversion Working Copy Version %d" % self.version
 
     def get_format_string(self):
-        return "Subversion Working Copy Format"
+        raise NotImplementedError
 
     def initialize(self, a_bzrdir, revision_id=None):
         raise NotImplementedError(self.initialize)




More information about the bazaar-commits mailing list