Conflict while using "bzr pull"

John Arbash Meinel john at arbash-meinel.com
Mon Dec 12 13:46:20 GMT 2005


Jamie Wilkinson wrote:
...
> 
> I've seen this twice, at least, on my laptop and workstation; in both cases
> I assumed it was my fault, and fixed by doing something like:
> 
> bzr branch bzr.dev bzr.newdev
> cd bzr.newdev
> bzr pull http://.../bzr.dev
> cd ..
> mv bzr.dev bzr.olddev
> mv bzr.newdev bzr.dev
> 
> and then after that the bzr.dev directory had a clean status report.
> 
> I also didn't keep the pre-images around :(

Well, actually, you don't have to do a multi-directory song and dance.
In truth, the easiest way to fix everything is to do:
mv bzr.dev bzr.olddev
mkdir bzr.dev
mv bzr.olddev/.bzr bzr.dev/
cd bzr.dev
bzr revert

Basically, by deleting all working tree files, the final "bzr revert"
will just pull out an exact copy of the last committed revision, without
having to worry about what state your current tree is in.

With 'bzr revert' there are 2 things that can trip it up:
1) having a bzr-tree-change directory. This is where merge/pull/revert
do their magic, so if it exists, that means you had a failed action. And
there may be files in there which don't exist anywhere else so it is
unsafe to delete it automatically. (I think adding a --force would be a
decent option).
2) unknown/ignored files will not be touched. (But bzrtools' clean-tree
will get rid of them).

So what *should* always get you back to a pristine tree is:

cd $wd
rm -rf bzr-tree-change
bzr revert
bzr clean-tree --ignored

In practise, I usually do:
cd $wd
bzr revert
# oops bzr-tree-change is still there
rm -rf bzr-tree-change
bzr revert
bzr clean-tree --ignored


What do people think, should we have a "bzr revert --force", or maybe a
"bzr revert --everything". I think it would be nice to have a single
command which says, "I know things are messed up right now, get me back
to exactly FOO, so I can continue with my life".
I know one of the big complaints with "tla undo" is that it could easily
get confused by duplicate ids, or all sorts of things. So that when
things broke, you lost the tool to get you back to sanity. I believe
"bzr revert" is much harder to break, but there still are edge cases
where it won't do what you need.

To make it obviously dangerous, maybe have the command be "bzr nuke",
which will delete the working tree for you, and pull out a new one. But
nuke might be reserved for other commands. (destroy a revision, and try
to destroy it in any mirrors that you know about).

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051212/20f273f1/attachment.pgp 


More information about the bazaar mailing list