def _actionGitLogHistory_Bg( self, git_project, filename ):
        options = wb_log_history_options_dialog.WbLogHistoryOptions( self.app, self.main_window )

        if not options.exec_():
            return

        commit_log_view = self.factory.logHistoryView(
                self.app, T_('Commit Log for %s') % (filename,) )

        yield from commit_log_view.showCommitLogForFile_Bg( git_project, filename, options )
    def treeActionGitLogHistory_Bg( self, checked=None ):
        options = wb_log_history_options_dialog.WbLogHistoryOptions( self.app, self.main_window )

        if not options.exec_():
            return

        git_project = self.selectedGitProject()

        commit_log_view = self.factory.logHistoryView(
                self.app,
                T_('Commit Log for %s') % (git_project.projectName(),) )

        yield from commit_log_view.showCommitLogForRepository_Bg( git_project, options )
    def _actionP4LogHistory_Bg(self, p4_project, filename):
        options = wb_log_history_options_dialog.WbLogHistoryOptions(
            self.app, None, self.main_window)

        if not options.exec_():
            return

        change_log_view = self.factory.logHistoryView(
            self.app,
            T_('Change Log for %s') % (filename, ))

        yield from change_log_view.showChangeLogForFile_Bg(
            p4_project, filename, options)
Esempio n. 4
0
    def __actionSvnLogHistory_Bg( self, svn_project, filename ):
        options = wb_log_history_options_dialog.WbLogHistoryOptions( self.app, self.main_window )
        # as soon as possible del options to attemtp to avoid XCB errors
        if not options.exec_():
            return

        self.setStatusAction( T_('Log for %(filename)s') %
                                    {'filename': filename} )
        self.progress.start( T_('Logs %(count)d') )

        yield self.switchToBackground
        try:
            all_commit_nodes = svn_project.cmdCommitLogForFile( filename, options.getLimit(), options.getSince(), options.getUntil())

        except wb_svn_project.ClientError as e:
            svn_project.logClientError( e, 'Cannot get commit logs for %s:%s' % (svn_project.projectName(), filename) )

            yield self.switchToForeground
            return

        if len(all_commit_nodes) > 0:
            yield self.switchToForeground
            self.progress.start( T_('Tags %(count)d') )

            yield self.switchToBackground
            try:
                all_tag_nodes = svn_project.cmdTagsForFile( filename, all_commit_nodes[-1]['revision'].number )
                all_commit_nodes.extend( all_tag_nodes )

            except wb_svn_project.ClientError as e:
                svn_project.logClientError( e, 'Cannot get tags for %s:%s' % (svn_project.projectName(), filename) )
                # continue to show the logs we have got

        def key( node ):
            return -node['revision'].number

        all_commit_nodes.sort( key=key )

        yield self.switchToForeground
        self.progress.end()
        self.setStatusAction()

        log_history_view = self.factory.logHistoryView(
                self.app,
                T_('Commit Log for %(project)s:%(path)s') %
                        {'project': svn_project.projectName()
                        ,'path': filename} )

        log_history_view.showCommitLogForFile( svn_project, filename, all_commit_nodes )
        log_history_view.show()
    def treeActionGitLogHistory_Bg(self, checked=None):
        git_project = self.selectedGitProject()
        all_tags = sorted(git_project.cmdTagsForRepository().values(),
                          reverse=True)

        options = wb_log_history_options_dialog.WbLogHistoryOptions(
            self.app, all_tags, self.main_window)

        if not options.exec_():
            return

        commit_log_view = self.factory.logHistoryView(
            self.app,
            T_('Commit Log for %s') % (git_project.projectName(), ))

        yield from commit_log_view.showCommitLogForRepository_Bg(
            git_project, options)
Esempio n. 6
0
    def treeActionP4LogHistory_Bg( self, checked=None ):
        folder_path = self.table_view.selectedAbsoluteFolder()
        if folder_path is None:
            return

        options = wb_log_history_options_dialog.WbLogHistoryOptions( self.app, self.main_window )

        if not options.exec_():
            return

        p4_project = self.selectedP4Project()

        change_log_view = self.factory.logHistoryView(
                self.app,
                T_('Change Log for %s') % (p4_project.projectName(),) )

        yield from change_log_view.showChangeLogForFolder_Bg( p4_project, folder_path, options )
Esempio n. 7
0
    def __actionSvnLogHistory_Bg(self, svn_project, filename):
        self.progress.start(T_('Finding Tags'))

        yield self.switchToBackground
        try:
            all_tag_nodes = svn_project.cmdTagsForFile(filename)

        except wb_svn_project.ClientError as e:
            svn_project.logClientError(
                e, 'Cannot get tags for %s:%s' %
                (svn_project.projectName(), filename))
            all_tag_nodes = []

        all_tags = [node.tag_name for node in all_tag_nodes]

        yield self.switchToForeground

        self.progress.end()

        options = wb_log_history_options_dialog.WbLogHistoryOptions(
            self.app, all_tags, self.main_window)
        # as soon as possible del options to attemtp to avoid XCB errors
        if not options.exec_():
            return

        self.setStatusAction(
            T_('Log for %(filename)s') % {'filename': filename})
        self.progress.start(T_('Logs %(count)d'))

        yield self.switchToBackground
        try:
            tag = options.getTag()
            if tag is not None:
                # find the tag node
                for node in all_tag_nodes:
                    if node.tag_name == tag:
                        break

                all_tag_nodes = [node]

                rev = node.revision

            else:
                rev = None

            all_commit_nodes = svn_project.cmdCommitLogForFile(
                filename, options.getLimit(), options.getSince(),
                options.getUntil(), rev)

        except wb_svn_project.ClientError as e:
            svn_project.logClientError(
                e, 'Cannot get commit logs for %s:%s' %
                (svn_project.projectName(), filename))

            yield self.switchToForeground
            return

        if len(all_commit_nodes) > 0:
            all_commit_nodes.extend(all_tag_nodes)

        def key(node):
            return -node['revision'].number

        all_commit_nodes.sort(key=key)

        yield self.switchToForeground
        self.progress.end()
        self.setStatusAction()

        log_history_view = self.factory.logHistoryView(
            self.app,
            T_('Commit Log for %(project)s:%(path)s') % {
                'project': svn_project.projectName(),
                'path': filename
            })

        log_history_view.showCommitLogForFile(svn_project, filename,
                                              all_commit_nodes)
        log_history_view.show()