bzr-undelete

Parth Malwankar parth.malwankar at gmail.com
Mon Feb 23 04:00:17 GMT 2009


On Mon, Feb 23, 2009 at 4:12 AM, Martin Pool <mbp at sourcefrog.net> wrote:
> 2009/2/21 Stefan Monnier <monnier at iro.umontreal.ca>:
>>> I have created a bzr-undelete plugin[1] that tries the last:N
>>> revisions of the branch to undelete the specified file(s)/dir(s).
>>
>> OMG, this is wonderful!
>> Can we have it "in core"?
>
> Where should it live, 'bzr revert --undelete', or 'bzr undelete'?  The
> second is more discoverable but if we create too many top-level
> commands they all become harder to find...
>

I spent some time adding the "--find regex" option to undelete
to cater to the use case that a user might not remember what
the exact name of the file was. This option is basically searches
the last N revision and prints the matching names.This is a
simple solution to #136942. See [1] for sample usage. Its quite
simple and general right now and I would be happy to look
into any suggestions for improvement for this option that
might come up here.
This might be quite slow when the number of files is large
as its a simple linear search through last N revs.

Regarding the integration with bzr core. 'bzr revert --undelete'
sounds fine to me. However I do feel that it may be good
to have a search name in history by regex feature which
specifically may be needed before issuing an undelete
command. If we go with with 'revert --undelete' we could
considering adding a 'ls --find' or similar flag.

Alternatively if a need for --find hasn't come up in a
context in other than undelete we could consider keeping
it under a separate undelete command. There is also the
--last option. We could combine that with --undelete N
instead of a separate --last N if we go with adding the
--undelete option to revert.

I suppose I am divided between the
'revert --undelete'  and 'undelete' approach as where
the various options fit in still needs to be worked out.
Both approaches have their merits.

Parth
[1] https://bugs.launchpad.net/bzr/+bug/136942/comments/2

> --
> Martin <http://launchpad.net/~mbp/>
>
>



More information about the bazaar mailing list