mq: make unshelve to apply on modified mq patch (issue4318)
Needs ReviewPublic

Authored by navaneeth.suresh on Feb 26 2019, 7:24 AM.

Details

Reviewers
martinvonz
Group Reviewers
hg-reviewers
Summary

unshelve wasn't working on a modified mq patch. I added checks for
not aborting on a modified mq patch in both rebase and mq.

Checking repo.vfs.exists('unshelverebasestate') works in rebase,
not in mq. I used cmdutil.unfinishedstates to find shelvedstate
in mq.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Gentle ping for review.

yuja added a subscriber: yuja.Mon, Mar 25, 6:29 PM
    • a/hgext/mq.py +++ b/hgext/mq.py @@ -3518,7 +3518,10 @@ delattr(self.unfiltered(), r'mq')

      def abortifwdirpatched(self, errmsg, force=False):
  • if self.mq.applied and self.mq.checkapplied and not force: + shelveinprogress = any('shelvedstate' in state + for state in cmdutil.unfinishedstates) + if (self.mq.applied and self.mq.checkapplied and not force and + not shelveinprogress):

It doesn't make sense to check the existence of 'shelvedstate' in a static
table.

Can't we somehow get around the mq in a similar way to shelve.getcommitfunc()?
I don't think it's good idea to rely on state files saved on disk.

It doesn't make sense to check the existence of 'shelvedstate' in a static
table.

Can't we somehow get around the mq in a similar way to shelve.getcommitfunc()?
I don't think it's good idea to rely on state files saved on disk.

I felt that the only workaround to stop aborting unshelve on a modified mq patch should be adding a check on mq.abortifwdirpatched(). Will try to investigate in shelve.getcommitfunc() for sure. Thanks.