Rev 1572: Fix tests. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Sat Aug 9 03:56:29 BST 2008


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

------------------------------------------------------------
revno: 1572
revision-id: jelmer at samba.org-20080809025627-n3p7nmxxf0xq1zk7
parent: jelmer at samba.org-20080809023111-dy9tt6q1ic3on9g9
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-08-09 04:56:27 +0200
message:
  Fix tests.
modified:
  fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
  fileids.py                     fileids.py-20060714013623-u5iiyqqnko11grcf-1
  properties.py                  util.py-20080502170127-o220e9py99vt69s6-1
=== modified file 'fetch.py'
--- a/fetch.py	2008-08-09 01:58:00 +0000
+++ b/fetch.py	2008-08-09 02:56:27 +0000
@@ -154,6 +154,10 @@
         elif name.startswith(properties.PROP_PREFIX):
             mutter('unsupported dir property %r', name)
 
+        if (not name.startswith(properties.PROP_ENTRY_PREFIX) and
+            not name.startswith(properties.PROP_WC_PREFIX)):
+            self._metadata_changed = True
+
     def add_file(self, path, copyfrom_path=None, copyfrom_revnum=-1):
         assert isinstance(path, str)
         path = path.decode("utf-8")
@@ -218,6 +222,7 @@
         self.old_id = old_id
         self.new_id = new_id
         self.parent_revids = parent_revids
+        self._metadata_changed = False
 
     def _delete_entry(self, path, revnum):
         if path in self.editor._premature_deletes:
@@ -231,6 +236,7 @@
 
     def _close(self):
         if (not self.new_id in self.editor.old_inventory or 
+            (self._metadata_changed and self.path != "") or 
             self.editor.inventory[self.new_id] != self.editor.old_inventory[self.new_id] or
             self.editor._get_text_revid(self.path) is not None):
             ie = self.editor.inventory[self.new_id]
@@ -243,7 +249,6 @@
 
         if self.new_id == self.editor.inventory.root.file_id:
             assert self.editor.inventory.root.revision is not None
-            assert len(self.editor._premature_deletes) == 0
             self.editor._finish_commit()
 
     def _add_directory(self, path, copyfrom_path=None, copyfrom_revnum=-1):
@@ -423,6 +428,7 @@
         return (rev, signature)
 
     def _finish_commit(self):
+        assert len(self._premature_deletes) == 0
         (rev, signature) = self._get_revision(self.revid)
         self.inventory.revision_id = self.revid
         # Escaping the commit message is really the task of the serialiser

=== modified file 'fileids.py'
--- a/fileids.py	2008-08-09 02:31:11 +0000
+++ b/fileids.py	2008-08-09 02:56:27 +0000
@@ -199,7 +199,10 @@
                         del map[p]
 
         for x in sorted(delta.keys()):
-            if delta[x] is not None:
+            if (delta[x] is not None and 
+                # special case - we change metadata in svn at the branch root path
+                # but that's not reflected as a bzr metadata change in bzr
+                (x != "" or not "" in map or map[x][1] == NULL_REVISION)):
                 map[x] = (str(delta[x]), revid)
 
 

=== modified file 'properties.py'
--- a/properties.py	2008-07-08 13:21:43 +0000
+++ b/properties.py	2008-08-09 02:56:27 +0000
@@ -203,6 +203,7 @@
 PROP_SPECIAL = 'svn:special'
 PROP_SPECIAL_VALUE = '*'
 PROP_WC_PREFIX = 'svn:wc:'
+PROP_ENTRY_PREFIX = 'svn:entry'
 PROP_ENTRY_COMMITTED_DATE = 'svn:entry:committed-date'
 PROP_ENTRY_COMMITTED_REV = 'svn:entry:committed-rev'
 PROP_ENTRY_LAST_AUTHOR = 'svn:entry:last-author'




More information about the bazaar-commits mailing list