48

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.

Elias Zamaria
  • 96,623
  • 33
  • 114
  • 148

8 Answers8

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.
dokaspar
  • 8,186
  • 14
  • 70
  • 98
CB Bailey
  • 755,051
  • 104
  • 632
  • 656
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

Do a CVS Update Files prepended with M are modified files.

Example:

CVS Update
cvsntsrv server: Updating dat/idv
M dat/idv/conduct.idv  = Modified
...
Marijn
  • 10,367
  • 5
  • 59
  • 80
Andre
  • 9
  • 1
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