~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-05 18:11:19 UTC
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20111005181119-temwjtxkgnt3jybm
Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
        The revision list is returned as the body content,
173
173
        with each revision utf8 encoded and \x00 joined.
174
174
        """
175
 
        graph = self.branch.get_graph()
176
 
        stop_revisions = (None, _mod_revision.NULL_REVISION)
177
 
        history = list(graph.iter_lefthand_ancestry(
178
 
            branch.last_revision(), stop_revisions))
 
175
        branch.lock_read()
 
176
        try:
 
177
            graph = branch.repository.get_graph()
 
178
            stop_revisions = (None, _mod_revision.NULL_REVISION)
 
179
            history = list(graph.iter_lefthand_ancestry(
 
180
                branch.last_revision(), stop_revisions))
 
181
        finally:
 
182
            branch.unlock()
179
183
        return SuccessfulSmartServerResponse(
180
184
            ('ok', ), ('\x00'.join(reversed(history))))
181
185