dlax requested changes to this revision. dlax added inline comments. This revision now requires changes to proceed.
INLINE COMMENTS > commands.py:1048 > scmutil.checknewlabel(repo, label, 'branch') > - repo.dirstate.setbranch(label) > - ui.status(_('marked working directory as branch %s\n') % label) > - > - # find any open named branches aside from default > - others = [n for n, h, t, c in repo.branchmap().iterbranches() > - if n != "default" and not c] > - if not others: > - ui.status(_('(branches are permanent and global, ' > - 'did you want a bookmark?)\n')) > + if True: > + repo.dirstate.setbranch(label) Instead of this, you could use an early `return` in the next patch as: --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1045,6 +1045,10 @@ def branch(ui, repo, label=None, **opts) # i18n: "it" refers to an existing branch hint=_("use 'hg update' to switch to it")) scmutil.checknewlabel(repo, label, 'branch') + + if revs: + return cmdutil.changebranch(ui, repo, revs, label) + repo.dirstate.setbranch(label) ui.status(_('marked working directory as branch %s\n') % label) and drop this one. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1073 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel