Rev 308: Deal with branch downgrades. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Tue Dec 26 19:59:55 GMT 2006


------------------------------------------------------------
revno: 308
revision-id: jelmer at samba.org-20061226195841-9zmend5nbjy6hn5v
parent: jelmer at samba.org-20061226173531-0z6y53h2pwg073m4
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Tue 2006-12-26 20:58:41 +0100
message:
  Deal with branch downgrades.
modified:
  branchprops.py                 branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
  fileids.py                     fileids.py-20060714013623-u5iiyqqnko11grcf-1
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
  transport.py                   transport.py-20060406231150-b3472d06b3a0818d
=== modified file 'branchprops.py'
--- a/branchprops.py	2006-12-25 17:12:14 +0000
+++ b/branchprops.py	2006-12-26 19:58:41 +0000
@@ -34,8 +34,6 @@
         assert path != None
         path = path.lstrip("/")
 
-        mutter("svn ls -r %d '%r' (branchprops)" % (revnum, path))
-
         try:
             (_, _, props) = self.log.transport.get_dir(
                 path.encode('utf8'), 

=== modified file 'fileids.py'
--- a/fileids.py	2006-12-26 16:42:50 +0000
+++ b/fileids.py	2006-12-26 19:58:41 +0000
@@ -16,10 +16,11 @@
 
 from bzrlib.errors import RevisionNotPresent
 from bzrlib.inventory import ROOT_ID
+from bzrlib.knit import KnitVersionedFile
 from bzrlib.progress import ProgressBar
 from bzrlib.trace import mutter
 from bzrlib.transport import get_transport
-from bzrlib.knit import KnitVersionedFile
+import bzrlib.urlutils as urlutils
 from warnings import warn
 
 import os
@@ -192,7 +193,8 @@
                     mutter('%r:%s copied from %r:%s' % (p, revid, data[1], data[2]))
                     assert find_children is not None, 'incomplete data for %r' % p
                     for c in find_children(data[1], data[2]):
-                        path = c.replace(data[1], p, 1)
+                        mutter('replacing %r with %r' % (data[1], p))
+                        path = c.replace(data[1], p+"/", 1).replace("//", "/")
                         map[path] = generate_file_id(revid, c), revid
                         mutter('added mapping %r -> %r' % (path, map[path]))
 

=== modified file 'logwalker.py'
--- a/logwalker.py	2006-12-26 17:00:19 +0000
+++ b/logwalker.py	2006-12-26 19:58:41 +0000
@@ -255,7 +255,6 @@
         """Find all children of path in revnum."""
         # TODO: Find children by walking history, or use 
         # cache?
-        mutter("svn ls -r %d '%r' (logwalker)" % (revnum, path))
 
         try:
             (dirents, _, _) = self.transport.get_dir(

=== modified file 'repository.py'
--- a/repository.py	2006-12-26 17:35:31 +0000
+++ b/repository.py	2006-12-26 19:58:41 +0000
@@ -220,7 +220,6 @@
             cachedbs[cache_file] = sqlite3.connect(cache_file)
         self.cachedb = cachedbs[cache_file]
 
-        mutter('svn latest-revnum')
         self._latest_revnum = transport.get_latest_revnum()
         self._log = logwalker.LogWalker(transport=transport, cache_db=self.cachedb, 
                                        last_revnum=self._latest_revnum)
@@ -332,7 +331,6 @@
         except NoSuchRevision:
             return False
 
-        mutter("svn check_path -r%d %s" % (revnum, path))
         try:
             kind = self.transport.check_path(path.encode('utf8'), revnum)
         except SubversionException, (_, num):

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2006-12-26 17:35:31 +0000
+++ b/tests/test_repos.py	2006-12-26 19:58:41 +0000
@@ -1161,7 +1161,7 @@
             self.assertEqual(2, e.to_revnum)
 
 
-    def notest_fetch_branch_downgrade(self):
+    def test_fetch_branch_downgrade(self):
         repos_url = self.make_client('d', 'dc')
 
         self.build_tree({'dc/trunk/file': 'data'})

=== modified file 'transport.py'
--- a/transport.py	2006-12-25 23:31:46 +0000
+++ b/transport.py	2006-12-26 19:58:41 +0000
@@ -150,11 +150,13 @@
 
     @need_lock
     def get_latest_revnum(self):
+        mutter("svn latest-revnum")
         return svn.ra.get_latest_revnum(self._ra)
 
     @need_lock
-    def do_switch(self, *args, **kwargs):
-        return svn.ra.do_switch(self._ra, *args, **kwargs)
+    def do_switch(self, switch_rev, switch_target, *args, **kwargs):
+        mutter('svn switch -r %d %r' % (switch_rev, switch_target))
+        return svn.ra.do_switch(self._ra, switch_rev, switch_target, *args, **kwargs)
 
     @need_lock
     def get_log(self, *args, **kwargs):
@@ -174,6 +176,8 @@
                     self._client, self.pool)
     @need_lock
     def get_dir(self, path, revnum, pool=None, kind=False):
+        mutter("svn ls -r %d '%r'" % (revnum, path))
+        path = path.rstrip("/")
         # ra_dav backends fail with strange errors if the path starts with a 
         # slash while other backends don't.
         assert len(path) == 0 or path[0] != "/"
@@ -199,8 +203,9 @@
         return dirents.keys()
 
     @need_lock
-    def check_path(self, *args, **kwargs):
-        return svn.ra.check_path(self._ra, *args, **kwargs)
+    def check_path(self, path, revnum, *args, **kwargs):
+        mutter("svn check_path -r%d %s" % (revnum, path))
+        return svn.ra.check_path(self._ra, path, revnum, *args, **kwargs)
 
     @need_lock
     def mkdir(self, relpath, mode=None):




More information about the bazaar-commits mailing list