Rev 449: Re-merge bugfix for #686324 which was lost in the branch shuffle. in http://bazaar.launchpad.net/~loggerhead-team/loggerhead/experimental

John Arbash Meinel john at arbash-meinel.com
Wed Feb 9 22:13:32 UTC 2011


At http://bazaar.launchpad.net/~loggerhead-team/loggerhead/experimental

------------------------------------------------------------
revno: 449 [merge]
revision-id: john at arbash-meinel.com-20110209221311-h6lwqhq0g6qyr08u
parent: john at arbash-meinel.com-20110209220706-kpscfmnce21cbvi9
parent: john at arbash-meinel.com-20110131212706-8ol6flm3yvibi9fb
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: experimental
timestamp: Wed 2011-02-09 16:13:11 -0600
message:
  Re-merge bugfix for #686324 which was lost in the branch shuffle.
modified:
  loggerhead/tests/test_controllers.py test_controllers.py-20090210051739-5d14nlvjvn2ep4x5-1
-------------- next part --------------
=== modified file 'loggerhead/tests/test_controllers.py'
--- a/loggerhead/tests/test_controllers.py	2010-05-14 09:10:06 +0000
+++ b/loggerhead/tests/test_controllers.py	2011-01-31 21:27:06 +0000
@@ -61,20 +61,25 @@
 
     def make_annotate_ui_for_file_history(self, file_id, rev_ids_texts):
         tree = self.make_branch_and_tree('.')
-        open('filename', 'w').write('')
+        self.build_tree_contents([('filename', '')])
         tree.add(['filename'], [file_id])
         for rev_id, text in rev_ids_texts:
-            open('filename', 'w').write(text)
+            self.build_tree_contents([('filename', text)])
             tree.commit(rev_id=rev_id, message='.')
         tree.branch.lock_read()
         self.addCleanup(tree.branch.unlock)
-        branch_app = BranchWSGIApp(tree.branch)
+        branch_app = BranchWSGIApp(tree.branch, friendly_name='test_name')
         return AnnotateUI(branch_app, branch_app.get_history)
 
     def test_annotate_file(self):
         history = [('rev1', 'old\nold\n'), ('rev2', 'new\nold\n')]
         ann_ui = self.make_annotate_ui_for_file_history('file_id', history)
-        annotated = list(ann_ui.annotate_file('file_id', 'rev2'))
+        # A lot of this state is set up by __call__, but we'll do it directly
+        # here.
+        ann_ui.args = ['rev2']
+        annotate_info = ann_ui.get_values('filename',
+            kwargs={'file_id': 'file_id'}, headers={})
+        annotated = list(annotate_info['annotated'])
         self.assertEqual(2, len(annotated))
         self.assertEqual('2', annotated[0].change.revno)
         self.assertEqual('1', annotated[1].change.revno)



More information about the bazaar-commits mailing list