问题描述
||
是否有任何简单的cvs命令,通过它我可以将文件首次添加到CVS存储库中的模块时的日期/时间。
我实际上想要一个可以由我的某些脚本使用的一行输出。
解决方法
这在CVS中不是直接可能的。可以获取文件的活动日志,然后从中确定日期。以下是单行命令,它像超级按钮一样工作,并给出了首次在存储库中添加文件的日期。
cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -N *FilePath* | grep ^date: | sort | head -n 1 | cut -d\\; -f1 | sed -e \'s/date: //\'
上面的命令将查看整个存储库并给出日期。如果正在分支上寻找该文件的第一个活动,请使用以下命令。
对于分支:
cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -N -r*BranchName* *FilePath* | grep ^date: | sort | head -n 1 | cut -d\\; -f1 | sed -e \'s/date: //\'
对于后备箱:
cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -N -r::HEAD *FilePath* | grep ^date: | sort | head -n 1 | cut -d\\; -f1 | sed -e \'s/date: //\'