def git_dag(model, args=None, settings=None, existing_view=None):
 branch = model.currentbranch
 branch_doubledash = ((branch and (branch + u' --')) or u'')
 ctx = dag.DAG(branch_doubledash, 1000)
 ctx.set_arguments(args)
 if (existing_view is None):
  view = GitDAG(model, ctx, settings=settings)
 else:
  view = existing_view
  view.set_context(ctx)
 if ctx.ref:
  view.display()
 return view

def git_dag ( model , args = None , settings = None , existing_view = None ) : branch = model . currentbranch branch_doubledash = ( ( branch and ( branch + u' --' ) ) or u'' ) ctx = dag . DAG ( branch_doubledash , 1000 ) ctx . set_arguments ( args ) if ( existing_view is None ) : view = GitDAG ( model , ctx , settings = settings ) else : view = existing_view view . set_context ( ctx ) if ctx . ref : view . display ( ) return view
return a pre-populated git dag widget .