mercurial branch name use integer as a name
问题:
mercurial branch name use integer as a name
解决:
到安装目录下找到mercurial/scmutil.py文件(我的:/usr/local/Cellar/mercurial/3.8.1/lib/python2.7/site-packages/mercurial),修改下面
def checknewlabel(repo, lbl, kind): # Do not use the "kind" parameter in ui output. # It makes strings difficult to translate. if lbl in ['tip', '.', 'null']: raise error.Abort(_("the name '%s' is reserved") % lbl) for c in (':', '\0', '\n', '\r'): if c in lbl: raise error.Abort(_("%r cannot be used in a name") % c) //这里以前没有注释掉,现在注释掉,这样就不会对名称进行int检查,就可以使用 //int 类型的名字了 # try: # int(lbl) # raise error.Abort(_("cannot use an integer as a name")) # except ValueError: # pass
参考:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2013-February/048686.html
https://www.mercurial-scm.org/pipermail/mercurial-devel/2012-October/045567.html (重要)
浙公网安备 33010602011771号