mercurial/commands.py
changeset 44440 d543ef183eb8
parent 44439 5a5aee8ba980
parent 44401 92b7caf4cb9e
child 44452 9d2b2df2c2ba
equal deleted inserted replaced
44439:5a5aee8ba980 44440:d543ef183eb8
  1338             ui.status(_(b'reset working directory to branch %s\n') % label)
  1338             ui.status(_(b'reset working directory to branch %s\n') % label)
  1339         elif label:
  1339         elif label:
  1340 
  1340 
  1341             scmutil.checknewlabel(repo, label, b'branch')
  1341             scmutil.checknewlabel(repo, label, b'branch')
  1342             if revs:
  1342             if revs:
  1343                 return cmdutil.changebranch(ui, repo, revs, label)
  1343                 return cmdutil.changebranch(ui, repo, revs, label, opts)
  1344 
  1344 
  1345             if not opts.get(b'force') and label in repo.branchmap():
  1345             if not opts.get(b'force') and label in repo.branchmap():
  1346                 if label not in [p.branch() for p in repo[None].parents()]:
  1346                 if label not in [p.branch() for p in repo[None].parents()]:
  1347                     raise error.Abort(
  1347                     raise error.Abort(
  1348                         _(b'a branch of the same name already exists'),
  1348                         _(b'a branch of the same name already exists'),