[MERGE] add shelve --destroy

Aaron Bentley aaron at aaronbentley.com
Thu Mar 12 04:56:35 GMT 2009


James Westby wrote:
> On Thu, 2009-03-12 at 11:26 +1000, Aaron Bentley wrote:
>> This patch adds the option of destructive shelving, by doing shelve
>> - --destroy.
> 
> What do you think about making this "revert --interactive"?

That sort of change needs to be done carefully, because there are
differences between 'revert' and 'shelve --all'.  Shelve deletes added
files but revert just unversions them, and revert creates backups of
modified files but shelve doesn't.

This was a much more direct approach.

> I realise it
> would be more plumbing, but to me it is closer to the meaning, and
> moving it to "revert" would make it clearer that changes were being
> destroyed?

Revert is actually less destructive than shelve --destroy, so I think
the association might not be productive.

> 
>> +                    if self.destroy:
>> +                        creator.transform()
>> +                    else:
>> +                        shelf_id =
>> self.manager.shelve_changes(creator,
>> +
>> self.message)
>> +                        trace.note('Changes shelved with id "%d".' %
>> shelf_id)
> 
> Should there be a trace.note on the destroy case as well?

Yes.  I'll add "Changes destroyed." for now.

>>                  if (self.auto_apply or self.prompt_bool(
>>                      'Shelve %d change(s)?' % changes_shelved)):
> 
> Should the messages be changed for --destroy? I would say yes if it
> was "revert --interactive", here I'm not so sure, "Destroy %d change(s)"
> would be pretty clear I think.

I'd rather not get too bent out of shape for the uncommon case.

Aaron



More information about the bazaar mailing list