Behavior of 'rm' and 'mv' under bazaar

Ben Finney ben+bazaar at benfinney.id.au
Thu Sep 30 02:09:04 BST 2010


Tom Browder <tom.browder at gmail.com> writes:

> I am a newbie to bazaar and so far I like it very much (I am coming
> from some years of subversion use).

Welcome to the Bazaar community, and congratulations on embracing modern
tools.

> 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).

That's right. An OS-level ‘rm’ or ‘mv’ is just another change Bazaar
will track; if you ‘bzr status’ then you'll see Bazaar notices when
files aren't there any more, and will record that fact when you commit.

> I assume that's an intentional feature but it seems very intrusive to
> me--I much prefer svn's method.

You might be aware of ‘bzr mv’ and ‘bzr rm’, which will explicitly tell
Bazaar about the fate of the file. You can either have Bazaar do the
actual change on the filesystem, or you can tell Bazaar about it after
the fact; see ‘bzr help mv’ and ‘bzr help rm’ for more.

> Any chance of that ever changing?

If you mean “will the default change”: It has done so, with refinements
in less and less common cases. The general default is unlikely to
change.

If you mean “can I get better control over that”: see the help for the
Bazaar commands as above, and also ‘bzr help alias’.

-- 
 \      “Not using Microsoft products is like being a non-smoker 40 or |
  `\     50 years ago: You can choose not to smoke, yourself, but it's |
_o__)               hard to avoid second-hand smoke.” —Michael Tiemann |
Ben Finney




More information about the bazaar mailing list