diff mercurial/dirstate.py @ 17821:361ab1e2086f

scmutil: add bad character checking to checknewlabel This factors out the checks from tags and bookmarks, and newly applies the same prohibitions to branches. checknewlabel takes a new parameter, kind, indicating the kind of label being checked. Test coverage is added for all three types of labels.
author Kevin Bullock <kbullock@ringworld.org>
date Wed, 17 Oct 2012 21:42:06 -0500
parents ec892050f3c7
children 7b0b1da49f15
line wrap: on
line diff
--- a/mercurial/dirstate.py	Wed Oct 17 21:39:07 2012 -0500
+++ b/mercurial/dirstate.py	Wed Oct 17 21:42:06 2012 -0500
@@ -261,7 +261,7 @@
 
     def setbranch(self, branch):
         # no repo object here, just check for reserved names
-        scmutil.checknewlabel(None, branch)
+        scmutil.checknewlabel(None, branch, 'branch')
         self._branch = encoding.fromlocal(branch)
         f = self._opener('branch', 'w', atomictemp=True)
         try: