This is an archive of the discontinued Mercurial Phabricator instance.

unshelve: clear shelvedstate and _finishunshelve() on partial unshelve
ClosedPublic

Authored by navaneeth.suresh on Aug 2 2019, 4:17 AM.

Details

Summary

On a partial unshelve, shelvedstate was not cleared and _finishunshelve()
was not called. Ideally, these should be called on this case. This patch makes
shelvedstate to delete after a successful partial unshelve and calls
_finishunshelve() in the same case.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit added a subscriber: pulkit.Aug 6 2019, 7:18 AM
pulkit added inline comments.
mercurial/shelve.py
1008

IIUC, we don't need _forgetunknownfiles() too in this if statement. Can you add some related tests and see if we need this as a followup?

pulkit accepted this revision.Aug 6 2019, 7:19 AM
This revision is now accepted and ready to land.Aug 6 2019, 7:19 AM

Sorry for not noticing this before, but this patch needs tests.

mercurial/shelve.py
1008

sure, will investigate on that.

pulkit added a comment.Aug 6 2019, 1:11 PM

Applied the following diff in flight which was result of test output changes.

--- /home/pulkit/repo/paccess/tests/test-shelve.t
+++ /home/pulkit/repo/paccess/tests/test-shelve.t
@@ -1365,19 +1365,19 @@
 
 #if stripbased
   $ hg log -r 3:: -G
-  @  changeset:   5:506510493902
+  @  changeset:   5:f1d5f53e397b
   |  tag:         tip
-  |  parent:      3:adfeba9a1ac4
+  |  parent:      3:e28fd7fa7938
   |  user:        shelve@localhost
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     changes to: add A to bars
   |
-  | @  changeset:   4:8b023952e29c
+  | @  changeset:   4:fe451a778c81
   |/   user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
   |    summary:     add C to bars
   |
-  o  changeset:   3:adfeba9a1ac4
+  o  changeset:   3:e28fd7fa7938
   |  user:        test
   ~  date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add A to bars
@@ -1418,13 +1418,13 @@
 
 #if stripbased
   $ hg log -r 3:: -G
-  @  changeset:   4:8b023952e29c
+  @  changeset:   4:fe451a778c81
   |  tag:         tip
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     add C to bars
   |
-  o  changeset:   3:adfeba9a1ac4
+  o  changeset:   3:e28fd7fa7938
   |  user:        test
   ~  date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add A to bars