CVS Commands 數位芝麻網路公司蔡志展 2001/8/18 CVS Commands • add • Add a new file/directory to the repository • admin • Administration front end for rcs • annotate.

Slides:



Advertisements
Similar presentations
Week 2 DUE This Week: Safety Form and Model Release DUE Next Week: Project Timelines and Website Notebooks Lab Access SharePoint Usage Subversion Software.
Advertisements

TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Concurrent Versions System Overview of CVS architecture. Repository structure.
Version Control System (Sub)Version Control (SVN).
Version Control with CVS Peter Dinda Department of Computer Science Northwestern University.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Working in Project Teams Using CVS and Solaris ACLs ● Concurrent Version System:  Allows multiple programmers to work on one project at the same time.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
Concurrent Versioning System Chapter 8 (ALBING’s).
A Crash Course in CVS 19 November 2003 Joe Vornehm Northwestern University ECE Department.
CVS Workshop I Arthur Chan. This workshop CVS overview (10%) Basic CVS commands (40%) Practical Issues in using CVS (50%) My experience in real-life For.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
The Design Workshop Introduction to Version Control 1.
Version Control with Subversion Quick Reference of Subversion.
1 Lecture 19 Configuration Management Software Engineering.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
CVS 簡介 數位芝麻網路公司蔡志展 2001/8/18 大綱 • CVS 簡介 • CVS 安裝 • CVS 設定 (Linux/Windows) • CVS 指令簡介 • CVS 多人環境的應用.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
Object-Oriented Software Engineering Using UNIX groups and CVS Estimated Time: minutes.
Drexel University Software Engineering Research Group Git for SE101 1.
…using Git/Tortoise Git
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
An Intro to Concurrent Versions System (CVS) ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
CSE 219 Computer Science III CVS
ClearCase Concepts and Terminology
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala.
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
WinCvs. WinCVS WinCvs is a window based version control system. Use WinCvs when  You want to save every version of your file you have ever created. CVS.
CVS: Concurrent Version System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Version Control System
Presentation OLOMOLA,Afolabi( ). Update Changes in CSV/SVN.
Version Control and SVN ECE 297. Why Do We Need Version Control?
WinCVS Training è Basic Concepts è Download & Setup è Importing a new module into CVS Repository è Getting new module from CVS è Getting Latest version.
Recitation 2: Abhijit Warkhedi2/25/20161 Today’s Agenda u CVS u GDB.
Visual Source Safe –A Quick Tour. CONTENTS What is VSS ? How to install VSS ? How does VSS track versions? VSS Concepts & Features Utilities available.
CVS Multi-developer environment 數位芝麻網路公司蔡志展 2001/8/18.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
GIT: What, how and why ? Part 1: Basics. What do I know about git? Started using it for experiments on April 2009 Moved all voms development on git on.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Concurrent Versions System Overview of CVS architecture.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Problem Solving With C++ SVN ( Version Control ) April 2016.
SVN intro (review).
An Intro to Concurrent Versions System (CVS)
CVS revisions UML diagram
Version Control System
CVS Concurrent Versioning System
Amandeep Jawa Worker Bee Software
Prof. Hilfinger CS164 Lecture 4
Concurrent Versions System
Presentation transcript:

CVS Commands 數位芝麻網路公司蔡志展 2001/8/18

CVS Commands • add • Add a new file/directory to the repository • admin • Administration front end for rcs • annotate • Show last revision where each line was modified • checkout • Checkout sources for editing • commit • Check files into the repository • diff • Show differences between revisions •

CVS Commands • edit • Get ready to edit a watched file • editors • See who is editing a watched file • export • Export sources from CVS, similar to checkout • history • Show repository access history • import • Import sources into CVS, using vendor branches • init • Create a CVS repository if it doesn't exist

CVS Commands • log • Print out history information for files • login • Prompt for password for authenticating server. • logout • Removes entry in.cvspass for remote repository. • rdiff • Create 'patch' format diffs between releases • release • Indicate that a Module is no longer in use • remove • Remove an entry from the repository

CVS Commands • rtag • Add a symbolic tag to a module • status • Display status information on checked out files • tag • Add a symbolic tag to checked out version of files • unedit • Undo an edit command • update • Bring work tree in sync with repository • watch • Set watches • watchers • See who is watching a file

Starting a project with CVS • When you begin using CVS, you will probably already have several projects that can be put under CVS control. In these cases the easiest way is to use the import command. An example is probably the easiest way to explain how to use it. If the files you want to install in CVS reside in `myproj', and you want them to appear in the repository as `$CVSROOT/myproj', you can do this:

