Rev 6515: (jameinel) Merge 2.4 into 2.5, in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/
Patch Queue Manager
pqm at pqm.ubuntu.com
Thu May 30 12:53:09 UTC 2013
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/
------------------------------------------------------------
revno: 6515 [merge]
revision-id: pqm at pqm.ubuntu.com-20130530125309-990eb4a5pn4sht37
parent: pqm at pqm.ubuntu.com-20130527102002-0k9g4cvhocz44chz
parent: john at arbash-meinel.com-20130530122340-7in38v9gg27av594
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Thu 2013-05-30 12:53:09 +0000
message:
(jameinel) Merge 2.4 into 2.5,
bringing in the fix for bug #855155 (Dirstate.update_basis_by_delta) (John A
Meinel)
modified:
bzrlib/dirstate.py dirstate.py-20060728012006-d6mvoihjb3je9peu-1
bzrlib/tests/blackbox/test_uncommit.py test_uncommit.py-20051027212835-84944b63adae51be
bzrlib/tests/per_workingtree/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
bzrlib/tests/test_dirstate.py test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py 2013-05-23 09:27:10 +0000
+++ b/bzrlib/dirstate.py 2013-05-30 11:42:30 +0000
@@ -1648,9 +1648,18 @@
entry_key = st(dirname, basename, file_id)
block_index, present = self._find_block_index_from_key(entry_key)
if not present:
- self._raise_invalid(new_path, file_id,
- "Unable to find block for this record."
- " Was the parent added?")
+ # The block where we want to put the file is not present.
+ # However, it might have just been an empty directory. Look for
+ # the parent in the basis-so-far before throwing an error.
+ parent_dir, parent_base = osutils.split(dirname)
+ parent_block_idx, parent_entry_idx, _, parent_present = \
+ self._get_block_entry_index(parent_dir, parent_base, 1)
+ if not parent_present:
+ self._raise_invalid(new_path, file_id,
+ "Unable to find block for this record."
+ " Was the parent added?")
+ self._ensure_block(parent_block_idx, parent_entry_idx, dirname)
+
block = self._dirblocks[block_index][1]
entry_index, present = self._find_entry_index(entry_key, block)
if real_add:
=== modified file 'bzrlib/tests/blackbox/test_uncommit.py'
--- a/bzrlib/tests/blackbox/test_uncommit.py 2011-12-14 20:21:52 +0000
+++ b/bzrlib/tests/blackbox/test_uncommit.py 2013-05-30 11:42:30 +0000
@@ -314,3 +314,20 @@
self.assertLength(14, self.hpss_calls)
self.assertLength(1, self.hpss_connections)
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
+
+
+class TestInconsistentDelta(TestCaseWithTransport):
+ # See https://bugs.launchpad.net/bzr/+bug/855155
+ # See https://bugs.launchpad.net/bzr/+bug/1100385
+ # bzr uncommit may result in error
+ # 'An inconsistent delta was supplied involving'
+
+ def test_inconsistent_delta(self):
+ # Script taken from https://bugs.launchpad.net/bzr/+bug/855155/comments/26
+ wt = self.make_branch_and_tree('test')
+ self.build_tree(['test/a/', 'test/a/b', 'test/a/c'])
+ wt.add(['a', 'a/b', 'a/c'])
+ wt.commit('initial commit', rev_id='a1')
+ wt.remove(['a/b', 'a/c'])
+ wt.commit('remove b and c', rev_id='a2')
+ self.run_bzr("uncommit --force test")
=== modified file 'bzrlib/tests/per_workingtree/test_parents.py'
--- a/bzrlib/tests/per_workingtree/test_parents.py 2012-09-06 09:00:45 +0000
+++ b/bzrlib/tests/per_workingtree/test_parents.py 2013-05-30 11:42:30 +0000
@@ -450,7 +450,7 @@
self.add_dir(new_shape, new_revid, 'root-id', None, '')
def assertTransitionFromBasisToShape(self, basis_shape, basis_revid,
- new_shape, new_revid, extra_parent=None):
+ new_shape, new_revid, extra_parent=None, set_current_inventory=True):
# set the inventory revision ids.
basis_shape.revision_id = basis_revid
new_shape.revision_id = new_revid
@@ -465,8 +465,9 @@
parents.append(extra_parent)
tree.set_parent_ids(parents)
self.fake_up_revision(tree, new_revid, new_shape)
- # give tree an inventory of new_shape
- tree._write_inventory(new_shape)
+ if set_current_inventory:
+ # give tree an inventory of new_shape
+ tree._write_inventory(new_shape)
self.assertDeltaApplicationResultsInExpectedBasis(tree, new_revid,
delta, new_shape)
# The tree should be internally consistent; while this is a moderately
@@ -764,3 +765,17 @@
self.add_link(new_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'D')
self.assertTransitionFromBasisToShape(basis_shape, old_revid,
new_shape, new_revid)
+
+ def test_add_files_to_empty_directory(self):
+ old_revid = 'old-parent'
+ basis_shape = Inventory(root_id=None)
+ self.add_dir(basis_shape, old_revid, 'root-id', None, '')
+ self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
+ new_revid = 'new-parent'
+ new_shape = Inventory(root_id=None)
+ self.add_new_root(new_shape, old_revid, new_revid)
+ self.add_dir(new_shape, old_revid, 'dir-id-A', 'root-id', 'A')
+ self.add_file(new_shape, new_revid, 'file-id-B', 'dir-id-A', 'B',
+ '1' * 32, 24)
+ self.assertTransitionFromBasisToShape(basis_shape, old_revid,
+ new_shape, new_revid, set_current_inventory=False)
=== modified file 'bzrlib/tests/test_dirstate.py'
--- a/bzrlib/tests/test_dirstate.py 2011-06-14 01:26:41 +0000
+++ b/bzrlib/tests/test_dirstate.py 2013-05-30 11:42:30 +0000
@@ -2480,7 +2480,12 @@
def create_tree_from_shape(self, rev_id, shape):
dir_ids = {'': 'root-id'}
inv = inventory.Inventory('root-id', rev_id)
- for path, file_id in shape:
+ for info in shape:
+ if len(info) == 2:
+ path, file_id = info
+ ie_rev_id = rev_id
+ else:
+ path, file_id, ie_rev_id = info
if path == '':
# Replace the root entry
del inv._byid[inv.root.file_id]
@@ -2488,7 +2493,7 @@
inv._byid[file_id] = inv.root
dir_ids[''] = file_id
continue
- inv.add(self.path_to_ie(path, file_id, rev_id, dir_ids))
+ inv.add(self.path_to_ie(path, file_id, ie_rev_id, dir_ids))
return revisiontree.InventoryRevisionTree(_Repo(), inv, rev_id)
def create_empty_dirstate(self):
@@ -2616,6 +2621,13 @@
target=[('file', 'file-id')],
)
+ def test_add_file_in_empty_dir_not_matching_active_state(self):
+ state = self.assertUpdate(
+ active=[],
+ basis=[('dir/', 'dir-id')],
+ target=[('dir/', 'dir-id', 'basis'), ('dir/file', 'file-id')],
+ )
+
def test_add_file_missing_in_active_state(self):
state = self.assertUpdate(
active=[],
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2013-05-23 09:27:10 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2013-05-30 12:23:40 +0000
@@ -35,22 +35,20 @@
* Cope with Unix filesystems, such as smbfs, where chmod gives 'permission
denied'. (Martin Pool, #606537)
-* Fix a traceback when trying to checkout a tree that also has an entry
- with file-id `TREE_ROOT` somewhere other than at the root directory.
- (John Arbash Meinel, #830947)
-
-* When the ``limbo`` or ``pending-deletion`` directories exist, typically
- because of an interrupted tree update, but are empty, bzr no longer
- errors out, because there is nothing for the user to clean up. Also,
- errors in creation of these directories are no longer squelched.
- (Martin Pool, #427773)
-
* During merges, when two entries end up using the same path for two
different file-ids (the same file being 'bzr added' in two different
branches) , 'duplicate' conflicts are created instead of 'content'
ones. This was previously leading to a 'Malformed tramsform' exception.
(Vincent Ladeuil, #880701)
+* Fix a traceback when trying to checkout a tree that also has an entry
+ with file-id `TREE_ROOT` somewhere other than at the root directory.
+ (John Arbash Meinel, #830947)
+
+* Handle when an uncommit/update tries to add a file to an otherwise empty
+ directory. The ``Dirstate.update_basis_by_delta`` would end up
+ incorrectly flagging the delta as invalid. (Brian de Alwis, #855155)
+
* 'Malformed transform' exceptions are now recognized as internal errors
instead of user errors and report a traceback. This will reduce user
confusion as there is generally nothing users can do about them.
@@ -63,10 +61,22 @@
This shouldn't be treated as a fatal error.
(John Arbash Meinel, #1075108)
+* Teach the bzr client how to reconnect if we get ``ConnectionReset``
+ while making an RPC request. This doesn't handle all possible network
+ disconnects, but it should at least handle when the server is asked to
+ shutdown gracefully. This is a backport of the functionality in bzr-2.5.
+ (John Arbash Meinel, #819604)
+
* Use ``encoding_type='exact'`` for ``bzr testament`` so that on Windows
the sha hash of the long testament matches the sha hash in the short
form. (John Arbash Meinel, #1010339)
+* When the ``limbo`` or ``pending-deletion`` directories exist, typically
+ because of an interrupted tree update, but are empty, bzr no longer
+ errors out, because there is nothing for the user to clean up. Also,
+ errors in creation of these directories are no longer squelched.
+ (Martin Pool, #427773)
+
* _Win32Stat object provides members st_uid and st_gid, those are present
in Python's os.stat object. These members required for external tools like
bzr-git and dulwich. (Alexander Belchenko, #967060)
@@ -144,7 +154,7 @@
* Return early from create_delta_index_from_delta given tiny inputs. This
avoids raising a spurious MemoryError on certain platforms such as AIX.
(John Arbash Meinel, #856731)
-
+
Documentation
*************
More information about the bazaar-commits
mailing list