Rev 2587: fix up more run_bzr callers in http://sourcefrog.net/bzr/cleanup-runbzr

Martin Pool mbp at sourcefrog.net
Thu Jul 5 01:29:30 BST 2007


At http://sourcefrog.net/bzr/cleanup-runbzr

------------------------------------------------------------
revno: 2587
revision-id: mbp at sourcefrog.net-20070705002929-sj9snyfyp6mygxvq
parent: mbp at sourcefrog.net-20070705001225-sgr71qfxpj9ghc83
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: cleanup-runbzr
timestamp: Thu 2007-07-05 10:29:29 +1000
message:
  fix up more run_bzr callers
modified:
  bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
  bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
=== modified file 'bzrlib/tests/blackbox/test_log.py'
--- a/bzrlib/tests/blackbox/test_log.py	2007-07-04 08:46:22 +0000
+++ b/bzrlib/tests/blackbox/test_log.py	2007-07-05 00:29:29 +0000
@@ -97,7 +97,7 @@
         self._prepare()
         self.run_bzr_error(('bzr: ERROR: Start revision must be older than '
                             'the end revision.\n',),
-                           'log', '-r3..1')
+                           ['log', '-r3..1'])
 
     def test_log_revno_n_path(self):
         os.mkdir('branch1')
@@ -168,18 +168,18 @@
 
     def _prepare(self):
         self.build_tree(['parent/'])
-        self.run_bzr('init', 'parent')
+        self.run_bzr('init parent')
         self.run_bzr(['commit', '-m', 'first post', '--unchanged', 'parent'])
-        self.run_bzr('branch', 'parent', 'child')
+        self.run_bzr('branch parent child')
         self.run_bzr(['commit', '-m', 'branch 1', '--unchanged', 'child'])
-        self.run_bzr('branch', 'child', 'smallerchild')
+        self.run_bzr('branch child smallerchild')
         self.run_bzr(['commit', '-m', 'branch 2', '--unchanged',
                       'smallerchild'])
         os.chdir('child')
-        self.run_bzr('merge', '../smallerchild')
+        self.run_bzr('merge ../smallerchild')
         self.run_bzr(['commit', '-m', 'merge branch 2'])
         os.chdir('../parent')
-        self.run_bzr('merge', '../child')
+        self.run_bzr('merge ../child')
         self.run_bzr(['commit', '-m', 'merge branch 1'])
 
     def test_merges_are_indented_by_level(self):
@@ -240,7 +240,7 @@
 
     def test_merges_single_merge_rev(self):
         self._prepare()
-        out,err = self.run_bzr('log', '-r1.1.2')
+        out,err = self.run_bzr('log -r1.1.2')
         # the log will look something like:
 #        self.assertEqual("""\
 #    ------------------------------------------------------------
@@ -275,7 +275,7 @@
 
     def test_merges_partial_range(self):
         self._prepare()
-        out,err = self.run_bzr('log', '-r1.1.1..1.1.2')
+        out,err = self.run_bzr('log -r1.1.1..1.1.2')
         # the log will look something like:
 #        self.assertEqual("""\
 #    ------------------------------------------------------------
@@ -438,49 +438,49 @@
         tree.commit('add file2')
         tree.add('file3')
         tree.commit('add file3')
-        self.run_bzr('branch', 'parent', 'child')
+        self.run_bzr('branch parent child')
         print >> file('child/file2', 'wb'), 'hello'
         self.run_bzr(['commit', '-m', 'branch 1', 'child'])
         os.chdir('parent')
-        self.run_bzr('merge', '../child')
+        self.run_bzr('merge ../child')
         self.run_bzr(['commit', '-m', 'merge child branch'])
-        log = self.run_bzr('log', 'file1')[0]
+        log = self.run_bzr('log file1')[0]
         self.assertContainsRe(log, 'revno: 1\n')
         self.assertNotContainsRe(log, 'revno: 2\n')
         self.assertNotContainsRe(log, 'revno: 3\n')
         self.assertNotContainsRe(log, 'revno: 3.1.1\n')
         self.assertNotContainsRe(log, 'revno: 4\n')
-        log = self.run_bzr('log', 'file2')[0]
+        log = self.run_bzr('log file2')[0]
         self.assertNotContainsRe(log, 'revno: 1\n')
         self.assertContainsRe(log, 'revno: 2\n')
         self.assertNotContainsRe(log, 'revno: 3\n')
         self.assertContainsRe(log, 'revno: 3.1.1\n')
         self.assertContainsRe(log, 'revno: 4\n')
-        log = self.run_bzr('log', 'file3')[0]
+        log = self.run_bzr('log file3')[0]
         self.assertNotContainsRe(log, 'revno: 1\n')
         self.assertNotContainsRe(log, 'revno: 2\n')
         self.assertContainsRe(log, 'revno: 3\n')
         self.assertNotContainsRe(log, 'revno: 3.1.1\n')
         self.assertNotContainsRe(log, 'revno: 4\n')
