Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 44856:b7808443ed6a
mergestate: split out merge state handling code from main merge module
There's already some pretty reasonable encapsulation here, but I want
to make the mergestate storage a property of the context so memctx
instances can do a reasonable thing. This is the first step in a
reshuffle to make that easier.
Differential Revision: https://phab.mercurial-scm.org/D8550
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 18 May 2020 14:59:59 -0400 |
parents | 637eb7f7559b |
children | 9b9071fabcd3 |
comparison
equal
deleted
inserted
replaced
44855:1d2d353e5c4a | 44856:b7808443ed6a |
---|---|
787 """The local side of the merge, if currently in an unresolved merge. | 787 """The local side of the merge, if currently in an unresolved merge. |
788 | 788 |
789 "merge" here includes merge conflicts from e.g. 'hg rebase' or 'hg graft'. | 789 "merge" here includes merge conflicts from e.g. 'hg rebase' or 'hg graft'. |
790 """ | 790 """ |
791 getargs(x, 0, 0, _(b"conflictlocal takes no arguments")) | 791 getargs(x, 0, 0, _(b"conflictlocal takes no arguments")) |
792 from . import merge | 792 from . import mergestate as mergestatemod |
793 | 793 |
794 mergestate = merge.mergestate.read(repo) | 794 mergestate = mergestatemod.mergestate.read(repo) |
795 if mergestate.active() and repo.changelog.hasnode(mergestate.local): | 795 if mergestate.active() and repo.changelog.hasnode(mergestate.local): |
796 return subset & {repo.changelog.rev(mergestate.local)} | 796 return subset & {repo.changelog.rev(mergestate.local)} |
797 | 797 |
798 return baseset() | 798 return baseset() |
799 | 799 |
803 """The other side of the merge, if currently in an unresolved merge. | 803 """The other side of the merge, if currently in an unresolved merge. |
804 | 804 |
805 "merge" here includes merge conflicts from e.g. 'hg rebase' or 'hg graft'. | 805 "merge" here includes merge conflicts from e.g. 'hg rebase' or 'hg graft'. |
806 """ | 806 """ |
807 getargs(x, 0, 0, _(b"conflictother takes no arguments")) | 807 getargs(x, 0, 0, _(b"conflictother takes no arguments")) |
808 from . import merge | 808 from . import mergestate as mergestatemod |
809 | 809 |
810 mergestate = merge.mergestate.read(repo) | 810 mergestate = mergestatemod.mergestate.read(repo) |
811 if mergestate.active() and repo.changelog.hasnode(mergestate.other): | 811 if mergestate.active() and repo.changelog.hasnode(mergestate.other): |
812 return subset & {repo.changelog.rev(mergestate.other)} | 812 return subset & {repo.changelog.rev(mergestate.other)} |
813 | 813 |
814 return baseset() | 814 return baseset() |
815 | 815 |