Rev 5654: News entry for bug #537442 in http://bazaar.launchpad.net/~vila/bzr/integration/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Feb 9 09:01:33 UTC 2011


At http://bazaar.launchpad.net/~vila/bzr/integration/

------------------------------------------------------------
revno: 5654 [merge]
revision-id: v.ladeuil+lp at free.fr-20110209090133-q657towjotann3jq
parent: pqm at pqm.ubuntu.com-20110209085129-0qspgtdaj4gfu2qr
parent: v.ladeuil+lp at free.fr-20110209085645-pmqmyp05r3wxieoz
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: trunk
timestamp: Wed 2011-02-09 10:01:33 +0100
message:
  News entry for bug #537442
modified:
  bzrlib/tests/blackbox/test_annotate.py testannotate.py-20051013044000-457f44801bfa9d39
  doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
-------------- next part --------------
=== modified file 'bzrlib/tests/blackbox/test_annotate.py'
--- a/bzrlib/tests/blackbox/test_annotate.py	2011-02-09 11:44:03 +0000
+++ b/bzrlib/tests/blackbox/test_annotate.py	2011-02-09 08:37:08 +0000
@@ -24,15 +24,13 @@
 """
 
 
-import os
+from bzrlib import tests
 
-from bzrlib.branch import Branch
 from bzrlib.config import extract_email_address
-from bzrlib.tests import TestCaseWithTransport
 from bzrlib.urlutils import joinpath
 
 
-class TestAnnotate(TestCaseWithTransport):
+class TestAnnotate(tests.TestCaseWithTransport):
 
     def setUp(self):
         super(TestAnnotate, self).setUp()
@@ -151,7 +149,7 @@
                          err)
 
 
-class TestSimpleAnnotate(TestCaseWithTransport):
+class TestSimpleAnnotate(tests.TestCaseWithTransport):
     """Annotate tests with no complex setup."""
 
     def _setup_edited_file(self, relpath='.'):
@@ -168,8 +166,8 @@
     def test_annotate_cmd_revspec_branch(self):
         tree = self._setup_edited_file('trunk')
         tree.branch.create_checkout(self.get_url('work'), lightweight=True)
-        os.chdir('work')
-        out, err = self.run_bzr('annotate file -r branch:../trunk')
+        out, err = self.run_bzr(['annotate', 'file', '-r', 'branch:../trunk'],
+                                working_dir='work')
         self.assertEqual('', err)
         self.assertEqual(
             '1   test at ho | foo\n'
@@ -211,11 +209,12 @@
         tree.merge_from_branch(tree.branch, "rev1.1.1")
         # edit the file to be 'resolved' and have a further local edit
         self.build_tree_contents([('file', 'local\nfoo\nbar\nbaz\ngam\n')])
+        return tree
 
     def test_annotated_edited_merged_file_revnos(self):
-        self._create_merged_file()
-        out, err = self.run_bzr('annotate file')
-        email = extract_email_address(Branch.open('.').get_config().username())
+        wt = self._create_merged_file()
+        out, err = self.run_bzr(['annotate', 'file'])
+        email = extract_email_address(wt.branch.get_config().username())
         self.assertEqual(
             '3?    %-7s | local\n'
             '1     test at ho | foo\n'
@@ -226,7 +225,7 @@
 
     def test_annotated_edited_merged_file_ids(self):
         self._create_merged_file()
-        out, err = self.run_bzr('annotate file --show-ids')
+        out, err = self.run_bzr(['annotate', 'file', '--show-ids'])
         self.assertEqual(
             'current: | local\n'
             '    rev1 | foo\n'
@@ -236,60 +235,50 @@
             out)
 
     def test_annotate_empty_file(self):
-        tree = self.make_branch_and_tree('tree')
-        self.build_tree_contents([('tree/empty', '')])
+        tree = self.make_branch_and_tree('.')
+        self.build_tree_contents([('empty', '')])
         tree.add('empty')
         tree.commit('add empty file')
-
-        os.chdir('tree')
-        out, err = self.run_bzr('annotate empty')
+        out, err = self.run_bzr(['annotate', 'empty'])
         self.assertEqual('', out)
 
     def test_annotate_removed_file(self):
-        tree = self.make_branch_and_tree('tree')
-        self.build_tree_contents([('tree/empty', '')])
+        tree = self.make_branch_and_tree('.')
+        self.build_tree_contents([('empty', '')])
         tree.add('empty')
         tree.commit('add empty file')
         # delete the file.
         tree.remove('empty')
         tree.commit('remove empty file')
-        
-        os.chdir('tree')
-        out, err = self.run_bzr('annotate -r1 empty')
+        out, err = self.run_bzr(['annotate', '-r1', 'empty'])
         self.assertEqual('', out)
 
     def test_annotate_empty_file_show_ids(self):
-        tree = self.make_branch_and_tree('tree')
-        self.build_tree_contents([('tree/empty', '')])
+        tree = self.make_branch_and_tree('.')
+        self.build_tree_contents([('empty', '')])
         tree.add('empty')
         tree.commit('add empty file')
-
-        os.chdir('tree')
         out, err = self.run_bzr(['annotate', '--show-ids', 'empty'])
         self.assertEqual('', out)
 
     def test_annotate_nonexistant_file(self):
-        tree = self.make_branch_and_tree('tree')
-        self.build_tree(['tree/file'])
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(['file'])
         tree.add(['file'])
         tree.commit('add a file')
-
-        os.chdir('tree')
-        out, err = self.run_bzr("annotate doesnotexist", retcode=3)
+        out, err = self.run_bzr(['annotate', 'doesnotexist'], retcode=3)
         self.assertEqual('', out)
         self.assertEqual("bzr: ERROR: doesnotexist is not versioned.\n", err)
 
     def test_annotate_without_workingtree(self):
-        tree = self.make_branch_and_tree('branch')
-        self.build_tree_contents([('branch/empty', '')])
+        tree = self.make_branch_and_tree('.')
+        self.build_tree_contents([('empty', '')])
         tree.add('empty')
         tree.commit('add empty file')
         bzrdir = tree.branch.bzrdir
         bzrdir.destroy_workingtree()
         self.assertFalse(bzrdir.has_workingtree())
-
-        os.chdir('branch')
-        out, err = self.run_bzr('annotate empty')
+        out, err = self.run_bzr(['annotate', 'empty'])
         self.assertEqual('', out)
 
     def test_annotate_directory(self):
@@ -298,5 +287,5 @@
         self.build_tree_contents([('a/hello.txt', 'my helicopter\n')])
         wt.add(['hello.txt'])
         wt.commit('commit', committer='test at user')
-        out, err = self.run_bzr('annotate -d a hello.txt')
+        out, err = self.run_bzr(['annotate', '-d', 'a', 'hello.txt'])
         self.assertEqualDiff('1   test at us | my helicopter\n', out)

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-02-07 04:29:44 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-02-09 09:01:33 +0000
@@ -47,6 +47,9 @@
 .. Fixes for situations where bzr would previously crash or give incorrect
    or undesirable results.
 
+* ``bzr annotate -r-1 file`` will now properly annotate a deleted file.
+  (Andrew King, #537442)
+
 * ``bzr push --overwrite`` with an older revision specified will now correctly
   roll back the target branch. (Jelmer Vernooij, #386576)
 



More information about the bazaar-commits mailing list