def git_dag(model, args=None): """Return a pre-populated git DAG widget.""" branch = model.currentbranch # disambiguate between branch names and filenames by using '--' branch_doubledash = branch and (branch + ' --') or '' dag = DAG(branch_doubledash, 1000) dag.set_arguments(args) view = DAGView(model, dag) if dag.ref: view.display() return view
def git_dag(model, args=None, settings=None): """Return a pre-populated git DAG widget.""" branch = model.currentbranch # disambiguate between branch names and filenames by using '--' branch_doubledash = branch and (branch + ' --') or '' dag = DAG(branch_doubledash, 1000) dag.set_arguments(args) view = GitDAG(model, dag, settings=settings) if dag.ref: view.display() return view
def build_commits_menu(self, cmd, menu, chooser, prefix=''): dag = DAG('HEAD', 6) commits = RepoReader(dag) menu_commits = [] for idx, c in enumerate(commits): menu_commits.insert(0, c) if idx > 5: continue menu.clear() for c in menu_commits: menu.addAction(prefix + c.summary, cmds.run(cmd, c.sha1)) if len(commits) == 6: menu.addSeparator() menu.addAction(N_('More...'), chooser)