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

Fix RevisionTree.get_file_text().

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
class GitLock(object):
36
36
    """A lock that thunks through to Git."""
37
37
 
38
 
    def lock_write(self):
 
38
    def lock_write(self, token=None):
39
39
        pass
40
40
 
41
41
    def lock_read(self):
44
44
    def unlock(self):
45
45
        pass
46
46
 
 
47
    def peek(self):
 
48
        pass
 
49
 
47
50
 
48
51
class GitLockableFiles(lockable_files.LockableFiles):
49
52
    """Git specific lockable files abstraction."""
80
83
        return True
81
84
 
82
85
    def open_branch(self, ignored=None):
83
 
        """'crate' a branch for this dir."""
84
 
        return git_branch.GitBranch(self, self._lockfiles)
 
86
        """'create' a branch for this dir."""
 
87
        repo = self.open_repository()
 
88
        if repo._git.heads == []:
 
89
            head = None
 
90
        else:
 
91
            head = repo._git.heads[0].commit.id
 
92
        return git_branch.GitBranch(self, repo, head, 
 
93
                                    self.root_transport.base, self._lockfiles)
85
94
 
86
95
    def open_repository(self, shared=False):
87
96
        """'open' a repository for this dir."""
134
143
            raise errors.bzr_errors.NotBranchError(path=transport.base)
135
144
        raise errors.bzr_errors.NotBranchError(path=transport.base)
136
145
 
 
146
    def get_format_description(self):
 
147
        return "Local Git Repository"
 
148
 
137
149
 
138
150
bzrdir.BzrDirFormat.register_control_format(GitBzrDirFormat)