Proposal: backup hook, trash, and multiple undo

Greg Ward greg-hg at gerg.ca
Mon Jun 7 19:57:26 CDT 2010


On Mon, Jun 7, 2010 at 10:23 AM, Matt Mackall <mpm at selenic.com> wrote:
> Jens' mention of the OS X trash can got me thinking about how we'd
> implement such a thing, and here's what I came up with:
>
> Backup hook:
>
> A standard hook called "backup" that gets called whenever a destructive
> operation gets called. It operates in a couple different modes:
>
> type=file
> operation=rm|update|merge|revert|qdelete|...
> path=/path/to/file/being/clobbered

What's the common thread here? hg is deleting any file, or deleting a
file in the working copy, or deleting a file that isn't already saved
in a changeset somewhere?  I have a hard time seeing "hg merge" and
"hg qdelete" being equally destructive: the only time "hg merge" can
irreversibly discard data is if you run it with -f.  (Right?)  But
qdelete is irreversible by default -- much more dangerous.

Greg


More information about the Mercurial-devel mailing list