D6479: unshelve: first prototype of restoring unresolved changes

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue Jun 11 14:06:44 EDT 2019


pulkit added a comment.


  Can you fold both the commits, it will be better to see code for both storing and restoring mergestates in one patch.

INLINE COMMENTS

> shelve.py:726
> +    p1, p2 = shelvectx.parents()
> +    with repo.dirstate.parentchange():
> +            repo.dirstate.setparents(p1.node(), p2.node())

Let's move this parent changing of dirstate out of this function. This functions should only have logic related to storing and restoring unresolved states.

> shelve.py:1061
>          repo, shelvectx = _unshelverestorecommit(ui, repo, tr, basename)
> +        unresolvedshelve = shelvectx.extra().get('unresolved-merge')
>          _checkunshelveuntrackedproblems(ui, repo, shelvectx)

let's have `shelvectx` an optional argument to `_isunresolvedshelve()`. If `shelvectx` is passed we use that, otherwise we fallback to checking the directory in merge-unresolved/.

And then use that function here.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6479/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6479

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel


More information about the Mercurial-devel mailing list