Mercurial > hg
comparison mercurial/templatekw.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 | 59ad165f6cdb |
children | 85b03b1e4715 |
comparison
equal
deleted
inserted
replaced
44855:1d2d353e5c4a | 44856:b7808443ed6a |
---|---|
417 if ctx.node() in wpnodes: | 417 if ctx.node() in wpnodes: |
418 return b'@' | 418 return b'@' |
419 else: | 419 else: |
420 merge_nodes = cache.get(b'merge_nodes') | 420 merge_nodes = cache.get(b'merge_nodes') |
421 if merge_nodes is None: | 421 if merge_nodes is None: |
422 from . import merge | 422 from . import mergestate as mergestatemod |
423 | 423 |
424 mergestate = merge.mergestate.read(repo) | 424 mergestate = mergestatemod.mergestate.read(repo) |
425 if mergestate.active(): | 425 if mergestate.active(): |
426 merge_nodes = (mergestate.local, mergestate.other) | 426 merge_nodes = (mergestate.local, mergestate.other) |
427 else: | 427 else: |
428 merge_nodes = () | 428 merge_nodes = () |
429 cache[b'merge_nodes'] = merge_nodes | 429 cache[b'merge_nodes'] = merge_nodes |