comparison mercurial/merge.py @ 27079:a88a10a933b2

mergestate: add a method to compute actions to perform on dirstate We're going to use this to extend the action lists in merge.applyupdates. The somewhat funky return value is to make passing this dict directly into recordactions easier. We're going to exploit that in an upcoming patch.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 20 Nov 2015 16:43:25 -0800
parents a421debae31d
children ae2d3782d818
comparison
equal deleted inserted replaced
27078:a421debae31d 27079:a88a10a933b2
506 506
507 def unresolvedcount(self): 507 def unresolvedcount(self):
508 """get unresolved count for this merge (persistent)""" 508 """get unresolved count for this merge (persistent)"""
509 return len([True for f, entry in self._state.iteritems() 509 return len([True for f, entry in self._state.iteritems()
510 if entry[0] == 'u']) 510 if entry[0] == 'u'])
511
512 def actions(self):
513 """return lists of actions to perform on the dirstate"""
514 actions = {'r': [], 'a': [], 'g': []}
515 for f, (r, action) in self._results.iteritems():
516 if action is not None:
517 actions[action].append((f, None, "merge result"))
518 return actions
511 519
512 def _checkunknownfile(repo, wctx, mctx, f, f2=None): 520 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
513 if f2 is None: 521 if f2 is None:
514 f2 = f 522 f2 = f
515 return (os.path.isfile(repo.wjoin(f)) 523 return (os.path.isfile(repo.wjoin(f))