This is an archive of the discontinued Mercurial Phabricator instance.

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

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

Details

Reviewers
martinvonz
baymax
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

Event Timeline

Gentle ping for review.

yuja added a subscriber: yuja.Mar 25 2019, 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.

Waht'a sup on this. Seems to be open for a long while.

baymax requested changes to this revision.Apr 28 2020, 4:18 AM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.

:baymax:need-review-idle:

This revision now requires changes to proceed.Apr 28 2020, 4:18 AM