mercurial/merge.py
branchstable
changeset 23971 6becb9dbca25
parent 23879 b88278a308c6
child 24471 1ff35d76421c
equal deleted inserted replaced
23970:8a544fb645bb 23971:6becb9dbca25
   739             audit(f)
   739             audit(f)
   740             util.unlinkpath(repo.wjoin(f))
   740             util.unlinkpath(repo.wjoin(f))
   741 
   741 
   742     numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
   742     numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
   743 
   743 
       
   744     def dirtysubstate():
       
   745         # mark '.hgsubstate' as possibly dirty forcibly, because
       
   746         # modified '.hgsubstate' is misunderstood as clean,
       
   747         # when both st_size/st_mtime of '.hgsubstate' aren't changed,
       
   748         # even if "submerge" fails and '.hgsubstate' is inconsistent
       
   749         repo.dirstate.normallookup('.hgsubstate')
       
   750 
   744     if [a for a in actions['r'] if a[0] == '.hgsubstate']:
   751     if [a for a in actions['r'] if a[0] == '.hgsubstate']:
       
   752         dirtysubstate()
   745         subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
   753         subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
   746 
   754 
   747     # remove in parallel (must come first)
   755     # remove in parallel (must come first)
   748     z = 0
   756     z = 0
   749     prog = worker.worker(repo.ui, 0.001, batchremove, (repo,), actions['r'])
   757     prog = worker.worker(repo.ui, 0.001, batchremove, (repo,), actions['r'])
   758         z += i
   766         z += i
   759         progress(_updating, z, item=item, total=numupdates, unit=_files)
   767         progress(_updating, z, item=item, total=numupdates, unit=_files)
   760     updated = len(actions['g'])
   768     updated = len(actions['g'])
   761 
   769 
   762     if [a for a in actions['g'] if a[0] == '.hgsubstate']:
   770     if [a for a in actions['g'] if a[0] == '.hgsubstate']:
       
   771         dirtysubstate()
   763         subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
   772         subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
   764 
   773 
   765     # forget (manifest only, just log it) (must come first)
   774     # forget (manifest only, just log it) (must come first)
   766     for f, args, msg in actions['f']:
   775     for f, args, msg in actions['f']:
   767         repo.ui.debug(" %s: %s -> f\n" % (f, msg))
   776         repo.ui.debug(" %s: %s -> f\n" % (f, msg))
   783     for f, args, msg in actions['m']:
   792     for f, args, msg in actions['m']:
   784         repo.ui.debug(" %s: %s -> m\n" % (f, msg))
   793         repo.ui.debug(" %s: %s -> m\n" % (f, msg))
   785         z += 1
   794         z += 1
   786         progress(_updating, z, item=f, total=numupdates, unit=_files)
   795         progress(_updating, z, item=f, total=numupdates, unit=_files)
   787         if f == '.hgsubstate': # subrepo states need updating
   796         if f == '.hgsubstate': # subrepo states need updating
       
   797             dirtysubstate()
   788             subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
   798             subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
   789                              overwrite)
   799                              overwrite)
   790             continue
   800             continue
   791         audit(f)
   801         audit(f)
   792         r = ms.resolve(f, wctx, labels=labels)
   802         r = ms.resolve(f, wctx, labels=labels)