diff mercurial/context.py @ 32831:add613cddcb6

workingctx: factor out post-status dirstate fixup We want to allow extensions to be able to add code to run inside the wlock.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 12 Jun 2017 13:54:59 -0700
parents 448fc659a430
children 6d73b7ff8f92
line wrap: on
line diff
--- a/mercurial/context.py	Tue Jun 13 10:02:34 2017 -0400
+++ b/mercurial/context.py	Mon Jun 12 13:54:59 2017 -0700
@@ -1738,7 +1738,10 @@
                 # it's in the dirstate.
                 deleted.append(f)
 
-        # update dirstate for files that are actually clean
+        return modified, deleted, fixup
+
+    def _poststatusfixup(self, fixup):
+        """update dirstate for files that are actually clean"""
         if fixup:
             try:
                 oldid = self._repo.dirstate.identity()
@@ -1767,7 +1770,6 @@
                                             'identity mismatch\n')
             except error.LockError:
                 pass
-        return modified, deleted, fixup
 
     def _dirstatestatus(self, match=None, ignored=False, clean=False,
                         unknown=False):
@@ -1781,15 +1783,17 @@
                                             listclean, listunknown)
 
         # check for any possibly clean files
+        fixup = []
         if cmp:
             modified2, deleted2, fixup = self._checklookup(cmp)
             s.modified.extend(modified2)
             s.deleted.extend(deleted2)
 
-            # update dirstate for files that are actually clean
             if fixup and listclean:
                 s.clean.extend(fixup)
 
+        self._poststatusfixup(fixup)
+
         if match.always():
             # cache for performance
             if s.unknown or s.ignored or s.clean: