Read about our upcoming Code of Conduct on this issue

Commit 02783f20 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

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.
parent dbb30bc16fc2
......@@ -522,6 +522,24 @@ class mergestate(object):
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment