This is called by journal extension.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | hgext/git/dirstate.py (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
07e1ef5d0f3d | edaa75079ae2 | Pulkit Goyal | Mar 4 2020, 11:20 AM |
@interfaceutil.implementer(intdirstate.idirstate) | @interfaceutil.implementer(intdirstate.idirstate) | ||||
class gitdirstate(object): | class gitdirstate(object): | ||||
def __init__(self, ui, root, gitrepo): | def __init__(self, ui, root, gitrepo): | ||||
self._ui = ui | self._ui = ui | ||||
self._root = os.path.dirname(root) | self._root = os.path.dirname(root) | ||||
self.git = gitrepo | self.git = gitrepo | ||||
self._plchangecallbacks = {} | |||||
def p1(self): | def p1(self): | ||||
return self.git.head.peel().id.raw | return self.git.head.peel().id.raw | ||||
def p2(self): | def p2(self): | ||||
# TODO: MERGE_HEAD? something like that, right? | # TODO: MERGE_HEAD? something like that, right? | ||||
return nodemod.nullid | return nodemod.nullid | ||||
_filecache = set() | _filecache = set() | ||||
def pendingparentchange(self): | def pendingparentchange(self): | ||||
# TODO: we need to implement the context manager bits and | # TODO: we need to implement the context manager bits and | ||||
# correctly stage/revert index edits. | # correctly stage/revert index edits. | ||||
return False | return False | ||||
def write(self, tr): | def write(self, tr): | ||||
# TODO: call parent change callbacks | |||||
if tr: | if tr: | ||||
def writeinner(category): | def writeinner(category): | ||||
self.git.index.write() | self.git.index.write() | ||||
tr.addpending(b'gitdirstate', writeinner) | tr.addpending(b'gitdirstate', writeinner) | ||||
else: | else: | ||||
# TODO: track copies? | # TODO: track copies? | ||||
return None | return None | ||||
@contextlib.contextmanager | @contextlib.contextmanager | ||||
def parentchange(self): | def parentchange(self): | ||||
# TODO: track this maybe? | # TODO: track this maybe? | ||||
yield | yield | ||||
def addparentchangecallback(self, category, callback): | |||||
# TODO: should this be added to the dirstate interface? | |||||
self._plchangecallbacks[category] = callback | |||||
def clearbackup(self, tr, backupname): | def clearbackup(self, tr, backupname): | ||||
# TODO | # TODO | ||||
pass | pass |