This is an archive of the discontinued Mercurial Phabricator instance.

unshelve: unify logic around creating an unshelve changeset
ClosedPublic

Authored by navaneeth.suresh on Jul 23 2019, 11:39 PM.

Details

Summary

This is a follow-up patch to 5162753c4c14 on addressing reviews
on the commit. This unifies the logic around creating an unshelve
changeset.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit added a subscriber: pulkit.Jul 24 2019, 4:52 AM

This patch does following things:

  1. unify logic around creating unshelvectx
  2. changes how date is set in iteractive mode
  3. handles stripping in interavtive mode
  4. compute a matcher only if it's required
  5. and a change around making basename madatory argument

Can we have them in separate patches?

navaneeth.suresh retitled this revision from unshelve: fixes on interactive mode to unshelve: unify logic around creating an unshelve changeset.Jul 24 2019, 8:39 AM
navaneeth.suresh edited the summary of this revision. (Show Details)
navaneeth.suresh updated this revision to Diff 16038.
In D6683#97731, @pulkit wrote:

This patch does following things:

  1. unify logic around creating unshelvectx
  2. changes how date is set in iteractive mode
  3. handles stripping in interavtive mode
  4. compute a matcher only if it's required
  5. and a change around making basename madatory argument

Can we have them in separate patches?

Done.

pulkit added inline comments.Jul 26 2019, 10:37 AM
mercurial/shelve.py
812

How about:

Handles creation of unshelve commit and updating the shelve if it was partially unshelved.

If interactive is:

  * false: commit all the changes in working directory.
  * true: prompts user to select changes to unshelve and commit them. Update the shelve with remaining changes.

Returns the node of the new commit formed and a bool indicating whether the shelve was partially unshelved.
mercurial/shelve.py
812

Awesome! Amending that right away.

pulkit accepted this revision.Jul 29 2019, 5:43 AM
This revision is now accepted and ready to land.Jul 29 2019, 5:43 AM