diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1045,15 +1045,16 @@ # i18n: "it" refers to an existing branch hint=_("use 'hg update' to switch to it")) 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) + 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')) @command('branches', [('a', 'active', False,