65
65
output = self.run_bzr_captured(['diff', '-r', 'branch:branch2',
68
self.assertEquals(("=== modified file 'file'\n"
68
self.assertEquals(("=== modified file 'a/file'\n"
71
71
"@@ -1,1 +1,1 @@\n"
73
73
"+contents of branch1/file\n"
75
75
output = self.run_bzr_captured(['diff', 'branch2', 'branch1'],
77
self.assertEqualDiff(("=== modified file 'file'\n"
77
self.assertEqualDiff(("=== modified file 'a/file'\n"
80
80
"@@ -1,1 +1,1 @@\n"
82
82
"+contents of branch1/file\n"
119
119
self.runbzr('checkout branch1 checkouts/branch1')
120
120
self.runbzr('checkout branch2 checkouts/branch2')
121
121
os.chdir('checkouts')
123
class TestDiffLabels(TestDiff):
125
def test_diff_label_removed(self):
126
super(TestDiffLabels, self).example_branch()
127
self.runbzr('remove hello')
128
diff = self.run_bzr_captured(['diff'], retcode=1)
129
self.assertTrue("=== removed file 'a/hello'" in diff[0])
131
def test_diff_label_added(self):
132
super(TestDiffLabels, self).example_branch()
133
file('barbar', 'wt').write('barbar')
134
self.runbzr('add barbar')
135
diff = self.run_bzr_captured(['diff'], retcode=1)
136
self.assertTrue("=== added file 'b/barbar'" in diff[0])
138
def test_diff_label_modified(self):
139
super(TestDiffLabels, self).example_branch()
140
file('hello', 'wt').write('barbar')
141
diff = self.run_bzr_captured(['diff'], retcode=1)
142
self.assertTrue("=== modified file 'a/hello'" in diff[0])
144
def test_diff_label_renamed(self):
145
super(TestDiffLabels, self).example_branch()
146
self.runbzr('rename hello gruezi')
147
diff = self.run_bzr_captured(['diff'], retcode=1)
148
self.assertTrue("=== renamed file 'a/hello' => 'b/gruezi'" in diff[0])