Rev 440: Initial work on tracking splits of trees (directories being upgraded to branches). in file:///home/jelmer/bzr-svn/splittrees/

Jelmer Vernooij jelmer at samba.org
Mon Mar 19 15:59:21 GMT 2007


At file:///home/jelmer/bzr-svn/splittrees/

------------------------------------------------------------
revno: 440
revision-id: jelmer at samba.org-20070319151757-9fkn0obr6cani0fx
parent: jelmer at samba.org-20070319150900-bcmzs21lub8zihqa
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: splittrees
timestamp: Mon 2007-03-19 16:17:57 +0100
message:
  Initial work on tracking splits of trees (directories being upgraded to branches).
modified:
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'repository.py'
--- a/repository.py	2007-03-19 11:23:36 +0000
+++ b/repository.py	2007-03-19 15:17:57 +0000
@@ -489,14 +489,13 @@
                 paths[branch_path][0] in ('R', 'A')):
                 if paths[branch_path][1] is None:
                     return
-                if not self.scheme.is_branch(paths[branch_path][1]) and \
-                   not self.scheme.is_tag(paths[branch_path][1]):
-                    # FIXME: if copyfrom_path is not a branch path, 
-                    # should simulate a reverse "split" of a branch
-                    # for now, just make it look like the branch ended here
-                    return
                 revnum = paths[branch_path][2]
-                branch_path = paths[branch_path][1]
+                try:
+                    branch_path = self.scheme.unprefix(paths[branch_path][1])[0]
+                except NotBranchError:
+                    # Copied from something that wasn't even part of a branch.
+                    # just make it look like the branch started here
+                    return
                 continue
             revnum-=1
 
@@ -521,7 +520,7 @@
                 paths[bp] = ('A', None, -1)
 
                 yield (bp, paths, revnum)
-                return
+               return
                      
             yield (bp, paths, revnum)
 

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2007-03-16 12:09:02 +0000
+++ b/tests/test_repos.py	2007-03-19 15:17:57 +0000
@@ -1684,7 +1684,8 @@
         oldrepos.copy_content_into(newrepos)
 
         branch = Branch.open("%s/branches/mybranch" % repos_url)
-        self.assertEqual([oldrepos.generate_revision_id(2, "branches/mybranch")], 
+        self.assertEqual([oldrepos.generate_revision_id(1, "trunk"),
+                          oldrepos.generate_revision_id(2, "branches/mybranch")], 
                          branch.revision_history())
 
     def test_fetch_file_from_non_branch(self):




More information about the bazaar-commits mailing list