Esempio n. 1
0
def CMDbranch(parser, args):
    parser.add_option('--branch', dest='branch', help='branch name')
    parser.add_option('--commit', dest='commit', help='commit hash')

    (opt, args) = parser.parse_args(args)

    project = urllib.quote_plus(opt.project)
    host = urlparse.urlparse(opt.host).netloc
    branch = urllib.quote_plus(opt.branch)
    commit = urllib.quote_plus(opt.commit)
    result = gerrit_util.CreateGerritBranch(host, project, branch, commit)
    logging.info(result)
    write_result(result, opt)
Esempio n. 2
0
def CMDbranch(parser, args):
  """Create a branch in a gerrit project."""
  parser.add_option('--branch', dest='branch', help='branch name')
  parser.add_option('--commit', dest='commit', help='commit hash')

  (opt, args) = parser.parse_args(args)
  assert opt.project, "--project not defined"
  assert opt.branch, "--branch not defined"
  assert opt.commit, "--commit not defined"

  project = quote_plus(opt.project)
  host = urlparse.urlparse(opt.host).netloc
  branch = quote_plus(opt.branch)
  commit = quote_plus(opt.commit)
  result = gerrit_util.CreateGerritBranch(host, project, branch, commit)
  logging.info(result)
  write_result(result, opt)