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

  • Committer: Jelmer Vernooij
  • Date: 2019-08-11 13:21:03 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7388.
  • Revision ID: jelmer@jelmer.uk-20190811132103-u3ne03yf37c1h57n
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2038
2038
        lf.log_revision(lr)
2039
2039
 
2040
2040
 
2041
 
def _get_info_for_log_files(revisionspec_list, file_list, add_cleanup):
 
2041
def _get_info_for_log_files(revisionspec_list, file_list, exit_stack):
2042
2042
    """Find file-ids and kinds given a list of files and a revision range.
2043
2043
 
2044
2044
    We search for files at the end of the range. If not found there,
2048
2048
    :param file_list: the list of paths given on the command line;
2049
2049
      the first of these can be a branch location or a file path,
2050
2050
      the remainder must be file paths
2051
 
    :param add_cleanup: When the branch returned is read locked,
2052
 
      an unlock call will be queued to the cleanup.
 
2051
    :param exit_stack: When the branch returned is read locked,
 
2052
      an unlock call will be queued to the exit stack.
2053
2053
    :return: (branch, info_list, start_rev_info, end_rev_info) where
2054
2054
      info_list is a list of (relative_path, file_id, kind) tuples where
2055
2055
      kind is one of values 'directory', 'file', 'symlink', 'tree-reference'.
2058
2058
    from breezy.builtins import _get_revision_range
2059
2059
    tree, b, path = controldir.ControlDir.open_containing_tree_or_branch(
2060
2060
        file_list[0])
2061
 
    add_cleanup(b.lock_read().unlock)
 
2061
    exit_stack.enter_context(b.lock_read())
2062
2062
    # XXX: It's damn messy converting a list of paths to relative paths when
2063
2063
    # those paths might be deleted ones, they might be on a case-insensitive
2064
2064
    # filesystem and/or they might be in silly locations (like another branch).