/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_conflicts.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
 
26
26
def make_tree_with_conflicts(test, this_path='this', other_path='other',
27
 
        prefix='my'):
 
27
                             prefix='my'):
28
28
    this_tree = test.make_branch_and_tree(this_path)
29
29
    test.build_tree_contents([
30
30
        ('%s/%sfile' % (this_path, prefix), b'this content\n'),
31
31
        ('%s/%s_other_file' % (this_path, prefix), b'this content\n'),
32
32
        ('%s/%sdir/' % (this_path, prefix),),
33
33
        ])
34
 
    this_tree.add(prefix+'file')
35
 
    this_tree.add(prefix+'_other_file')
36
 
    this_tree.add(prefix+'dir')
 
34
    this_tree.add(prefix + 'file')
 
35
    this_tree.add(prefix + '_other_file')
 
36
    this_tree.add(prefix + 'dir')
37
37
    this_tree.commit(message="new")
38
38
    other_tree = this_tree.controldir.sprout(other_path).open_workingtree()
39
39
    test.build_tree_contents([
40
40
        ('%s/%sfile' % (other_path, prefix), b'contentsb\n'),
41
41
        ('%s/%s_other_file' % (other_path, prefix), b'contentsb\n'),
42
42
        ])
43
 
    other_tree.rename_one(prefix+'dir', prefix+'dir2')
 
43
    other_tree.rename_one(prefix + 'dir', prefix + 'dir2')
44
44
    other_tree.commit(message="change")
45
45
    test.build_tree_contents([
46
46
        ('%s/%sfile' % (this_path, prefix), b'contentsa2\n'),
47
47
        ('%s/%s_other_file' % (this_path, prefix), b'contentsa2\n'),
48
48
        ])
49
 
    this_tree.rename_one(prefix+'dir', prefix+'dir3')
 
49
    this_tree.rename_one(prefix + 'dir', prefix + 'dir3')
50
50
    this_tree.commit(message='change')
51
51
    this_tree.merge_from_branch(other_tree.branch)
52
52
    return this_tree, other_tree
97
97
        """Conflict messages involving non-ascii paths are displayed okay"""
98
98
        make_tree_with_conflicts(self, "branch", prefix=u"\xA7")
99
99
        out, err = self.run_bzr(["conflicts", "-d", "branch"],
100
 
            encoding=self.encoding)
 
100
                                encoding=self.encoding)
101
101
        self.assertEqual(out if PY3 else out.decode(self.encoding),
102
 
            u"Text conflict in \xA7_other_file\n"
103
 
            u"Path conflict: \xA7dir3 / \xA7dir2\n"
104
 
            u"Text conflict in \xA7file\n")
 
102
                         u"Text conflict in \xA7_other_file\n"
 
103
                         u"Path conflict: \xA7dir3 / \xA7dir2\n"
 
104
                         u"Text conflict in \xA7file\n")
105
105
        self.assertEqual(err, "")
106
106
 
107
107
    def test_text_conflict_paths(self):
108
108
        """Text conflicts on non-ascii paths are displayed okay"""
109
109
        make_tree_with_conflicts(self, "branch", prefix=u"\xA7")
110
110
        out, err = self.run_bzr(["conflicts", "-d", "branch", "--text"],
111
 
            encoding=self.encoding)
 
111
                                encoding=self.encoding)
112
112
        self.assertEqual(out if PY3 else out.decode(self.encoding),
113
 
            u"\xA7_other_file\n"
114
 
            u"\xA7file\n")
 
113
                         u"\xA7_other_file\n"
 
114
                         u"\xA7file\n")
115
115
        self.assertEqual(err, "")
116
116
 
117
117