~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-11-21 16:02:13 UTC
  • mto: This revision was merged to the branch mainline in revision 6285.
  • Revision ID: jelmer@samba.org-20111121160213-w3w6jkfps6s091gq
Allow lazy_regex.lazy_compile patterns to be pickled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2012 Canonical Ltd
 
1
# Copyright (C) 2006-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Black-box tests for bzr diff."""
 
18
"""Black-box tests for bzr diff.
 
19
"""
19
20
 
20
21
import os
21
22
import re
287
288
        self.example_branch2()
288
289
        self.build_tree_contents([('branch1/file1', 'new line')])
289
290
        os.mkdir('branch1/dir1')
290
 
        output = self.run_bzr('diff -r 1..', retcode=1,
291
 
                              working_dir='branch1/dir1')
 
291
        os.chdir('branch1/dir1')
 
292
        output = self.run_bzr('diff -r 1..', retcode=1)
292
293
        self.assertContainsRe(output[0], '\n\\-original line\n\\+new line\n')
293
294
 
294
295
    def test_diff_across_rename(self):
315
316
                return super(BooDiffTree, self).show_diff(specific_files,
316
317
                    extra_trees)
317
318
 
318
 
        diff_format_registry.register("boo", BooDiffTree, "Scary diff format")
 
319
        diff_format_registry.register("boo", BooDiffTree, 
 
320
            "Scary diff format")
319
321
        self.addCleanup(diff_format_registry.remove, "boo")
320
322
        self.make_example_branch()
321
323
        self.build_tree_contents([('hello', 'hello world!\n')])
341
343
        return tree
342
344
 
343
345
    def example_branches(self):
344
 
        branch1_tree, branch2_tree = super(TestCheckoutDiff,
345
 
                                           self).example_branches()
 
346
        branch1_tree, branch2_tree = super(TestCheckoutDiff, self).example_branches()
346
347
        os.mkdir('checkouts')
347
348
        branch1_tree = branch1_tree.branch.create_checkout('checkouts/branch1')
348
349
        branch2_tree = branch2_tree.branch.create_checkout('checkouts/branch2')