Starting a project with CVS Build the myproj directory tree. $ cd myproj $ cvs import -m "Imported sources" myproj d11e start

Starting a project with CVS • Congratulations! If you ran that command (or something similar), you've finally done something that affects the repository. • Reading over the output of the import command, you'll notice that CVS precedes each filename with a single letter - in this case, "N" for "new file". The use of a single letter on the left to indicate the status of a file is a general pattern in CVS command output. We'll see it later in checkout and update as well.

Reminder • You might think that, having just imported the project, you can start working in the tree immediately. This is not the case, however. The current directory tree is still not a CVS working copy. It was the source for the import command, true, but it wasn't magically changed into a CVS working copy merely by virtue of having been imported. To get a working copy, you need to check one out from the repository.

Checking Out A Working Copy • The command to check out a project is exactly what you think it is: $ cvs checkout myproj

Making A Change Finding Out What You (And Others) Did • “cvs update” or “cvs up”

cvs update Usage: cvs update [-APdflRp] [-k kopt] [-r rev|-D date] [-j rev] [-I ign] [-W spec] [files...] -A Reset any sticky tags/date/kopts. -P Prune empty directories. -d Build directories, like checkout does. -f Force a head revision match if tag/date not found. -l Local directory only, no recursion. -R Process directories recursively. -p Send updates to standard output (avoids stickiness). -k kopt Use RCS kopt -k option on checkout. -r rev Update using specified revision/tag (is sticky). -D date Set date to update from (is sticky). -j rev Merge in changes made between current revision and rev. -I ign More files to ignore (! to reset). -W spec Wrappers specification line.

Status of file U file The file was brought up to date with respect to the repository. This is done for any file that exists in the repository but not in your source, and for files that you haven't changed but are not the most recent versions available in the repository. A file The file has been added to your private copy of the sources, and will be added to the source repository when you run `cvs commit' on the file. This is a reminder to you that the file needs to be committed.

Status of file R file The file has been removed from your private copy of the sources, and will be removed from the source repository when you run `cvs commit' on the file. This is a reminder to you that the file needs to be committed. M file The file is modified in your working directory. `M' can indicate one of two states for a file you're working on: either there were no modifications to the same file in the repository, so that your file remains as you last saw it; or there were modifications in the repository as well as in your copy, but they were merged suc- cessfully, without conflict, in your working directory.

Status of file C file A conflict was detected while trying to merge your changes to file with changes from the source repository. file (the copy in your work ing directory) is now the result of merging the two versions; an unmodified copy of your file is also in your working directory, with the name `.#file.version', where version is the revision that your modified file started from. (Note that some systems automatically purge files that begin with `.#' if they have not been accessed for a few days. If you intend to keep a copy of your original file, it is a very good idea to rename it.)

Status of file ? file file is in your working directory, but does not correspond to anything in the source repository, and is not in the list of files for cvs to ignore (see the description of the -I option).

Committing • The commit command sends modifications to the repository. If you don't name any files, a commit will send all changes to the repository; otherwise, you can pass the names of one or more files to be committed (other files would be ignored, in that case).

Usage: cvs commit [-nRlf] [-m msg | -F logfile] [-r rev] files... -n Do not run the module program (if any). -R Process directories recursively. -l Local directory only (not recursive). -f Force the file to be committed; disables recursion. -F file Read the log message from file. -m msg Log message. -r rev Commit to this branch or trunk revision.

Detecting And Resolving Conflicts • Detecting a conflict is easy enough. When you run update, CVS tells you, in no uncertain terms, that there's a conflict.

Finding Out Who Did What (Browsing Log Messages) Usage: cvs log [-lRhtNb] [-r[revisions]] [-d dates] [-s states] [-w[logins]] [files...] -l Local directory only, no recursion. -R Only print name of RCS file. -h Only print header. -t Only print header and descriptive text. -N Do not list tags. -b Only list revisions on the default branch. -r[revisions] Specify revision(s)s to list. -d dates Specify dates (D1<D2 for range, D for latest before). -s states Only list revisions with specified states. -w[logins] Only list revisions checked in by specified logins.

Examining And Reverting Changes Usage: cvs diff [-lNR] [rcsdiff-options] [[-r rev1 | -D date1] [-r rev2 | -D date2]] [files...] -l Local directory only, not recursive -R Process directories recursively. -D d1 Diff revision for date against working file. -D d2 Diff rev1/date1 against date2. -N include diffs for added and removed files. -r rev1 Diff revision for rev1 against working file. -r rev2 Diff rev1/date1 against rev2. --ifdef=arg Output diffs in ifdef format.

