Rev 5604: Merge bzr.dev 5602 to, yet again, resolve a NEWS/bzr-2.3.txt conflict in http://bazaar.launchpad.net/~jameinel/bzr/2.3-connection-reset-581311

John Arbash Meinel john at arbash-meinel.com
Wed Jan 12 21:28:46 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.3-connection-reset-581311

------------------------------------------------------------
revno: 5604 [merge]
revision-id: john at arbash-meinel.com-20110112212839-lfzo8o183tw10gnd
parent: john at arbash-meinel.com-20110112212700-esqmtrmevddxrsq2
parent: pqm at pqm.ubuntu.com-20110112194804-4wkdy5dj69vcmqv8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.3-connection-reset-581311
timestamp: Wed 2011-01-12 15:28:39 -0600
message:
  Merge bzr.dev 5602 to, yet again, resolve a NEWS/bzr-2.3.txt conflict
modified:
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_shelf.py     test_prepare_shelf.p-20081005181341-n74qe6gu1e65ad4v-2
  bzrlib/tests/test_version_info.py test_version_info.py-20051228204928-2c364e30b702b41b
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
  bzrlib/version_info_formats/format_python.py format_python.py-20060809202444-ike7i9ub03gb432p-1
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2010-11-29 01:23:53 +0000
+++ b/bzrlib/config.py	2011-01-12 18:12:58 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2010 Canonical Ltd
+# Copyright (C) 2005-2011 Canonical Ltd
 #   Authors: Robert Collins <robert.collins at canonical.com>
 #            and others
 #
@@ -1131,10 +1131,16 @@
     """
     base = os.environ.get('BZR_HOME', None)
     if sys.platform == 'win32':
+        # environ variables on Windows are in user encoding/mbcs. So decode
+        # before using one
+        if base is not None:
+            base = base.decode('mbcs')
         if base is None:
             base = win32utils.get_appdata_location_unicode()
         if base is None:
             base = os.environ.get('HOME', None)
+            if base is not None:
+                base = base.decode('mbcs')
         if base is None:
             raise errors.BzrError('You must have one of BZR_HOME, APPDATA,'
                                   ' or HOME set')

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2011-01-12 01:01:53 +0000
+++ b/bzrlib/tests/__init__.py	2011-01-12 18:39:25 +0000
@@ -1336,6 +1336,10 @@
         if haystack.find(needle) == -1:
             self.fail("string %r not found in '''%s'''" % (needle, haystack))
 
+    def assertNotContainsString(self, haystack, needle):
+        if haystack.find(needle) != -1:
+            self.fail("string %r found in '''%s'''" % (needle, haystack))
+
     def assertSubset(self, sublist, superlist):
         """Assert that every entry in sublist is present in superlist."""
         missing = set(sublist) - set(superlist)

=== modified file 'bzrlib/tests/test_shelf.py'
--- a/bzrlib/tests/test_shelf.py	2010-09-17 15:15:34 +0000
+++ b/bzrlib/tests/test_shelf.py	2011-01-12 18:25:01 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009, 2010 Canonical Ltd
+# Copyright (C) 2008-2011 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -623,6 +623,29 @@
                               shelf_file)
         self.assertEqual('Shelf corrupt.', str(e))
 
+    def test_unshelve_subdir_in_now_removed_dir(self):
+        tree = self.make_branch_and_tree('.')
+        self.addCleanup(tree.lock_write().unlock)
+        self.build_tree(['dir/', 'dir/subdir/', 'dir/subdir/foo'])
+        tree.add(['dir'], ['dir-id'])
+        tree.commit('versioned dir')
+        tree.add(['dir/subdir', 'dir/subdir/foo'], ['subdir-id', 'foo-id'])
+        creator = shelf.ShelfCreator(tree, tree.basis_tree())
+        self.addCleanup(creator.finalize)
+        for change in creator.iter_shelvable():
+            creator.shelve_change(change)
+        shelf_manager = tree.get_shelf_manager()
+        shelf_id = shelf_manager.shelve_changes(creator)
+        self.failIfExists('dir/subdir')
+        tree.remove(['dir'])
+        unshelver = shelf_manager.get_unshelver(shelf_id)
+        self.addCleanup(unshelver.finalize)
+        unshelver.make_merger().do_merge()
+        self.failUnlessExists('dir/subdir/foo')
+        self.assertEqual('dir-id', tree.path2id('dir'))
+        self.assertEqual('subdir-id', tree.path2id('dir/subdir'))
+        self.assertEqual('foo-id', tree.path2id('dir/subdir/foo'))
+
 
 class TestShelfManager(tests.TestCaseWithTransport):
 

=== modified file 'bzrlib/tests/test_version_info.py'
--- a/bzrlib/tests/test_version_info.py	2011-01-12 01:01:53 +0000
+++ b/bzrlib/tests/test_version_info.py	2011-01-12 18:39:25 +0000
@@ -192,6 +192,7 @@
         val = sio.getvalue()
         self.assertContainsRe(val, "'revision_id': None")
         self.assertContainsRe(val, "'revno': 0")
+        self.assertNotContainsString(val, '\n\n\n\n')
 
     def test_python_version(self):
         wt = self.create_branch()

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2011-01-12 01:01:53 +0000
+++ b/bzrlib/transform.py	2011-01-12 18:25:01 +0000
@@ -528,6 +528,8 @@
         for trans_id in self._removed_id:
             file_id = self.tree_file_id(trans_id)
             if file_id is not None:
+                # XXX: This seems like something that should go via a different
+                #      indirection.
                 if self._tree.inventory[file_id].kind == 'directory':
                     parents.append(trans_id)
             elif self.tree_kind(trans_id) == 'directory':
@@ -3020,7 +3022,8 @@
             file_id = tt.inactive_file_id(conflict[1])
             # special-case the other tree root (move its children instead)
             if path_tree and file_id in path_tree:
-                if path_tree.inventory[file_id].parent_id is None:
+                if path_tree.path2id('') == file_id:
+                    # This is the root entry, skip it
                     continue
             tt.version_file(file_id, conflict[1])
             new_conflicts.add((c_type, 'Versioned directory', conflict[1]))

=== modified file 'bzrlib/version_info_formats/format_python.py'
--- a/bzrlib/version_info_formats/format_python.py	2009-04-03 21:23:55 +0000
+++ b/bzrlib/version_info_formats/format_python.py	2011-01-12 21:28:39 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 Canonical Ltd
+# Copyright (C) 2006, 2009, 2011 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -38,7 +38,6 @@
 
 
 _py_version_footer = '''
-
 if __name__ == '__main__':
     print 'revision: %(revno)d' % version_info
     print 'nick: %(branch_nick)s' % version_info

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2011-01-12 21:27:00 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2011-01-12 21:28:39 +0000
@@ -82,6 +82,10 @@
   failure in the windows test suite, that was trying to ensure we cleanly
   handled a server disconnect.  (John Arbash Meinel, #581311, #686587)
 
+* Unshelving changes that occur in a now-unversioned directory now restore
+  the directory properly rather than crashing.
+  (John Arbash Meinel, #389674)
+
 * You are now able to commit directly to a stacked branch. Any needed
   parent inventories will be filled in as part of the commit process.
   (John Arbash Meinel, #375013)



More information about the bazaar-commits mailing list