Is there any simple way to show only the files in my repository that have been locally added, removed, or modified? I know that I can type "cvs stat" and look through the list of files, but that is tedious and error-prone. I am wondering if there is an easier way. I am using CVS 1.11.17, in case that matters.
Asked
Active
Viewed 4.4k times
8 Answers
87
A 'dummy' update will give you this information.
cvs -qn update
A short description of the used options:
-q Cause CVS to be somewhat quiet.
-n Do not execute anything that will change the disk.
-
1why not use `diff` ? – Don Cheadle Jan 26 '16 at 19:56
24
You can get a short listing of differences using the cvs diff
command:
cvs -q diff --brief

martin clayton
- 76,436
- 32
- 213
- 198
4
Pipe it to grep
!
cvs -Q status | grep -i locally

Ryan Joy
- 3,021
- 19
- 20
-
I tried that, and I didn't really like it. I would like to see the path for the changed files, and not just the filenames. I tried cvs stat 2>/dev/null |grep Local -B1 -A4 |grep -vE "^$" and it was a little better, but kind of messy and quirky. – Elias Zamaria Jan 16 '10 at 00:35
2
Here is what I use:
cvs -Q status | grep -A 4 Locally | egrep -v '^\-\-|^ Working|^ Commit|^$' | awk '{print $2 " " $4}' | sed -e 's/\<Locally\>//;s/revision: \CVS-REPOSITORY-PATH/\t\t/'
Output:
pin_stages.ref
tests/unit/ccsn/pin_stages/pin_stages.ref,v
pin_stages_func.ref
tests/unit/ccsn/pin_stages_func/pin_stages_func.ref,v

cppRohit
- 27
- 6
0
As an alternative to commonly mentioned cvs update -qn
, you can go for cvs release
command. But this one is interactive and asks for confirmation at the end of the output (so you just need to abort it!). Normal output:
> cvs release .
...
U some/updated/file
M some/modified/file
...
You have [1] altered files in this repository.
Are you sure you want to release directory `.': n
** `release' aborted by user choice.
>
After question Are you sure you want to release directory '.':
you put something different than y
or Y
.

Knight of Ni
- 1,780
- 3
- 20
- 47
0
Here is nmake-perl script list modified files, it is based on aforesaid cvs update -qn:
DIRS=\
c:\project1\
c:\project2
all: $(DIRS)
!cd $? & cvs -qn update | perl -ne "s!\/!\\!g;print '$?\\'.qq($$1) if /^M (.*)/s;"

vtrz
- 591
- 1
- 6
- 12
0
you can use following command to get the list of files you modified locally
cvs -qn update | grep "M " | awk '{print $2}'

Ram
- 25
- 6