Merge dev tree.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 15 Mar 2007 16:40:04 +0000 (17:40 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 15 Mar 2007 16:40:04 +0000 (17:40 +0100)
12 files changed:
1  2 
__init__.py
checkout.py
commit.py
fetch.py
fileids.py
repository.py
tests/test_branch.py
tests/test_commit.py
tests/test_repos.py
tests/test_transport.py
tests/test_workingtree.py
tree.py

diff --cc __init__.py
Simple merge
diff --cc checkout.py
index 48f87cf17d3a64c337a0d56e05aac7dded314a2a,e6a6cdf48e295e1e1f8294b9be195d1fd6fb46bb..a880fe8769c0b3e9f097f02c606c09ab66b9ed73
@@@ -288,9 -290,16 +290,10 @@@ class SvnWorkingTree(WorkingTree)
              if id is None:
                  mutter('no id for %r' % entry.url)
                  return
+             assert isinstance(id, str), "%r is not a string" % id
  
              # First handle directory itself
 -            if relpath == "":
 -                inv.add_path("", 'directory', ROOT_ID)
 -                inv.revision_id = revid
 -            else:
 -                inventry = InventoryDirectory(id, os.path.basename(relpath), parent_id)
 -                inventry.revision = revid
 -                inv.add(inventry)
 +            inv.add_path(relpath, 'directory', id, parent_id).revision = revid
  
              for name in entries:
                  if name == "":
diff --cc commit.py
index 769357505ded5a534903b0cd7a9defdb504c82d9,a82067b70af12a4b5ec8ab5f0435b0a3b66024bf..d8225ee582054ac02a45f8282d8836ee0ad06b8b
+++ b/commit.py
@@@ -85,10 -86,15 +86,15 @@@ class SvnCommitBuilder(RootCommitBuilde
          assert (self.branch.last_revision() is None or 
                  self.branch.last_revision() in parents)
  
-         if self.branch.last_revision() is None:
-             self.old_inv = Inventory(root_id=None)
+         if old_inv is None:
+             if self.branch.last_revision() is None:
 -                self.old_inv = Inventory(ROOT_ID)
++                self.old_inv = Inventory(root_id=None)
+             else:
+                 self.old_inv = self.repository.get_inventory(
+                                    self.branch.last_revision())
          else:
-             self.old_inv = self.repository.get_inventory(self.branch.last_revision())
+             self.old_inv = old_inv
+             assert self.old_inv.revision_id == self.branch.last_revision()
  
          self.modified_files = {}
          self.modified_dirs = []
diff --cc fetch.py
index 3b61321c646c71b26b03e875b3befaeaea098768,134bef21da0ea860a80dd735461278707e7fb36f..51570e649795d27a10f477797415bded1b4deebc
+++ b/fetch.py
@@@ -112,13 -107,15 +113,14 @@@ class RevisionBuildEditor(svn.delta.Edi
          del self.inventory[self._get_old_id(parent_id, path)]
  
      def close_directory(self, id):
 -        if id != ROOT_ID:
 -            self.inventory[id].revision = self.revid
 +        self.inventory[id].revision = self.revid
  
 -            file_weave = self.weave_store.get_weave_or_empty(id, self.transact)
 -            if not file_weave.has_version(self.revid):
 -                file_weave.add_lines(self.revid, self.dir_baserev[id], [])
 +        file_weave = self.weave_store.get_weave_or_empty(id, self.transact)
 +        if not file_weave.has_version(self.revid):
 +            file_weave.add_lines(self.revid, self.dir_baserev[id], [])
  
      def add_directory(self, path, parent_id, copyfrom_path, copyfrom_revnum, pool):
+         path = path.decode("utf-8")
          file_id = self._get_new_id(parent_id, path)
  
          self.dir_baserev[file_id] = []
diff --cc fileids.py
Simple merge
diff --cc repository.py
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc tree.py
index b76fe8b6114c2be9217d9ddfdd9ac745eed3d5cf,a77f236b3c59ee7b3113d7c478d5e0e05e2adc5f..3288ab69866763ae86cbe7d1bf8fdb53499fd279
+++ b/tree.py
@@@ -53,10 -54,6 +53,9 @@@ class SvnRevisionTree(RevisionTree)
       def __init__(self, repository, revision_id, inventory=None):
          self._repository = repository
          self._revision_id = revision_id
-         self._inventory = Inventory(root_id=self.id_map[""][0])
-         self._inventory.revision_id = revision_id
 +        (self.branch_path, self.revnum) = repository.parse_revision_id(revision_id)
 +        self.id_map = repository.get_fileid_map(self.revnum, self.branch_path)
++        self._inventory = Inventory()
          pool = Pool()
          (self.branch_path, self.revnum) = repository.parse_revision_id(revision_id)
          self._inventory = Inventory()