Adding File Usage: cvs add [-k rcs-kflag] [-m message] files... -k Use "rcs-kflag" to add the file with the specified kflag. -m Use "message" for the creation log.

Adding Files • Adding a file is a two-step process: First you run the add command on it, then commit.

Adding Directories • Unlike adding a file, adding a new directory is done in one step

CVS And Binary Files • All the files we've been working with until now have been plain text files. CVS has some special tricks for text files. For example, when it's working between a Unix repository and a Windows or Macintosh working copy, it converts file line endings appropriately for each platform. For example, Unix convention is to use a linefeed (LF) only, whereas Windows expects a carriage return/linefeed (CRLF) sequence at the end of each line. Thus, the files in a working copy on a Windows machine will have CRLF endings, but a working copy of the same project on a Unix machine will have LF endings (the repository itself is always stored in LF format).

CVS And Binary Files • Another trick is that CVS detects special strings, known as RCS keyword strings, in text files and replaces them with revision information and other useful things. cvs add –kb file

Removing Files • “cvs remove” or “cvs rm” Usage: cvs remove [-flR] [files...] -f Delete the file before removing it. -l Process this directory only (not recursive). -R Process directories recursively.

Removing Directories • CVS doesn't really keep directories under version control. Instead, as a kind of cheap substitute, it offers certain odd behaviors that in most cases do the "right thing". One of these odd behaviors is that empty directories can be treated specially.

Renaming Files And Directories • Remove the old files, and add the new ones. • Renaming directories is not done very differently: create the new directory, cvs add it, move all the files from the old directory to the new one, cvs remove them from the old directory, cvs add them in the new one, cvs commit so everything takes effect, and then do cvs update -P to make the now- empty directory disappear from the working copy. That is to say:

Getting Snapshots (Dates And Tagging) • Let's return to the example of the program that's in a broken state when a bug report comes in. The developer suddenly needs access to the entire project as it was at the time of the last release, even though many files may have been changed since then, and each file's revision number differs from the others. It would be far too time- consuming to look over the log messages, figure out what each file's individual revision number was at the time of release, and then run update (specifying a revision number with -r) on each one of them. In medium- to large-sized projects (tens to hundreds of files), such a process would be too unwieldy to attempt.

Acceptable Date Formats $ cvs update -D "19 Apr 1999" $ cvs update -D "19 Apr :05" $ cvs update -D "19/04/1999" $ cvs update -D "3 days ago“ $ cvs update -D "5 years ago“ $ cvs update -D "19 Apr :59:59 GMT“ $ cvs update -D "19 Apr"

Marking A Moment In Time (Tags) • Retrieving by date is useful when the mere passage of time is your main concern. But more often what you really want to do is retrieve the project as it was at the time of a specific event - perhaps a public release, a known stable point in the software's development, or the addition or removal of some major feature.

• Trying to remember the date when that event took place or deducing the date from log messages would be a tedious process. Presumably, the event, because it was important, was marked as such in the formal revision history. The method CVS offers for making such marks is known as tagging.

• Tags differ from commits in that they don't record any particular textual change to files, but rather a change in the developers' attitude about the files. A tag gives a label to the collection of revisions represented by one developer's working copy (usually, that working copy is completely up to date so the tag name is attached to the "latest and greatest" revisions in the repository).

Branching Basics

Creating A Tag Or Branch Without A Working Copy Usage: cvs rtag [-aflRnF] [-b] [-d] [-r rev|-D date] tag modules... -a Clear tag from removed files that would not otherwise be tagged. -f Force a head revision match if tag/date not found. -l Local directory only, not recursive -R Process directories recursively. -n No execution of 'tag program' -d Delete the given Tag. -b Make the tag a "branch" tag, allowing concurrent development. -r rev Existing revision/tag. -D Existing date. -F Move tag if it already exists

Creating A Tag Or Branch Without A Working Copy • There is such a way: the rtag command (for "repository tag"). It's very similar to tag; a couple of examples will explain its usage. Let's go back to the moment when the first bug report came in and we needed to create a branch rooted at the last public release.

Annotations - A Detailed View Of Project Activity • If the history command gives an overview of project activity, the annotate command is a way of attaching a zoom lens to the view.

The Fast Method Of Reverting • The fast, fancy way of reverting is to use the -j (for "join") flag to the update command. This flag is like -r in that it takes a revision number, and you can use up to two -j's at once. CVS calculates the difference between the two named revisions and applies that difference as a patch to the file in question (so the order in which you give the revisions is important).

Tips •.cvsignore