dirstate: use scmutil.checknewlabel to check new branch name

This commit is contained in:
Kevin Bullock 2012-10-17 21:32:19 -05:00
parent f8141466d2
commit 68efaf1422

View File

@ -260,8 +260,8 @@ class dirstate(object):
return copies
def setbranch(self, branch):
if branch in ['tip', '.', 'null']:
raise util.Abort(_('the name \'%s\' is reserved') % branch)
# no repo object here, just check for reserved names
scmutil.checknewlabel(None, branch)
self._branch = encoding.fromlocal(branch)
f = self._opener('branch', 'w', atomictemp=True)
try: