~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/branch.py

(jelmer) Deprecate Branch.revision_history(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib import (
21
21
    bencode,
22
22
    errors,
 
23
    revision as _mod_revision,
23
24
    )
24
25
from bzrlib.controldir import ControlDir
25
26
from bzrlib.smart.request import (
171
172
        The revision list is returned as the body content,
172
173
        with each revision utf8 encoded and \x00 joined.
173
174
        """
 
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()
174
183
        return SuccessfulSmartServerResponse(
175
 
            ('ok', ), ('\x00'.join(branch.revision_history())))
 
184
            ('ok', ), ('\x00'.join(reversed(history))))
176
185
 
177
186
 
178
187
class SmartServerBranchRequestLastRevisionInfo(SmartServerBranchRequest):