def local_merge(): """Provides a dialog for merging branches""" model = cola.model() view = MergeView(model, qtutils.active_window()) view.show() view.raise_() return view def abort_merge(): """Prompts before aborting a merge in progress """ title = qtutils.tr('Abort Merge...') txt = ('Aborting the current merge will cause ' '*ALL* uncommitted changes to be lost.\n' 'Recovering uncommitted changes is not possible.') info_txt = 'Aborting the current merge?' ok_txt = 'Abort Merge' if qtutils.confirm(title, txt, info_txt, ok_txt, default=False, icon=qtutils.icon('undo.svg')): gitcmds.abort_merge() if __name__ == '__main__': from cola import app app = app.ColaApplication([]) view = local_merge() cola.model().update_status() app.exec_()
"""Provides a dialog for merging branches""" model = MergeModel() view = MergeView(model, qtutils.active_window()) ctl = MergeController(model, view) view.show() view.raise_() return ctl def abort_merge(): """Prompts before aborting a merge in progress """ title = qtutils.tr('Abort Merge...') txt = ('Aborting the current merge will cause ' '*ALL* uncommitted changes to be lost.\n' 'Recovering uncommitted changes is not possible.') info_txt = 'Aborting the current merge?' ok_txt = 'Abort Merge' if qtutils.confirm(title, txt, info_txt, ok_txt, default=False, icon=qtutils.icon('undo.svg')): gitcmds.abort_merge() if __name__ == '__main__': from cola import app app = app.ColaApplication([]) ctl = local_merge() ctl.model.update_status() app.exec_()
from cola.dag.view import DAGView from cola.dag.model import DAG from cola.dag.controller import DAGController def git_dag(model, opts=None, args=None): """Return a pre-populated git DAG widget.""" dag = DAG(model.currentbranch, 1000) dag.set_options(opts, args) view = DAGView(model, dag, qtutils.active_window()) ctl = DAGController(dag, view) view.show() view.raise_() if dag.ref: view.thread.start(QtCore.QThread.LowPriority) return ctl if __name__ == "__main__": import cola from cola import app model = cola.model() model.use_worktree(os.getcwd()) model.update_status() app = app.ColaApplication(sys.argv) ctl = git_dag(model) sys.exit(app.exec_())