~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisionspec.py

  • Committer: Vincent Ladeuil
  • Date: 2011-10-27 15:38:14 UTC
  • mfrom: (6015.44.4 2.4)
  • mto: This revision was merged to the branch mainline in revision 6236.
  • Revision ID: v.ladeuil+lp@free.fr-20111027153814-0r4nd2io1jv6t47f
Merge 2.4 into trunk including fix for bug #880701

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    symbol_versioning,
28
28
    workingtree,
29
29
    )
 
30
from bzrlib.i18n import gettext
30
31
""")
31
32
 
32
33
from bzrlib import (
208
209
    def in_history(self, branch):
209
210
        if branch:
210
211
            if self.wants_revision_history:
211
 
                revs = branch.revision_history()
 
212
                # TODO: avoid looking at all of history
 
213
                branch.lock_read()
 
214
                try:
 
215
                    graph = branch.repository.get_graph()
 
216
                    revs = list(graph.iter_lefthand_ancestry(
 
217
                        branch.last_revision(), [revision.NULL_REVISION]))
 
218
                finally:
 
219
                    branch.unlock()
 
220
                revs.reverse()
212
221
            else:
213
222
                revs = None
214
223
        else:
910
919
            location_type = 'parent branch'
911
920
        if submit_location is None:
912
921
            raise errors.NoSubmitBranch(branch)
913
 
        trace.note('Using %s %s', location_type, submit_location)
 
922
        trace.note(gettext('Using {0} {1}').format(location_type,
 
923
                                                        submit_location))
914
924
        return submit_location
915
925
 
916
926
    def _match_on(self, branch, revs):