/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/plugins/git/tests/test_workingtree.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-03 03:20:44 UTC
  • mfrom: (7018.3.10 git-fixes)
  • Revision ID: breezy.the.bot@gmail.com-20180703032044-t5a5w5y0tmzrbezc
Port a few more bits of the git plugin to python 3.

Merged from https://code.launchpad.net/~jelmer/brz/git-fixes2/+merge/348803

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        self.build_tree(['conflicted'])
65
65
        self.tree.add(['conflicted'])
66
66
        with self.tree.lock_tree_write():
67
 
            self.tree.index['conflicted'] = self.tree.index['conflicted'][:9] + (FLAG_STAGEMASK, )
 
67
            self.tree.index[b'conflicted'] = self.tree.index[b'conflicted'][:9] + (FLAG_STAGEMASK, )
68
68
            self.tree._index_dirty = True
69
69
        conflicts = self.tree.conflicts()
70
70
        self.assertEqual(1, len(conflicts))
91
91
    def test_missing(self):
92
92
        delta = TreeDelta()
93
93
        delta.removed.append(('a', b'a-id', 'file'))
94
 
        changes = [(('a', 'a'), (stat.S_IFREG | 0o755, 0), (b'a' * 40, b'a' * 40))]
 
94
        changes = [((b'a', b'a'), (stat.S_IFREG | 0o755, 0), (b'a' * 40, b'a' * 40))]
95
95
        self.assertEqual(
96
96
            delta,
97
97
            tree_delta_from_git_changes(changes, default_mapping,
98
 
                (GitFileIdMap({'a': b'a-id'}, default_mapping),
99
 
                 GitFileIdMap({'a': b'a-id'}, default_mapping))))
 
98
                (GitFileIdMap({u'a': b'a-id'}, default_mapping),
 
99
                 GitFileIdMap({u'a': b'a-id'}, default_mapping))))
100
100
 
101
101
 
102
102
class ChangesBetweenGitTreeAndWorkingCopyTests(TestCaseWithTransport):
122
122
 
123
123
    def test_empty(self):
124
124
        self.expectDelta(
125
 
            [((None, ''), (None, stat.S_IFDIR), (None, Tree().id))])
 
125
            [((None, b''), (None, stat.S_IFDIR), (None, Tree().id))])
126
126
 
127
127
    def test_added_file(self):
128
128
        self.build_tree(['a'])