/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 gitlib/git_branch.py

More refactoring. Add some direct tests for GitModel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib import (
20
20
    branch,
21
21
    config,
 
22
    revision,
22
23
    )
23
24
from bzrlib.decorators import needs_read_lock
24
25
 
61
62
    @needs_read_lock
62
63
    def last_revision(self):
63
64
        # perhaps should escape this ?
64
 
        return bzrrevid_from_git(self.repository.git.get_head())
 
65
        head_git_id = self.repository._git.get_head()
 
66
        if head_git_id is None:
 
67
            return revision.NULL_REVISION
 
68
        return ids.convert_revision_id_git_to_bzr(head_git_id)
65
69
 
66
70
    @needs_read_lock
67
71
    def revision_history(self):
92
96
 
93
97
    def set_push_location(self, location):
94
98
        """See Branch.set_push_location."""
95
 
        self.get_config().set_user_option('push_location', location, 
 
99
        self.get_config().set_user_option('push_location', location,
96
100
                                          local=True)
97
101
 
98
102