Discussion:
cvs command line usage
J.V.
2011-08-07 21:04:09 UTC
Permalink
How do I show a list of files on my local machine that:

1) files that do not exist in the repo
2) files that are modified locally but have not been committed
3) files that are in the repo but not on my local system
4) files that have been modified in the repo but not (updated) on
my local system


With all of the above, I simply want a single line per file and not alot
of other messages or junk. Just one line per file.

If this is not possible, would I have to resort to writing perl or
something?

J.V.
Jim Hyslop
2011-08-05 14:16:00 UTC
Permalink
1) files that do not exist in the repo 2) files that are modified
locally but have not been committed 3) files that are in the repo but
not on my local system 4) files that have been modified in the repo
but not (updated) on my local system
cvs -nq update

(1) will be indicated by '?'
(2) will be indicated by 'M'
(3) and (4) will be indicated by 'U'

If you need to distinguish between (3) and (4) you'll have to write a
script or batch file or script that will check to see if the file exists
locally, and convert the 'U' indicator to something else (maybe 'N' for
'New').

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management
Jim Hyslop
2011-08-05 14:41:53 UTC
Permalink
Post by Jim Hyslop
1) files that do not exist in the repo 2) files that are modified
locally but have not been committed 3) files that are in the repo
but not on my local system 4) files that have been modified in the
repo but not (updated) on my local system
cvs -nq update
(1) will be indicated by '?' (2) will be indicated by 'M' (3) and
(4) will be indicated by 'U'
For completeness, I should point out that merge conflicts will be
indicated by 'C'. And there is a fifth case you might want to consider:
files that have been modified both in the repository and locally. The
bad news is, CVS uses 'M' to indicate those files. The good news is, it
also prints out a few lines ahead of it:

RCS file: /path/to/file,v
retrieving revision 1.1
retrieving revision 1.2
Merging differences between 1.1 and 1.2 into file
M file

so you can write a script/batch file that will detect the "Merging
differences" line and emit a different message for 'file'.

If there would be a merge conflict, then CVS will emit a couple of
warnings, and the last line will read 'C file'.

I hope all this makes sense - I haven't had my morning coffee yet :)

BTW, you might want to check your computer's time - according to my mail
reader, your message originates two days in the future :D

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management
Glasgow, Steven Mr CIV USA TRADOC
2011-08-05 14:20:05 UTC
Permalink
Classification: UNCLASSIFIED
Caveats: NONE

Enter this command....

cvs -q -n update -d >> /tmp/modified.txt

Then...
1) awk '/? /{ print $2 }' /tmp/modified.txt
2) awk '/M /{ print $2 }' /tmp/modified.txt
3 & 4) awk '/U /{ print $2 }' /tmp/modified.txt

Also...

1) awk '/A /{ print $2 }' /tmp/modified.txt
Will show you the files you have added but not yet committed

2) awk '/R /{ print $2 }' /tmp/modified.txt
Will show you the files you have removed but not yet committed

3) awk '/C /{ print $2 }' /tmp/modified.txt
Will show you files that will have conflicts when you update

Steve

-----Original Message-----
From: info-cvs-bounces+steven.glasgow=***@nongnu.org
[mailto:info-cvs-bounces+steven.glasgow=***@nongnu.org] On Behalf Of
J.V.
Sent: Sunday, August 07, 2011 4:04 PM
To: info-***@nongnu.org
Subject: cvs command line usage

How do I show a list of files on my local machine that:

1) files that do not exist in the repo
2) files that are modified locally but have not been committed
3) files that are in the repo but not on my local system
4) files that have been modified in the repo but not (updated) on my
local system


With all of the above, I simply want a single line per file and not alot
of other messages or junk. Just one line per file.

If this is not possible, would I have to resort to writing perl or
something?

J.V.

Classification: UNCLASSIFIED
Caveats: NONE
Glasgow, Steven Mr CIV USA TRADOC
2011-08-05 14:44:01 UTC
Permalink
Classification: UNCLASSIFIED
Caveats: NONE

Sorry...fat fingers...in the first line you enter, change ">>" to ">".

Steve

-----Original Message-----
From: Glasgow, Steven Mr CIV USA TRADOC
Sent: Friday, August 05, 2011 9:20 AM
To: info-***@nongnu.org
Subject: RE: cvs command line usage (UNCLASSIFIED)

Classification: UNCLASSIFIED
Caveats: NONE

Enter this command....

cvs -q -n update -d >> /tmp/modified.txt

Then...
1) awk '/? /{ print $2 }' /tmp/modified.txt
2) awk '/M /{ print $2 }' /tmp/modified.txt
3 & 4) awk '/U /{ print $2 }' /tmp/modified.txt

Also...

1) awk '/A /{ print $2 }' /tmp/modified.txt
Will show you the files you have added but not yet committed

2) awk '/R /{ print $2 }' /tmp/modified.txt
Will show you the files you have removed but not yet committed

3) awk '/C /{ print $2 }' /tmp/modified.txt
Will show you files that will have conflicts when you update

Steve

-----Original Message-----
From: info-cvs-bounces+steven.glasgow=***@nongnu.org
[mailto:info-cvs-bounces+steven.glasgow=***@nongnu.org] On Behalf Of
J.V.
Sent: Sunday, August 07, 2011 4:04 PM
To: info-***@nongnu.org
Subject: cvs command line usage

How do I show a list of files on my local machine that:

1) files that do not exist in the repo
2) files that are modified locally but have not been committed
3) files that are in the repo but not on my local system
4) files that have been modified in the repo but not (updated) on my
local system


With all of the above, I simply want a single line per file and not alot of
other messages or junk. Just one line per file.

If this is not possible, would I have to resort to writing perl or
something?

J.V.

Classification: UNCLASSIFIED
Caveats: NONE


Classification: UNCLASSIFIED
Caveats: NONE

Loading...