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

Use new context stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    def get_parent_revids(self):
61
61
        """Return the IDs of the current revision's predecessors."""
62
62
        repo = self._branch.repository
63
 
        repo.lock_read()
64
 
        retval = repo.get_parent_map([self._revid]).get(self._revid, None)
65
 
        repo.unlock()
 
63
        with repo.lock_read():
 
64
            retval = repo.get_parent_map([self._revid]).get(self._revid, None)
66
65
        return retval
67
66
 
68
67
    def is_merge_point(self):
135
134
            last_revid = branch_last_rev
136
135
 
137
136
        repo = self._branch.repository
138
 
        repo.lock_read()
139
 
        try:
 
137
        with repo.lock_read():
140
138
            graph = repo.get_graph()
141
139
            rev_sequence = graph.iter_lefthand_ancestry(last_revid,
142
140
                (_mod_revision.NULL_REVISION,))
163
161
                high_revid = last_revid
164
162
            if not low_revid:
165
163
                low_revid = self._branch.get_rev_id(1)
166
 
        finally:
167
 
            repo.unlock()
168
164
 
169
165
        # The spread must include the high revision, to bias
170
166
        # odd numbers of intervening revisions towards the high
240
236
 
241
237
    def get_parent_revids(self, revid):
242
238
        repo = self._branch.repository
243
 
        repo.lock_read()
244
 
        try:
 
239
        with repo.lock_read():
245
240
            retval = repo.get_parent_map([revid]).get(revid, None)
246
 
        finally:
247
 
            repo.unlock()
248
241
        return retval
249
242
 
250
243
    def bisect(self, outf):