# HG changeset patch # User Siddharth Agarwal # Date 1448258392 28800 # Node ID ef6f98473a487cddadf7fccf5e23a4e50be021f1 # Parent dbb30bc16fc243ff94393aa25b0a1b0c35aef017 mergestate: add methods to queue files to remove, add or get These are meant for use by custom merge drivers that might want to modify the dirstate. Dirstate internal consistency rules require that all removes happen before any adds -- this means that custom merge drivers shouldn't be modifying the dirstate directly. diff -r dbb30bc16fc2 -r ef6f98473a48 mercurial/merge.py --- a/mercurial/merge.py Sun Nov 15 21:27:22 2015 -0800 +++ b/mercurial/merge.py Sun Nov 22 21:59:52 2015 -0800 @@ -522,6 +522,24 @@ branchmerge = self._repo.dirstate.p2() != nullid recordupdates(self._repo, self.actions(), branchmerge) + def queueremove(self, f): + """queues a file to be removed from the dirstate + + Meant for use by custom merge drivers.""" + self._results[f] = 0, 'r' + + def queueadd(self, f): + """queues a file to be added to the dirstate + + Meant for use by custom merge drivers.""" + self._results[f] = 0, 'a' + + def queueget(self, f): + """queues a file to be marked modified in the dirstate + + Meant for use by custom merge drivers.""" + self._results[f] = 0, 'g' + def _checkunknownfile(repo, wctx, mctx, f, f2=None): if f2 is None: f2 = f