[PATCH] shelve: always backup shelves instead of deleting them

Durham Goode durham at fb.com
Wed Jun 24 22:54:00 UTC 2015



On 6/24/15, 3:47 PM, "Pierre-Yves David" <pierre-yves.david at ens-lyon.org>
wrote:

>
>
>On 06/24/2015 12:16 PM, Colin Chan wrote:
>> # HG changeset patch
>> # User Colin Chan <colinchan at fb.com>
>> # Date 1434989752 25200
>> #      Mon Jun 22 09:15:52 2015 -0700
>> # Node ID 7a02a3b3941cb62203b6efc145e58c543e8b8909
>> # Parent  7fdd1782fc4ee9da87d8af13e806dc9055db2c38
>> shelve: always backup shelves instead of deleting them
>>
>> Instead of being deleted, shelve files are now moved into the
>> .hg/shelve-backup directory. This is designed to be very similar to how
>>strip
>> saves backpus into .ht/strip-backup. The goal is to prevent data loss
>>especially
>> when using unshelve (e.g., http://bz.selenic.com/show_bug.cgi?id=4732)
>>at the
>> expense of using more disk space over time.
>
>This changes seems strange to me, We should never delete a shelve until
>the whole unshelving process is done. It seems to be the current intend
>of the code, if it happen to currently not be the case, it should be
>easy to fix.

We have had users do dumb things, where they do an unshelve, then get
confused (or mercurial does something weird and unexpected) and they
unintentionally overwrite their working copy.  Shelve gives us an
opportunity to store a checkpoint of their work permanently, so I think we
should do this.

>
>Especially, this change seems unrelated to issue4732 and I fail to see
>how it improve the situation three

This is related because it would have prevented data loss.  It would also
prevent data loss in all the other bizarre shelve/unshelve bugs that
exists that maybe we don't know about.  Sure we could fix shelve, and we
should, but that's a lot more effort, and at least this patch will save
some user tears in the mean time.




More information about the Mercurial-devel mailing list