dirstate: use scmutil.checknewlabel to check new branch name
authorKevin Bullock <kbullock@ringworld.org>
Wed, 17 Oct 2012 21:32:19 -0500
changeset 17819 ec892050f3c7
parent 17818 5023027240a1
child 17820 c547e1acc37c
dirstate: use scmutil.checknewlabel to check new branch name
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Oct 17 17:23:39 2012 -0500
+++ b/mercurial/dirstate.py	Wed Oct 17 21:32:19 2012 -0500
@@ -260,8 +260,8 @@
         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: