ZhYQ-Note

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 (重要)

分类:

技术点:

相关文章:

  • 2021-08-15
  • 2022-01-12
  • 2021-07-01
  • 2021-06-03
  • 2021-09-19
  • 2021-07-21
  • 2021-05-07
  • 2021-06-18
猜你喜欢
  • 2021-09-07
  • 2021-07-30
  • 2021-08-27
  • 2021-09-07
  • 2021-08-01
  • 2021-09-24
相关资源
相似解决方案