/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 more tests for fetch code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    workingtree,
28
28
    )
29
29
 
 
30
from dulwich.index import Index
 
31
 
30
32
class GitWorkingTree(workingtree.WorkingTree):
31
33
    """A Git working tree."""
32
34
 
50
52
 
51
53
        self._format = GitWorkingTreeFormat()
52
54
 
53
 
    def lock_read(self):
54
 
        pass
 
55
        self.index = Index(os.path.join(self.repository._git.controldir(), 
 
56
            "index"))
 
57
        self.views = self._make_views()
55
58
 
56
59
    def unlock(self):
57
 
        pass
 
60
        # non-implementation specific cleanup
 
61
        self._cleanup()
 
62
 
 
63
        # reverse order of locking.
 
64
        try:
 
65
            return self._control_files.unlock()
 
66
        finally:
 
67
            self.branch.unlock()
58
68
 
59
69
    def is_control_filename(self, path):
60
70
        return os.path.basename(path) == ".git"