Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 25295:701df761aa94
branch: don't warn about branches if repository has multiple branches already
This warning exists to prevent git users from prematurely polluting
their namespace when trying out Mercurial. But for repos that already
have multiple branches, understanding what branches are is not
optional so we should just shut up.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 22 May 2015 17:08:59 -0500 |
parents | ad1d2c952889 |
children | 9bc11716bc86 |
comparison
equal
deleted
inserted
replaced
25293:ab618e52788a | 25295:701df761aa94 |
---|---|
1105 # i18n: "it" refers to an existing branch | 1105 # i18n: "it" refers to an existing branch |
1106 hint=_("use 'hg update' to switch to it")) | 1106 hint=_("use 'hg update' to switch to it")) |
1107 scmutil.checknewlabel(repo, label, 'branch') | 1107 scmutil.checknewlabel(repo, label, 'branch') |
1108 repo.dirstate.setbranch(label) | 1108 repo.dirstate.setbranch(label) |
1109 ui.status(_('marked working directory as branch %s\n') % label) | 1109 ui.status(_('marked working directory as branch %s\n') % label) |
1110 ui.status(_('(branches are permanent and global, ' | 1110 |
1111 'did you want a bookmark?)\n')) | 1111 # find any open named branches aside from default |
1112 others = [n for n, h, t, c in repo.branchmap().iterbranches() | |
1113 if n != "default" and not c] | |
1114 if not others: | |
1115 ui.status(_('(branches are permanent and global, ' | |
1116 'did you want a bookmark?)\n')) | |
1112 finally: | 1117 finally: |
1113 wlock.release() | 1118 wlock.release() |
1114 | 1119 |
1115 @command('branches', | 1120 @command('branches', |
1116 [('a', 'active', False, | 1121 [('a', 'active', False, |