Rev 302: Deal with existing files in directories replaced by another instance of themselves. Test will follow. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Tue Dec 26 04:49:48 GMT 2006


------------------------------------------------------------
revno: 302
revision-id: jelmer at samba.org-20061226044857-llotsyniugb18krc
parent: jelmer at samba.org-20061226040444-bojmquiro1s5yq0k
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Tue 2006-12-26 05:48:57 +0100
message:
  Deal with existing files in directories replaced by another instance of themselves. Test will follow.
modified:
  fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
=== modified file 'fetch.py'
--- a/fetch.py	2006-12-26 04:04:44 +0000
+++ b/fetch.py	2006-12-26 04:48:57 +0000
@@ -123,10 +123,15 @@
             self.dir_baserev[file_id] = [base_revid]
             ie = self.inventory[file_id]
         else:
-            # Replace
-            del self.inventory[base_file_id]
+            # Replace if original was inside this branch
+	    # change id of base_file_id to file_id
+	    ie = self.inventory[base_file_id]
+	    for name in ie.children:
+	    	ie.children[name].parent_id = file_id
+	    del self.inventory[base_file_id]
+	    ie.file_id = file_id
+	    self.inventory.add(ie)
             self.dir_baserev[file_id] = []
-            ie = self.inventory.add_path(path, 'directory', file_id)
         ie.revision = revision_id
         return file_id
 




More information about the bazaar-commits mailing list