/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 workingtree.py

Add check-all target.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    StringIO,
23
23
    )
24
24
import errno
 
25
from dulwich.index import (
 
26
    Index,
 
27
    )
25
28
from dulwich.objects import (
26
29
    Blob,
27
 
    )
28
 
from dulwich.protocol import (
29
30
    ZERO_SHA,
30
31
    )
31
32
import os
46
47
    )
47
48
 
48
49
 
 
50
from bzrlib.plugins.git.dir import (
 
51
    LocalGitDir,
 
52
    )
49
53
from bzrlib.plugins.git.inventory import (
50
54
    GitIndexInventory,
51
55
    )
108
112
        finally:
109
113
            self.branch.unlock()
110
114
 
111
 
    def is_control_filename(self, path):
112
 
        return os.path.basename(path) == ".git"
113
 
 
114
115
    def _rewrite_index(self):
115
116
        self.index.clear()
116
117
        for path, entry in self._inventory.iter_entries():
136
137
                    # old index
137
138
                    from posix import stat_result
138
139
                    stat_val = stat_result((stat.S_IFLNK, 0, 0, 0, 0, 0, 0, 0, 0, 0))
139
 
                blob.set_raw_string(entry.symlink_target)
 
140
                blob.set_raw_string(self.get_symlink_target(entry.file_id).encode("utf-8"))
140
141
            else:
141
142
                raise AssertionError("unknown kind '%s'" % entry.kind)
142
143
            # Add object to the repository if it didn't exist yet
215
216
 
216
217
    @property
217
218
    def _matchingbzrdir(self):
218
 
        from bzrlib.plugins.git import LocalGitControlDirFormat
 
219
        from bzrlib.plugins.git.dir import LocalGitControlDirFormat
219
220
        return LocalGitControlDirFormat()
220
221
 
221
222
    def get_format_description(self):
222
223
        return "Git Working Tree"
223
224
 
 
225
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
 
226
                   accelerator_tree=None, hardlink=False):
 
227
        """See WorkingTreeFormat.initialize()."""
 
228
        if not isinstance(a_bzrdir, LocalGitDir):
 
229
            raise errors.IncompatibleFormat(self, a_bzrdir)
 
230
        index = Index(a_bzrdir.root_transport.local_abspath(".git/index"))
 
231
        index.write()
 
232
        return GitWorkingTree(a_bzrdir, a_bzrdir.open_repository(),
 
233
            a_bzrdir.open_branch(), index)
 
234
 
224
235
 
225
236
class InterIndexGitTree(tree.InterTree):
226
237
    """InterTree that works between a Git revision tree and an index."""