Rev 4538: Fix NEWS for bug fix merges. in http://people.ubuntu.com/~robertc/baz2.0/integration

Robert Collins robertc at robertcollins.net
Wed Jul 15 23:13:29 BST 2009


At http://people.ubuntu.com/~robertc/baz2.0/integration

------------------------------------------------------------
revno: 4538 [merge]
revision-id: robertc at robertcollins.net-20090715221323-blvetujtylg8ut3g
parent: robertc at robertcollins.net-20090715043314-jeuws3m6utp6cfyd
parent: robertc at robertcollins.net-20090715055437-ozlxxlwmcc9v1qyz
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Thu 2009-07-16 08:13:23 +1000
message:
  Fix NEWS for bug fix merges.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
  bzrlib/tests/per_workingtree/test_commit.py test_commit.py-20060421013633-1610ec2331c8190f
=== modified file 'NEWS'
--- a/NEWS	2009-07-15 04:33:14 +0000
+++ b/NEWS	2009-07-15 22:13:23 +0000
@@ -25,6 +25,11 @@
 * BranchBuilder now accepts timezone to avoid test failures in countries far
   from GMT. (Vincent Ladeuil, #397716)
 
+* ``bzr commit`` no longer saves the unversioning of missing files until
+  the commit has completed on the branch. This means that aborting a
+  commit that found a missing file will leave the tree unedited.
+  (Robert Collins, #282402)
+
 * ``WorkingTree4.unversion`` will no longer fail to unversion ids which
   were present in a parent tree but renamed in the working tree.
   (Robert Collins, #187207)

=== modified file 'bzrlib/commit.py'
--- a/bzrlib/commit.py	2009-06-15 19:04:38 +0000
+++ b/bzrlib/commit.py	2009-07-15 05:54:37 +0000
@@ -204,6 +204,7 @@
         """Commit working copy as a new revision.
 
         :param message: the commit message (it or message_callback is required)
+        :param message_callback: A callback: message = message_callback(cmt_obj)
 
         :param timestamp: if not None, seconds-since-epoch for a
             postdated/predated commit.
@@ -392,7 +393,10 @@
             # and now do the commit locally.
             self.branch.set_last_revision_info(new_revno, self.rev_id)
 
-            # Make the working tree up to date with the branch
+            # Make the working tree be up to date with the branch. This
+            # includes automatic changes scheduled to be made to the tree, such
+            # as updating its basis and unversioning paths that were missing.
+            self.work_tree.unversion(self.deleted_ids)
             self._set_progress_stage("Updating the working tree")
             self.work_tree.update_basis_by_delta(self.rev_id,
                  self.builder.get_basis_delta())
@@ -679,7 +683,7 @@
                             reporter.snapshot_change('modified', new_path)
             self._next_progress_entry()
         # Unversion IDs that were found to be deleted
-        self.work_tree.unversion(deleted_ids)
+        self.deleted_ids = deleted_ids
 
     def _record_unselected(self):
         # If specific files are selected, then all un-selected files must be
@@ -842,7 +846,7 @@
                 content_summary)
 
         # Unversion IDs that were found to be deleted
-        self.work_tree.unversion(deleted_ids)
+        self.deleted_ids = deleted_ids
 
     def _commit_nested_tree(self, file_id, path):
         "Commit a nested tree."

=== modified file 'bzrlib/tests/per_workingtree/test_commit.py'
--- a/bzrlib/tests/per_workingtree/test_commit.py	2009-07-10 07:14:02 +0000
+++ b/bzrlib/tests/per_workingtree/test_commit.py	2009-07-15 05:54:37 +0000
@@ -280,6 +280,15 @@
         wt2.merge_from_branch(wt.branch)
         wt2.commit('merged kind change')
 
+    def test_commit_aborted_does_not_apply_automatic_changes_bug_282402(self):
+        wt = self.make_branch_and_tree('.')
+        wt.add(['a'], ['a-id'], ['file'])
+        def fail_message(obj):
+            raise errors.BzrCommandError("empty commit message")
+        self.assertRaises(errors.BzrCommandError, wt.commit,
+            message_callback=fail_message)
+        self.assertEqual('a', wt.id2path('a-id'))
+
     def test_local_commit_ignores_master(self):
         # a --local commit does not require access to the master branch
         # at all, or even for it to exist.




More information about the bazaar-commits mailing list