tags:

views:

215

answers:

3

How can I remove all unversioned files from a Bazaar workspace? I'm looking to do the equivalent of hg purge --all or git clean -fd.

+5  A: 

I've seen this only in BzrTools -- http://wiki.bazaar.canonical.com/BzrTools, as the cleen-tree command.

Kornel Kisielewicz
It was installed by default in a virgin copy of Bazaar 2.0, so its functionality has apparently been merged. That said, I'm disappointed that "bzr help" didn't show that command, or anything about it.
Benjamin Pollack
Actually command named `clean-tree.` If you have `bzrtools` plugin installed you'll see this command in the output of `bzr help commands`. To check is you have `bzrtools` plugin installed run `bzr plugins` command.
bialix
According to `bzr plugins`, I do not have `bzrtools` installed; just `netrc_credential_store` and `launchpad`. According to `bzr help`, I have no `clean-tree` command. Yet `bzr help clean-tree` shows me the help for `clean-tree`, and executing `bzr clean-tree` works just fine. So, while I'm happy, the above information is either out-of-date or confused, as near as I can tell.
Benjamin Pollack
+3  A: 

Benjamin Pollack said:

According to bzr help, I have no clean-tree command. Yet bzr help clean-tree shows me the help for clean-tree, and executing bzr clean-tree works just fine.

bzr help only shows a summary of the most commonly used commands. To see all available commands, use bzr help commands.

(Sorry to answer instead of comment ... I don't have sufficient reputation yet)

Adam Glauser
A: 

I wrote a bash one liner for this:

rm -i $(bzr status -S | grep "^?" | cut -d ? -f 2- )

Taurus Olson