-        log = self.run_bzr('log', '-r3.1.1', 'file2')[0]
+        log = self.run_bzr('log -r3.1.1 file2')[0]
         self.assertNotContainsRe(log, 'revno: 1\n')
         self.assertNotContainsRe(log, 'revno: 2\n')
         self.assertNotContainsRe(log, 'revno: 3\n')
         self.assertContainsRe(log, 'revno: 3.1.1\n')
         self.assertNotContainsRe(log, 'revno: 4\n')
-        log = self.run_bzr('log', '-r4', 'file2')[0]
-        self.assertNotContainsRe(log, 'revno: 1\n')
-        self.assertNotContainsRe(log, 'revno: 2\n')
-        self.assertNotContainsRe(log, 'revno: 3\n')
-        self.assertContainsRe(log, 'revno: 3.1.1\n')
-        self.assertContainsRe(log, 'revno: 4\n')
-        log = self.run_bzr('log', '-r3..', 'file2')[0]
-        self.assertNotContainsRe(log, 'revno: 1\n')
-        self.assertNotContainsRe(log, 'revno: 2\n')
-        self.assertNotContainsRe(log, 'revno: 3\n')
-        self.assertContainsRe(log, 'revno: 3.1.1\n')
-        self.assertContainsRe(log, 'revno: 4\n')
-        log = self.run_bzr('log', '-r..3', 'file2')[0]
+        log = self.run_bzr('log -r4 file2')[0]
+        self.assertNotContainsRe(log, 'revno: 1\n')
+        self.assertNotContainsRe(log, 'revno: 2\n')
+        self.assertNotContainsRe(log, 'revno: 3\n')
+        self.assertContainsRe(log, 'revno: 3.1.1\n')
+        self.assertContainsRe(log, 'revno: 4\n')
+        log = self.run_bzr('log -r3.. file2')[0]
+        self.assertNotContainsRe(log, 'revno: 1\n')
+        self.assertNotContainsRe(log, 'revno: 2\n')
+        self.assertNotContainsRe(log, 'revno: 3\n')
+        self.assertContainsRe(log, 'revno: 3.1.1\n')
+        self.assertContainsRe(log, 'revno: 4\n')
+        log = self.run_bzr('log -r..3 file2')[0]
         self.assertNotContainsRe(log, 'revno: 1\n')
         self.assertContainsRe(log, 'revno: 2\n')
         self.assertNotContainsRe(log, 'revno: 3\n')

=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py	2007-07-04 08:46:22 +0000
+++ b/bzrlib/tests/test_log.py	2007-07-05 00:29:29 +0000
@@ -161,12 +161,13 @@
         wt.add('file1')
         wt.add('file2')
         wt.commit(message='add file1 and file2')
-        self.run_bzr('branch', 'parent', 'child')
+        self.run_bzr('branch parent child')
         os.unlink('child/file1')
         print >> file('child/file2', 'wb'), 'hello'
-        self.run_bzr('commit', '-m', 'remove file1 and modify file2', 'child')
+        self.run_bzr(['commit', '-m', 'remove file1 and modify file2',
+            'child'])
         os.chdir('parent')
-        self.run_bzr('merge', '../child')
+        self.run_bzr('merge ../child')
         wt.commit('merge child branch')
         os.chdir('..')
         b = wt.branch
@@ -288,15 +289,16 @@
     def test_merges_are_indented_by_level(self):
         wt = self.make_branch_and_tree('parent')
         wt.commit('first post')
-        self.run_bzr('branch', 'parent', 'child')
-        self.run_bzr('commit', '-m', 'branch 1', '--unchanged', 'child')
-        self.run_bzr('branch', 'child', 'smallerchild')
-        self.run_bzr('commit', '-m', 'branch 2', '--unchanged', 'smallerchild')
+        self.run_bzr('branch parent child')
+        self.run_bzr(['commit', '-m', 'branch 1', '--unchanged', 'child'])
+        self.run_bzr('branch child smallerchild')
+        self.run_bzr(['commit', '-m', 'branch 2', '--unchanged',
+            'smallerchild'])
         os.chdir('child')
-        self.run_bzr('merge', '../smallerchild')
-        self.run_bzr('commit', '-m', 'merge branch 2')
+        self.run_bzr('merge ../smallerchild')
+        self.run_bzr(['commit', '-m', 'merge branch 2'])
         os.chdir('../parent')
-        self.run_bzr('merge', '../child')
+        self.run_bzr('merge ../child')
         wt.commit('merge branch 1')
         b = wt.branch
         sio = StringIO()
@@ -346,12 +348,13 @@
         self.build_tree(['parent/f1', 'parent/f2'])
         wt.add(['f1','f2'])
         wt.commit('first post')
-        self.run_bzr('branch', 'parent', 'child')
+        self.run_bzr('branch parent child')
         os.unlink('child/f1')
         print >> file('child/f2', 'wb'), 'hello'
-        self.run_bzr('commit', '-m', 'removed f1 and modified f2', 'child')
+        self.run_bzr(['commit', '-m', 'removed f1 and modified f2',
+            'child'])
         os.chdir('parent')
-        self.run_bzr('merge', '../child')
+        self.run_bzr('merge ../child')
         wt.commit('merge branch 1')
         b = wt.branch
         sio = StringIO()




More information about the bazaar-commits mailing list