mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
dirstate: use scmutil.checknewlabel to check new branch name
This commit is contained in:
parent
f8141466d2
commit
68efaf1422
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user