CVS: show files that are locally changed
Asked Answered
N

8

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.

Nuremberg answered 16/1, 2010 at 0:7 Comment(0)
S
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.
Smitherman answered 16/1, 2010 at 0:32 Comment(1)
why not use diff ?Burl
T
25

You can get a short listing of differences using the cvs diff command:

cvs -q diff --brief
Ticktack answered 16/1, 2010 at 0:28 Comment(0)
G
4

Pipe it to grep!

cvs -Q status | grep -i locally
Gummous answered 16/1, 2010 at 0:32 Comment(1)
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.Nuremberg
V
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
Vonnievonny answered 18/6, 2014 at 16:47 Comment(0)
C
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;"
Curry answered 20/10, 2010 at 21:51 Comment(0)
P
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
...
Pixie answered 10/9, 2012 at 17:35 Comment(0)
M
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.

Muscadine answered 23/8, 2013 at 2:15 Comment(0)
L
0

you can use following command to get the list of files you modified locally

cvs -qn update | grep "M " | awk '{print $2}'

Leader answered 10/10, 2017 at 4:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.