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.
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG5162753c4c14: unshelve: add interactive mode
rHG62953fd58404: unshelve: add interactive mode
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Didn't look at the actual implementation yet.
mercurial/shelve.py | ||
---|---|---|
990 | The interactive flag should work the same way as it work for revert, commit and shelve commands. That's either ask hunk by hunk or pop up a curses UI. As you suggested before, maybe we can have -f flag to specify files to unshelve. | |
tests/test-shelve.t | ||
1204 | add a comment here specifying that shelve should not contain c now. |
mercurial/shelve.py | ||
---|---|---|
990 | will fix this in the next-to-next revision. |
mercurial/shelve.py | ||
---|---|---|
990 | To have this patch in a good state to be reviewed, it will be nice you take out the addition of interactive flag to the patch where you add that functionality. |
mercurial/shelve.py | ||
---|---|---|
990 | Updated the patch by replacing the --interactive flag with --files. |
mercurial/shelve.py | ||
---|---|---|
842 | We can do filtering of files to unshelve here. Before this repo.commit we have all the changes, we first commit which are needed to be unshelve, then create a shelve of rest of the changes. |
It will be nice to add information to commit message about how thing unshelving of a subset works.
mercurial/shelve.py | ||
---|---|---|
1013–1014 | Can you explain why we are not processing this if files are present? |
mercurial/shelve.py | ||
---|---|---|
1013–1014 | okay. on unshelving with --files flag, we don't want to clear the shelvedstate unless all the files in the shelvectx is same as the files which are requested by the user. on unshelving without --files flag, we can clear the shelvedstate right away. that's why i have used this condition. |
mercurial/commands.py | ||
---|---|---|
6162 | Can you mark this as EXPERIMENTAL because right now we rebases the whole commit, which leads to conflicts in files which the user might not want to unshelve. | |
tests/test-shelve.t | ||
1351 | We should store information about --interacive in shelve state, which will help us to prevent passing -i here again. |
mercurial/commands.py | ||
---|---|---|
6162 | Doing that right away! Will solve this issue later. | |
tests/test-shelve.t | ||
1351 | We only pass -i if we want to do the unshelve interactively again. It's not mandatory to do that. After an interactive shelve, the stored remaining shelve is same as a normal shelve. We can unshelve it without the -i. So, I don't think we have to do that. |
tests/test-shelve.t | ||
---|---|---|
1351 | Looking at the test case: User wants to interactively unshelve, runs hg unshelve -i. They hit conflicts, resolve conflicts, and then run hg unshelve --continue. Here, user intended to do an interactive unshelve, and having conflicts should not change what user wanted. Also this is similar to other commands. We preserve the flags which user passed and follow them when the operation is continued. |
For record: I left more comments about this patch. Mistakenly I did them on the phabricator commit instead of this review. https://phab.mercurial-scm.org/rHG5162753c4c14c143e6be011b89d6567b5ef50d66#51172
Can you mark this as EXPERIMENTAL because right now we rebases the whole commit, which leads to conflicts in files which the user might not want to unshelve.