~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-11 11:47:36 UTC
  • mfrom: (5200.3.8 lock_return)
  • Revision ID: pqm@pqm.ubuntu.com-20100511114736-mc1sq9zyo3vufec7
(lifeless) Provide a consistent interface to Tree, Branch,
 Repository where lock methods return an object with an unlock method to
 unlock the lock. This breaks the API for Branch,
 Repository on their lock_write methods. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1993
1993
        lf.log_revision(lr)
1994
1994
 
1995
1995
 
1996
 
def _get_info_for_log_files(revisionspec_list, file_list):
 
1996
def _get_info_for_log_files(revisionspec_list, file_list, add_cleanup):
1997
1997
    """Find file-ids and kinds given a list of files and a revision range.
1998
1998
 
1999
1999
    We search for files at the end of the range. If not found there,
2003
2003
    :param file_list: the list of paths given on the command line;
2004
2004
      the first of these can be a branch location or a file path,
2005
2005
      the remainder must be file paths
 
2006
    :param add_cleanup: When the branch returned is read locked,
 
2007
      an unlock call will be queued to the cleanup.
2006
2008
    :return: (branch, info_list, start_rev_info, end_rev_info) where
2007
2009
      info_list is a list of (relative_path, file_id, kind) tuples where
2008
2010
      kind is one of values 'directory', 'file', 'symlink', 'tree-reference'.
2010
2012
    """
2011
2013
    from builtins import _get_revision_range, safe_relpath_files
2012
2014
    tree, b, path = bzrdir.BzrDir.open_containing_tree_or_branch(file_list[0])
2013
 
    b.lock_read()
 
2015
    add_cleanup(b.lock_read().unlock)
2014
2016
    # XXX: It's damn messy converting a list of paths to relative paths when
2015
2017
    # those paths might be deleted ones, they might be on a case-insensitive
2016
2018
    # filesystem and/or they might be in silly locations (like another branch).