@hgcommand
def mail(ui, repo, *pats, **opts):
 if codereview_disabled:
  raise hg_util.Abort(codereview_disabled)
 (cl, err) = CommandLineCL(ui, repo, pats, opts, op='mail', defaultcc=defaultcc)
 if (err != ''):
  raise hg_util.Abort(err)
 cl.Upload(ui, repo, gofmt_just_warn=True)
 if (not cl.reviewer):
  if ((not defaultcc) or cl.private):
   raise hg_util.Abort('no reviewers listed in CL')
  cl.cc = Sub(cl.cc, defaultcc)
  cl.reviewer = defaultcc
  cl.Flush(ui, repo)
 if (cl.files == []):
  raise hg_util.Abort('no changed files, not sending mail')
 cl.Mail(ui, repo)

@ hgcommand def mail ( ui , repo , * pats , ** opts ) : if codereview_disabled : raise hg_util . Abort ( codereview_disabled ) ( cl , err ) = CommandLineCL ( ui , repo , pats , opts , op = 'mail' , defaultcc = defaultcc ) if ( err != '' ) : raise hg_util . Abort ( err ) cl . Upload ( ui , repo , gofmt_just_warn = True ) if ( not cl . reviewer ) : if ( ( not defaultcc ) or cl . private ) : raise hg_util . Abort ( 'no reviewers listed in CL' ) cl . cc = Sub ( cl . cc , defaultcc ) cl . reviewer = defaultcc cl . Flush ( ui , repo ) if ( cl . files == [ ] ) : raise hg_util . Abort ( 'no changed files, not sending mail' ) cl . Mail ( ui , repo )
mail a change for review uploads a patch to the code review server and then sends mail to the reviewer and cc list asking for a review .