Logo Search packages:      
Sourcecode: qbzr version File versions

def qbzr::lib::loggraphprovider::LogGraphProvider::open_locations (   self,
  locations 
)

Open branches or repositories and file-ids to be loaded from a list
of locations strings, inputed by the user (such as at the command line.)

Definition at line 195 of file loggraphprovider.py.

00195                                        :
        """Open branches or repositories and file-ids to be loaded from a list
        of locations strings, inputed by the user (such as at the command line.)
        
        """
        paths_and_branches_err = "It is not possible to specify different file paths and different branches at the same time."
        
        for location in locations:
            tree, br, repo, fp = \
                    BzrDir.open_containing_tree_branch_or_repository(location)
            self.update_ui()
            
            if br is None:
                if fp:
                    raise errors.NotBranchError(fp)
                
                branches = repo.find_branches(using=True) 
                for br in branches:
                    try:
                        tree = br.bzrdir.open_workingtree()
                    except errors.NoWorkingTree:
                        tree = None
                    self.append_branch(tree, br)
                    self.append_repo(br.repository)
                self.update_ui()
            else:
                self.append_repo(repo)
                self.append_branch(tree, br)
                if len(self.branches())==1 and self.trunk_branch == None:
                    self.trunk_branch = br
            
            # If no locations were sepecified, don't do fileids
            # Otherwise it gives you the history for the dir if you are
            # in a sub dir.
            #
            # XXX - There is a case where this does not behave correctly.
            # If we are in subdir and we do "bzr qlog ." then we should filter
            # on subdir. but if we do "bzr qlog" then we should not. To be able
            # to do this, we need to move the implication the no location
            # argument means '.' down in to the method, rather than where it is
            # now. - GaryvdM 29 May 2009
            if fp != '' and locations==["."]:
                fp = ''

            if fp != '' :
                if tree is None:
                    tree = br.basis_tree()
                
                file_id = tree.path2id(fp)
                if file_id is None:
                    raise errors.BzrCommandError(
                        "Path does not have any revision history: %s" %
                        location)
                
                kind = tree.kind(file_id)
                if kind in ('directory', 'tree-reference'):
                    self.has_dir = True
                self.update_ui()
                
                self.fileids.append(file_id)
        
        if self.fileids and len(self.branches())>1:
            raise errors.BzrCommandError(paths_and_branches_err)

    def lock_read_branches(self):


Generated by  Doxygen 1.6.0   Back to index