Rev 5612: (vila) Merge 2.2 into 2.3 including fix for bug #660935 (Vincent in file:///home/pqm/archives/thelove/bzr/2.3/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Jan 15 18:08:59 UTC 2011


At file:///home/pqm/archives/thelove/bzr/2.3/

------------------------------------------------------------
revno: 5612 [merge]
revision-id: pqm at pqm.ubuntu.com-20110115180856-50gg6zzuh9idj69q
parent: pqm at pqm.ubuntu.com-20110115001646-dpmryo344i23njxo
parent: v.ladeuil+lp at free.fr-20110115173118-q4zvvv1c96o7ndni
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.3
timestamp: Sat 2011-01-15 18:08:56 +0000
message:
  (vila) Merge 2.2 into 2.3 including fix for bug #660935 (Vincent
  	Ladeuil)
modified:
  bzrlib/conflicts.py            conflicts.py-20051001061850-78ef952ba63d2b42
  bzrlib/tests/test_conflicts.py test_conflicts.py-20051006031059-e2dad9bbeaa5891f
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py	2011-01-10 22:20:12 +0000
+++ b/bzrlib/conflicts.py	2011-01-15 17:29:41 +0000
@@ -514,7 +514,7 @@
         # Adjust the path for the retained file id
         tid = tt.trans_id_file_id(file_id)
         parent_tid = tt.get_tree_parent(tid)
-        tt.adjust_path(path, parent_tid, tid)
+        tt.adjust_path(osutils.basename(path), parent_tid, tid)
         tt.apply()
 
     def _revision_tree(self, tree, revid):
@@ -600,7 +600,7 @@
         # 'item.suffix_to_remove' has been deleted, this is a no-op)
         this_tid = tt.trans_id_file_id(self.file_id)
         parent_tid = tt.get_tree_parent(this_tid)
-        tt.adjust_path(self.path, parent_tid, this_tid)
+        tt.adjust_path(osutils.basename(self.path), parent_tid, this_tid)
         tt.apply()
 
     def action_take_this(self, tree):

=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py	2011-01-12 01:01:53 +0000
+++ b/bzrlib/tests/test_conflicts.py	2011-01-15 17:31:18 +0000
@@ -427,6 +427,15 @@
               dict(actions='modify_file', check='file_has_more_content')),
              ('file_deleted',
               dict(actions='delete_file', check='file_doesnt_exist')),),
+            # File modified/deleted in dir
+            (dict(_base_actions='create_file_in_dir',
+                  _path='dir/file', _file_id='file-id'),
+             ('file_modified_in_dir',
+              dict(actions='modify_file_in_dir',
+                   check='file_in_dir_has_more_content')),
+             ('file_deleted_in_dir',
+              dict(actions='delete_file',
+                   check='file_in_dir_doesnt_exist')),),
             ])
 
     def do_create_file(self):
@@ -444,6 +453,19 @@
     def check_file_doesnt_exist(self):
         self.failIfExists('branch/file')
 
+    def do_create_file_in_dir(self):
+        return [('add', ('dir', 'dir-id', 'directory', '')),
+                ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
+
+    def do_modify_file_in_dir(self):
+        return [('modify', ('file-id', 'trunk content\nmore content\n'))]
+
+    def check_file_in_dir_has_more_content(self):
+        self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')
+
+    def check_file_in_dir_doesnt_exist(self):
+        self.failIfExists('branch/dir/file')
+
     def _get_resolve_path_arg(self, wt, action):
         return self._path
 
@@ -475,6 +497,16 @@
                    # PathConflicts deletion handling requires a special
                    # hard-coded value
                    path='<deleted>', file_id='file-id')),),
+            # File renamed/deleted in dir
+            (dict(_base_actions='create_file_in_dir'),
+             ('file_renamed_in_dir',
+              dict(actions='rename_file_in_dir', check='file_in_dir_renamed',
+                   path='dir/new-file', file_id='file-id')),
+             ('file_deleted',
+              dict(actions='delete_file', check='file_in_dir_doesnt_exist',
+                   # PathConflicts deletion handling requires a special
+                   # hard-coded value
+                   path='<deleted>', file_id='file-id')),),
             # File renamed/renamed differently
             (dict(_base_actions='create_file'),
              ('file_renamed',
@@ -549,6 +581,20 @@
     def check_dir_doesnt_exist(self):
         self.failIfExists('branch/dir')
 
+    def do_create_file_in_dir(self):
+        return [('add', ('dir', 'dir-id', 'directory', '')),
+                ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
+
+    def do_rename_file_in_dir(self):
+        return [('rename', ('dir/file', 'dir/new-file'))]
+
+    def check_file_in_dir_renamed(self):
+        self.failIfExists('branch/dir/file')
+        self.failUnlessExists('branch/dir/new-file')
+
+    def check_file_in_dir_doesnt_exist(self):
+        self.failIfExists('branch/dir/file')
+
     def _get_resolve_path_arg(self, wt, action):
         tpath = self._this['path']
         opath = self._other['path']




More information about the bazaar-commits mailing list