hg branch
从没有存储库的随机位置运行将产生以下输出:
$ hg branch
abort: no repository found in '/home/abe' (.hg not found)!
abort: no repository found in '/home/abe' (.hg not found)!
我不想看到这些错误,因此尝试hg branch 2>/dev/null
导致以下结果:
$ hg branch 2>/dev/null
abort: no repository found in '/home/abe' (.hg not found)!
如果不是stderr,这条线从哪里来?我认为Mercurial可能也会将这些错误回显到标准输出,因此我尝试$ hg branch 2>&1 | awk '{print "test: "$0}'
得出以下结果:
$ hg branch 2>&1 | awk '{print "test: "$0}'
test: abort: no repository found in '/home/abe' (.hg not found)!
abort: no repository found in '/home/abe' (.hg not found)!
我想做的是运行hg branch
并获取我所在分支的名称,或者根本不输出。有任何想法吗?
我是个白痴。
我试图添加hg branch
到我的PS1中,所以我想知道在终端中正在处理哪个分支。第一个错误是我的.bashrc中先前尝试的遗留内容。
一如既往的愚蠢的错误:)谢谢大家!
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句