HomePhabricator

unshelve: add interactive mode

Authored by navaneeth.suresh.

Description

unshelve: add interactive mode

Until now, there is no way to unshelve selected changes only from
the stored shelve as given in issue6162. This patch makes unshelve
perform with certain changes only by adding an interactive mode.

Differential Revision: https://phab.mercurial-scm.org/D6596

Details

Committed
navaneeth.sureshJul 2 2019, 8:32 AM
Differential Revision
D6596: unshelve: add interactive mode
Parents
rHG56132ebd14c6: blackbox: disable extremely verbose logging (issue6110)
Branches
Unknown
Tags
Unknown

Event Timeline

pulkit added a subscriber: pulkit.Jul 23 2019, 9:36 AM

I managed to have a look at this patch in depth. I have left some comments.

/mercurial/shelve.py
725

Let's initialize this variable at top with default value as False.

754

We have to call this codepath even in cases of partialunshelve.

810

Can you document return values of this function too.

813

Is this value used anywhere in cmdutil.dorecord? I think no.

823

In case there was partial unshelving, we should update the shelve's date here since it's modified.

824

Let's only compute m if we need it i.e. inside this if condition.

862

This code is very similar to one present in unshelvecontinue. There is possibility to unify this into one function.

865

Same about initializing this variable on the top.

957

This seems incorrect. Here we relying on basename which are getting from line 951 above, which is top most shelve. However, we can be in progress on unshelving a non top-most shelve.

Also, the behavior of --interactive on unshelve --continue should be handled in unshelvecontinue() and not here.

navaneeth.suresh marked 9 inline comments as done.Jul 23 2019, 11:39 PM
navaneeth.suresh added inline comments.
/mercurial/shelve.py
813

Yes. This is used to prevent cmdutil.checkunfinished() on cmdutil.dorecord()

957

We might be needing basename to store the shelved change in case of a partial unshelve. Also, in the case of a non top-mose shelve, line 954 gives a basesname for that. The logic of unshelve --continue on interactive has been modified by D6679. Please refer to that.

navaneeth.suresh marked 2 inline comments as done.Jul 23 2019, 11:40 PM

I managed to have a look at this patch in depth. I have left some comments.

Thanks! D6683 has been created based on your review. Please see.