[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bitkeeper-users
Subject:    Re: [Bitkeeper-users] Reverting a BitKeeper move/delete operation before commit?
From:       Larry McVoy <lm () bitmover ! com>
Date:       2002-08-15 14:59:19
[Download RAW message or body]

On Wed, Aug 14, 2002 at 11:43:00PM -0600, Joshua Jensen wrote:
> If I don't like what I see, then:
> 
> p4 revert ...
> 
> Reverts everything in the changelist back to its original state.

    bk clone bk://server/project my_project
    cd my_project
    hack, hack
    bk mvdir ...
    bk mv ...
    hack, hack
    # Decide at this point you don't like any of this work
    cd ..
    rm -rf my_project
    bk clone bk://server/project my_project
    ...

In other words, until you've done a "bk push" ALL of the activity has
been local to your repository and it has made no changes in the server.
The model is different than Perforce, you are making changes against your
local revision history, not the server revision history.  This means
that you have to do an extra step, push, to move the changes from you
to the server (or anywhere else).  It also means you can just toss the
repository if you don't want those changes.

As with perl, there is more than one way to do it.  Here's another way:
when you clone a repository, it only clones "committed" work.  All the bk
mv/bk mvdir/bm ci/bk delta commands create "deltas" to individual files.
They are not made into a "changeset" until you "bk commit" which is a
process of binding all those deltas together into a logical unit of work.
This means you can, if you want, make several deltas to a file before you
make a changeset.  This is different than perforce - perforce provides
only the last step, the "check everything in".  

The reason I'm dragging you through all this technical detail is so
you get the idea that there are two levels of "checkin": deltas and
changesets.  Here's the useful information: changesets are the only thing
which propogate between repositories on a pull/push/clone.  You can have
as many deltas as you want in a repository but if you haven't created
a changeset, they are all work in progress and other people can't pull
them out of your tree.

All that means that the other way to do what you want is this:

	bk clone -l my_project revert
	rm -rf my_project
	mv revert my_project

The -l option only works on Unix file systems, it does hard links instead
of actually copying the files so it is faster and uses less space.

Cheers,
-- 
---
Larry McVoy            	 lm at bitmover.com           http://www.bitmover.com/lm 
_______________________________________________
Bitkeeper-users mailing list
Bitkeeper-users@bitmover.com
http://bitmover.com/mailman/listinfo/bitkeeper-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic