Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mercurial:注释/责备当前行号_Mercurial - Fatal编程技术网

Mercurial:注释/责备当前行号

Mercurial:注释/责备当前行号,mercurial,Mercurial,显示: hg annotate -unl aFile 我怎样才能让它显示出来 jim 1519:477: a = 4 bob 1518:468: b = 5 joe 1496:402: return a 其中,401402403是当前的行号。更好的方法是像git那样使用git-L 401403 aFile显示当前行号: jim 401: a = 4 bob 402: b = 5 joe 403: return a hg annotate -u

显示:

hg annotate -unl aFile
我怎样才能让它显示出来

jim 1519:477:     a = 4
bob 1518:468:     b = 5
joe 1496:402:     return a

其中,
401402403
当前的行号。更好的方法是像git那样使用
git-L 401403 aFile

显示当前行号:

jim 401:     a = 4
bob 402:     b = 5
joe 403:     return a
hg annotate -u aFile | cat -n
要仅选择特定范围的行号,请执行以下操作:

jim 401:     a = 4
bob 402:     b = 5
joe 403:     return a
hg annotate -u aFile | cat -n

我总是在
hgserve
或fromtoisehg中使用注释视图。我发现命令行注释非常糟糕,因为我无法快速跳转到父版本。hgweb注释可在此处查看:


它包括(当前)行号。

将它添加到.bashrc可以节省一些输入:
函数hggull(){hg annotate-u$1 | cat-n | sed-n$2p}
。也许colorcat会更好一点…有点多嘴,但要准确。我想知道他们为什么选择不实施这一点。感谢@xr09的盛宴。