Behavior of 'rm' and 'mv' under bazaar
Scott Aubrey
scottaubrey at capuk.org
Wed Sep 29 15:27:16 BST 2010
forgot the list, sorry tom for double emails.
Hi Tom
On 29 Sep 2010, at 15:04, Tom Browder wrote:
> I am a newbie to bazaar and so far I like it very much (I am coming
> from some years of subversion use).
>
> There is one thing I have a hard time getting used to, and maybe it's
> because I don't know how to use it yet: using "rm" or "mv" (not a bzr
> command) on a versioned file removes it and bzr update does not
> restore it (I have to bzr revert it).
>
> I assume that's an intentional feature but it seems very intrusive to
> me--I much prefer svn's method.
I wouldn't count on it. Subversion's meaning behind the update command is slightly different from Bazaar's.
Firstly: in Subversion, they allow files in a working tree to be at different revisions, only requiring an update when the server version has changed and you're trying to commit your own change on an old version.
Bazaar requires the whole working tree to be at the same revision, so any individual file is never out of date.
With that in mind, "svn update" will update a given file to the latest (or otherwise) version of a file, "bzr update" only updates the Working Tree's revision, merging any changes you made to the old revision throughout the whole working tree with the new revision. If you're already on the latest revision and run "update", bazaar will say it's already at the latest revision and do nothing.
So the effect is: The command is not going to revert your deleted file, as the removed file is something you have changed (you deleted it, not bazaar), and it will merge that change into whatever updated revision is. "bzr revert", however, reverts your changes, and restores the file.
Where Bazaar may be confusing is that it allows you to run "bzr update [dir]" where [dir] is any point an a working tree. This will still only update the whole working tree, but it looks like you can update a file or a directory. Maybe a warning or some such thing should be given if [dir] isn't pointing to the root of a working tree?
Hope that's understandable for you Tom.
- Scott
>
> Any chance of that ever changing?
>
> Thanks.
>
> -Tom
>
> Thomas M. Browder, Jr.
> Niceville, Florida
> USA
>
More information about the bazaar
mailing list