开发者

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

开发者 https://www.devze.com 2023-03-08 11:46 出处:网络
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.

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

精彩评论

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