[PATCH 7 of 9] dirstate: use scmutil.checknewlabel to check new branch name

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Oct 17 22:31:47 CDT 2012


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1350527539 18000
# Node ID 96514c9a8a077f411b28e0bc86521281ebfb99d1
# Parent  e4083c2811721ad7f408b9540c325e4b97d38ecf
dirstate: use scmutil.checknewlabel to check new branch name

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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:


More information about the Mercurial-devel mailing list