Search This Blog

Tuesday, December 24, 2013

cvs equivalent of "svn status"


To get output similar to "svn status" while using cvs as the version control system, run
=> cvs -n -q update
U file1
U file2
M file3
M file4
? file5
? file6
This will display files modified upstream, files modified locally, files not tracked by cvs. The output is compact and similar to the output of "svn status".

Create an alias for this in the shell rc file
=> grep cvst ~/.cshrc
alias cvst    'cvs -n -q update'
Other Alternatives:
#!/bin/sh
#------------------------------------------------------------------------------
# Approach 1
# Initial version from : http://www.freshblurbs.com/blog/2009/02/08/cvs-status-one-svn-bash-script.html
# Problem: this will not display files not part of cvs.

patterns=( 
    '?' 
    'Locally Added'
    'Locally Modified' 
    'Needs Patch'
    )

for i in "${patterns[@]}"
do
  cvs -Q status -R . | grep -i "$i"
done
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Approach 2
# Initial version from : http://www.dzone.com/snippets/doing-something-equivalent-svn
# Problem: this will not display files not part of cvs.

cvs status 2>&1 | egrep "(^\? |Status: )" | grep -v Up-to-date
#------------------------------------------------------------------------------

No comments:

Followers