Patchwork D8216: hgit: add addparentchangecallback() to dirstate

login
register
mail settings
Submitter phabricator
Date March 4, 2020, 4:47 p.m.
Message ID <differential-rev-PHID-DREV-o2emyxgjyvzgsn5oabaw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45464/
State Superseded
Headers show

Comments

phabricator - March 4, 2020, 4:47 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is called by journal extension.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8216

AFFECTED FILES
  hgext/git/dirstate.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - March 4, 2020, 6:47 p.m.
durin42 added a comment.
durin42 added a reviewer: pulkit.
durin42 commandeered this revision.


  Folded into D6734 <https://phab.mercurial-scm.org/D6734>, thanks

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8216/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8216

To: durin42, #hg-reviewers, pulkit
Cc: durin42, mercurial-devel

Patch

diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -72,6 +72,7 @@ 
         self._ui = ui
         self._root = os.path.dirname(root)
         self.git = gitrepo
+        self._plchangecallbacks = {}
 
     def p1(self):
         return self.git.head.peel().id.raw
@@ -202,6 +203,7 @@ 
         return False
 
     def write(self, tr):
+        # TODO: call parent change callbacks
 
         if tr:
 
@@ -285,6 +287,10 @@ 
         # TODO: track this maybe?
         yield
 
+    def addparentchangecallback(self, category, callback):
+        # TODO: should this be added to the dirstate interface?
+        self._plchangecallbacks[category] = callback
+
     def clearbackup(self, tr, backupname):
         # TODO
         pass