开发者

How to determine date/time when a file was first added to CVS repository

Is there any simple cvs command through which I can get date/time when a file was first added to the module in CVS repository.

I actual开发者_StackOverflow中文版ly want a one line output that can be consumed by my some script.


This is not directly possible in CVS. One can get activity logs for a file and then identify the date from them. Following is the single line command that works like a charm and gives the date when the file was first added in the repository.

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -N *FilePath* | grep ^date: | sort | head -n 1 | cut -d\; -f1 | sed -e 's/date: //'

Above command looks through the entire repository and gives the date. If one is looking for first activity on that file on a branch use following commands.

For Branch:

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: //'

For Trunk:

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: //'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