~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_diff.py

  • Committer: Martin Pool
  • Date: 2006-05-04 05:02:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1699.
  • Revision ID: mbp@sourcefrog.net-20060504050255-d0c0573ef8849c59
Remove 'a/', 'b/' default prefixes on diff output.  
(You can still get them with --diff-prefix)

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        output = self.run_bzr_captured(['diff', '-r', 'branch:branch2', 
83
83
                                        'branch1'],
84
84
                                       retcode=1)
85
 
        self.assertEquals(("=== modified file 'a/file'\n"
86
 
                           "--- a/file\t\n"
87
 
                           "+++ b/file\t\n"
 
85
        self.assertEquals(("=== modified file 'file'\n"
 
86
                           "--- file\t\n"
 
87
                           "+++ file\t\n"
88
88
                           "@@ -1,1 +1,1 @@\n"
89
89
                           "-new content\n"
90
90
                           "+contents of branch1/file\n"
91
91
                           "\n", ''), output)
92
92
        output = self.run_bzr_captured(['diff', 'branch2', 'branch1'],
93
93
                                       retcode=1)
94
 
        self.assertEqualDiff(("=== modified file 'a/file'\n"
95
 
                              "--- a/file\t\n"
96
 
                              "+++ b/file\t\n"
 
94
        self.assertEqualDiff(("=== modified file 'file'\n"
 
95
                              "--- file\t\n"
 
96
                              "+++ file\t\n"
97
97
                              "@@ -1,1 +1,1 @@\n"
98
98
                              "-new content\n"
99
99
                              "+contents of branch1/file\n"
144
144
        super(TestDiffLabels, self).make_example_branch()
145
145
        self.runbzr('remove hello')
146
146
        diff = self.run_bzr_captured(['diff'], retcode=1)
147
 
        self.assertTrue("=== removed file 'a/hello'" in diff[0])
 
147
        self.assertTrue("=== removed file 'hello'" in diff[0])
148
148
 
149
149
    def test_diff_label_added(self):
150
150
        super(TestDiffLabels, self).make_example_branch()
151
151
        file('barbar', 'wt').write('barbar')
152
152
        self.runbzr('add barbar')
153
153
        diff = self.run_bzr_captured(['diff'], retcode=1)
154
 
        self.assertTrue("=== added file 'b/barbar'" in diff[0])
 
154
        self.assertTrue("=== added file 'barbar'" in diff[0])
155
155
 
156
156
    def test_diff_label_modified(self):
157
157
        super(TestDiffLabels, self).make_example_branch()
158
158
        file('hello', 'wt').write('barbar')
159
159
        diff = self.run_bzr_captured(['diff'], retcode=1)
160
 
        self.assertTrue("=== modified file 'a/hello'" in diff[0])
 
160
        self.assertTrue("=== modified file 'hello'" in diff[0])
161
161
 
162
162
    def test_diff_label_renamed(self):
163
163
        super(TestDiffLabels, self).make_example_branch()
164
164
        self.runbzr('rename hello gruezi')
165
165
        diff = self.run_bzr_captured(['diff'], retcode=1)
166
 
        self.assertTrue("=== renamed file 'a/hello' => 'b/gruezi'" in diff[0])
 
166
        self.assertTrue("=== renamed file 'hello' => 'gruezi'" in diff[0])