[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cvs update

From: Pierre Asselin
Subject: Re: cvs update
Date: Sat, 25 Feb 2006 17:22:43 +0000 (UTC)
User-agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (NetBSD/2.0.3 (i386))

Martin J?rgensen <address@hidden> wrote:

> I've been using cvs for a couple of months but mostly I used tortoisecvs 
> so I didn't understood what happened "behind the interface". Now I want 
> to learn some of the command line parameters and discovered that if I 
> type "cvs update" then cvs doesn't necessarily get changes from the 
> repository and overwrites my files in the current directory...

Yes it does.  "cvs update" pulls in the changes committed by others
while you weren't looking and folds them into your local copies.

If no changes have been committed since you last updated, nothing
happens.  Your modified files (red icons) still show up as modified
and your unmodified (green icons) files still show up as unmodified.

If others have committed changes to files you were *not* working
on, those changes are pulled in trivially.  The icons that were
green stay green, but you now have the newer versions and the
revision number displayed in Windows Explorer (if so configured)
are the newer numbers.  I don't remember if that leaves a backup
of your previous copy or not.

If others have committed changes to a file you modified (red), the
update performs a three-way merge to reconcile both sets of changes.
Because the automated merge is not fool-proof, the command leaves
backups of your original copy and of the repository version.

> Instead it sometimes makes a new revision and stores the old file in a 
> filename (something like "blabla#1.3#", it then apparantly adds a new 
> file revision to the repository - I can't exactly remember the 
> filename).

This makes no sense.  Probably you are using words incorrectly so
let's get this straight.

1)  The "repository" is where the cvs server holds the revisions
    you and others have committed.  An update *never* adds a new
    revision to the repository.

2)  Your own files are the "working copy" or "local copy" or
    sometimes "sandbox".  The update does modify your files,
    in fact the *purpose* of update is to modify your files.

3)  The "blabla#1.3#" probably means that you did a nontrivial
    three-way merge.  I don't remember the backup names used
    on Windows, but I think "blabla#1.3#" is the repository
    version (with changes by others and not by you) and some
    other backup file has your changes only.  The "blabla"
    has both sets of changes, possibly with conflict markers
    where the merge failed.

> I don't want this behaviour.
> I mostly just want cvs to overwrite all local files if I didn't commit 
> the changes...  How to avoid this "blabla#1.3#" revision stuff?

So you want to throw away your changes and start over from the same
revision *without* pulling in any changes made by others ?  Here
is how to do it from the command line.

    C:> cvs status blabla
    --- reports that you started from revision 1.3, say
    C:> cvs update -p -r1.3 blabla > blabla

The "-p" is important and so is the "-r1.3".  This update
command would just print the contents in your command window,
so you have to use output redirection ("> blabla") to save
the result in your file.

Your file's icon may turn red in Windows Explorer (not sure) because
the timestamp is newer than the checkout time recorded in CVS/Entries,
but if you do a diff you will see that there are no differences.

    By reverting to revision 1.3 instead accepting whatever
    newer version 1.x is in the repository you are doing yourself
    a disservice.  You simplify your life in the short term by
    not having to deal with modifications by others, but you
    are only delaying the invevitable.  Sooner or later you
    will have to reconcile your changes (to all files) with
    the newer blabla 1.x .  Cvs encourages teamwork.

It's also easier to pull in the newest release when you discard
your uncommitted changes.  From the command line, just remove the
file and do a plain update.  From the Tortoise GUI, right-click
the red file, pick "CVS" / "Update Special" and select "clean copy".

If you want to discard uncommitted changes for *all* files it's
even simpler.  Wipe out your entire local tree and check out a new
one from scratch.

> Yesterday 
> I deleted this "#1.3#" file and when I wanted to commit some changes, it 
> complained about missing this file...

I don't understand what you are saying.  The "#1.3#" file is just
a backup for your private enjoyment and cvs shouldn't miss it.
Can you paste the exact error message the next time it happens ?

pa at panix dot com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]