comparison mercurial/merge.py @ 30362:3c6893ba2d36

merge: change modified indicator to be 20 bytes Previously we indicated that the .hgsubstate file was dirty by adding a '+' to the end of its hash in the wctx manifest. This made is complicated to have new manifest implementations that rely on the node length being fixed. In previous patches we added added and modified node placeholders, so let's use those to indicate dirty here as well. It doesn't look like anything ever depended on this '+' (aside from it being different to the parent), so nothing else needed to change here.
author Durham Goode <durham@fb.com>
date Thu, 10 Nov 2016 02:21:15 -0800
parents 1070df141718
children d6f3877b72c7
comparison
equal deleted inserted replaced
30361:1070df141718 30362:3c6893ba2d36
16 from .i18n import _ 16 from .i18n import _
17 from .node import ( 17 from .node import (
18 addednodeid, 18 addednodeid,
19 bin, 19 bin,
20 hex, 20 hex,
21 modifiednodeid,
21 nullhex, 22 nullhex,
22 nullid, 23 nullid,
23 nullrev, 24 nullrev,
24 ) 25 )
25 from . import ( 26 from . import (
813 copied.update(movewithdir.values()) 814 copied.update(movewithdir.values())
814 815
815 if '.hgsubstate' in m1: 816 if '.hgsubstate' in m1:
816 # check whether sub state is modified 817 # check whether sub state is modified
817 if any(wctx.sub(s).dirty() for s in wctx.substate): 818 if any(wctx.sub(s).dirty() for s in wctx.substate):
818 m1['.hgsubstate'] += '+' 819 m1['.hgsubstate'] = modifiednodeid
819 820
820 # Compare manifests 821 # Compare manifests
821 if matcher is not None: 822 if matcher is not None:
822 m1 = m1.matches(matcher) 823 m1 = m1.matches(matcher)
823 m2 = m2.matches(matcher) 824 m2 = m2.matches(matcher)